def main(): # --- Workspace set up --- # withMPI = False comm = None myid = 0 numberPart = 0 rootProcess = 0 cupyutil.load(fileName, withMPI, comm, myid, numberPart) # --- Initialize the solid solver --- # solid = None if myid == rootProcess: import cupydoInterfaces.MtfInterface solid = cupydoInterfaces.MtfInterface.MtfSolver('beam', 'unsteady') cupyutil.mpiBarrier(comm) # --- Initialize the FSI algorithm --- # fsi_algo = cupyalgo.FsiSolidTestAlgorithm(solid) # --- Launch the FSI computation --- # fsi_algo.run() # --- Exit the solid solver --- # if myid == rootProcess: solid.exit() # --- Exit computation --- # cupyutil.mpiBarrier(comm) return 0
def main(_p, nogui): # NB, the argument 'nogui' is specific to PFEM only! p = getParameters(_p) # --- Workspace set up --- # withMPI = False comm = None myid = 0 numberPart = 0 rootProcess = 0 cupyutil.load(fileName, withMPI, comm, myid, numberPart) # --- Input parameters --- # cfd_file = 'waterColoumnFallWithFlexibleObstacle_water_Pfem_NotMatching' csd_file = 'waterColoumnFallWithFlexibleObstacle_obstacle_Mtf_E_1_0e6_NotMatching' # --- Initialize the fluid solver --- # import cupydoInterfaces.PfemInterface fluidSolver = cupydoInterfaces.PfemInterface.PfemSolver(cfd_file, 17, p['dt']) # --- This part is specific to PFEM --- fluidSolver.pfem.scheme.nthreads = p['nthreads'] fluidSolver.pfem.scheme.savefreq = p['saveFreqPFEM'] if nogui: fluidSolver.pfem.gui = None # --- cupyutil.mpiBarrier(comm) # --- Initialize the solid solver --- # solidSolver = None if myid == rootProcess: import cupydoInterfaces.MtfInterface solidSolver = cupydoInterfaces.MtfInterface.MtfSolver(csd_file, p['computationType']) # --- This part is specific to Metafor --- solidSolver.saveAllFacs = p['mtfSaveAllFacs'] cupyutil.mpiBarrier(comm) # --- Initialize the FSI manager --- # manager = cupyman.Manager(fluidSolver, solidSolver, p['nDim'], p['computationType'], comm) cupyutil.mpiBarrier() # --- Initialize the interpolator --- # #interpolator = cupyinterp.MatchingMeshesInterpolator(manager, fluidSolver, solidSolver, comm) interpolator = cupyinterp.RBFInterpolator(manager, fluidSolver, solidSolver, p['rbfRadius'], comm) #interpolator = cupyinterp.TPSInterpolator(manager, fluidSolver, solidSolver, comm) # --- Initialize the FSI criterion --- # criterion = cupycrit.DispNormCriterion(p['tollFSI']) cupyutil.mpiBarrier() # --- Initialize the FSI algorithm --- # algorithm = cupyalgo.AlgorithmBGSAitkenRelax(manager, fluidSolver, solidSolver, interpolator, criterion, p['nFSIIterMax'], p['dt'], p['tTot'], p['timeIterTreshold'], p['omegaMax'], comm) # --- Launch the FSI computation --- # algorithm.run()
def main(_p, nogui): # NB, the argument 'nogui' is specific to PFEM only! p = getParameters(_p) # --- Workspace set up --- # withMPI = False comm = None myid = 0 numberPart = 0 rootProcess = 0 cupyutil.load(p['testName'], withMPI, comm, myid, numberPart) # --- Input parameters --- # cfd_file = p['cfdFile'] csd_file = p['csdFile'] # --- Initialize the fluid solver --- # import cupydo.interfaces.Pfem as fItf fluidSolver = fItf.Pfem(cfd_file, 14, p['dt']) fluidSolver.pfem.pbl.betaFSI = p['betaFSI'] # --- This part is specific to PFEM --- fluidSolver.pfem.scheme.nthreads = p['nthreads'] fluidSolver.pfem.scheme.savefreq = p['saveFreqPFEM'] if nogui: fluidSolver.pfem.gui = None # --- cupyutil.mpiBarrier(comm) # --- Initialize the solid solver --- # solidSolver = None if myid == rootProcess: import cupydo.interfaces.Metafor as sItf solidSolver = sItf.Metafor(csd_file, p['computationType']) # --- This part is specific to Metafor --- solidSolver.saveAllFacs = p['mtfSaveAllFacs'] cupyutil.mpiBarrier(comm) # --- Initialize the FSI manager --- # manager = cupyman.Manager(fluidSolver, solidSolver, p['nDim'], p['computationType'], comm) cupyutil.mpiBarrier() # --- Initialize the interpolator --- # interpolator = cupyinterp.MatchingMeshesInterpolator(manager, fluidSolver, solidSolver, comm) # --- Initialize the FSI criterion --- # criterion = cupycrit.DispNormCriterion(p['tollFSI']) cupyutil.mpiBarrier() # --- Initialize the FSI algorithm --- # algorithm = cupyalgo.AlgorithmBGSAitkenRelax(manager, fluidSolver, solidSolver, interpolator, criterion, p['nFSIIterMax'], p['dt'], p['tTot'], p['timeIterTreshold'], p['omegaMax'], comm) algorithm.atikenCrit = p['aitkenCrit'] # --- Launch the FSI computation --- # algorithm.run()
def main(_p, nogui): # NB, the argument 'nogui' is specific to PFEM only! p = getParameters(_p) # --- Workspace set up --- # withMPI = False comm = None myid = 0 numberPart = 0 rootProcess = 0 cupyutil.load(p['testName'], withMPI, comm, myid, numberPart) # --- Input parameters --- # cfd_file = 'waterColoumnWithElasticGate_water_Pfem_fine' csd_file = 'waterColoumnWithElasticGate_gate_Mtf_rho_1100_fine_gravity_MooneyRivlin' # --- Initialize the fluid solver --- # import cupydo.interfaces.Pfem as fItf fluidSolver = fItf.Pfem(cfd_file, 17, p['dt']) # --- This part is specific to PFEM --- fluidSolver.pfem.scheme.nthreads = p['nthreads'] fluidSolver.pfem.scheme.savefreq = p['saveFreqPFEM'] if nogui: fluidSolver.pfem.gui = None # --- cupyutil.mpiBarrier(comm) # --- Initialize the solid solver --- # solidSolver = None if myid == rootProcess: import cupydo.interfaces.Metafor as sItf solidSolver = sItf.Metafor(csd_file, p['computationType']) # --- This part is specific to Metafor --- solidSolver.saveAllFacs = p['mtfSaveAllFacs'] cupyutil.mpiBarrier(comm) # --- Initialize the FSI manager --- # manager = cupyman.Manager(fluidSolver, solidSolver, p['nDim'], p['computationType'], comm) cupyutil.mpiBarrier() # --- Initialize the interpolator --- # interpolator = cupyinterp.MatchingMeshesInterpolator( manager, fluidSolver, solidSolver, comm) # --- Initialize the FSI criterion --- # criterion = cupycrit.DispNormCriterion(p['tollFSI']) cupyutil.mpiBarrier() # --- Initialize the FSI algorithm --- # algorithm = cupyalgo.AlgorithmIQN_ILS( manager, fluidSolver, solidSolver, interpolator, criterion, p['nFSIIterMax'], p['dt'], p['tTot'], p['timeIterTreshold'], p['omegaMax'], p['nbTimeToKeep'], p['computeTangentMatrixBasedOnFirstIt'], comm) algorithm.qrFilter = p['QR_filter'] algorithm.tollQR = p['tollQR'] # --- Launch the FSI computation --- # algorithm.run()
def main(_p, nogui): p = getParameters(_p) # --- Workspace set up --- # withMPI = False comm = None myid = 0 numberPart = 0 rootProcess = 0 cupyutil.load(fileName, withMPI, comm, myid, numberPart) cfd_file = 'birdImpact_deformable_panel_bird_Pfem' csd_file = 'birdImpact_deformable_panel_panel_alu_Mtf' # --- Initialize the fluid solver --- # import cupydoInterfaces.PfemInterface fluidSolver = cupydoInterfaces.PfemInterface.PfemSolver( cfd_file, 13, p['dt']) # --- This part is specific to PFEM --- fluidSolver.pfem.scheme.nthreads = p['nthreads'] fluidSolver.pfem.scheme.savefreq = p['saveFreqPFEM'] if nogui: fluidSolver.pfem.gui = None # --- cupyutil.mpiBarrier(comm) # --- Initialize the solid solver --- # solidSolver = None if myid == rootProcess: import cupydoInterfaces.MtfInterface solidSolver = cupydoInterfaces.MtfInterface.MtfSolver( csd_file, p['computationType']) # --- This part is specific to Metafor --- solidSolver.saveAllFacs = p['mtfSaveAllFacs'] cupyutil.mpiBarrier(comm) # --- Initialize the FSI manager --- # manager = cupyman.Manager(fluidSolver, solidSolver, p['nDim'], p['computationType'], comm) cupyutil.mpiBarrier() # --- Initialize the interpolator --- # interpolator = cupyinterp.MatchingMeshesInterpolator( manager, fluidSolver, solidSolver, comm) # --- Initialize the FSI criterion --- # criterion = cupycrit.DispNormCriterion(p['tollFSI']) cupyutil.mpiBarrier() # --- Initialize the FSI algorithm --- # algorithm = cupyalgo.AlgorithmBGSAitkenRelax(manager, fluidSolver, solidSolver, interpolator, criterion, p['nFSIIterMax'], p['dt'], p['tTot'], p['timeIterTreshold'], p['omegaMax'], comm) # --- Launch the FSI computation --- # algorithm.run()
def main(_p, nogui): # NB, the argument 'nogui' is specific to PFEM only! p = getParameters(_p) comm = None myid = 0 numberPart = 0 rootProcess = 0 cupyutil.load(fileName, p['withMPI'], comm, myid, numberPart) if p['withMPI']: from mpi4py import MPI comm = MPI.COMM_WORLD myid = comm.Get_rank() numberPart = comm.Get_size() else: comm = None myid = 0 numberPart = 1 cfd_file = '../../../tests/SU2_Metafor/CantileverSquareChannel_BGS_parallel_SU2Conf.cfg' csd_file = 'CantileverSquareChannel_BGS_parallel_MetaforConf' # --- Initialize the fluid solver --- # import cupydoInterfaces.SU2Interface if comm != None: fluidSolver = cupydoInterfaces.SU2Interface.SU2Solver( cfd_file, p['nZones_SU2'], p['nDim'], p['computationType'], p['nodalLoadsType'], p['withMPI'], comm) else: fluidSolver = cupydoInterfaces.SU2Interface.SU2Solver( cfd_file, p['nZones_SU2'], p['nDim'], p['computationType'], p['nodalLoadsType'], p['withMPI'], 0) cupyutil.mpiBarrier(comm) # --- Initialize the solid solver --- # solidSolver = None if myid == rootProcess: import cupydoInterfaces.MtfInterface solidSolver = cupydoInterfaces.MtfInterface.MtfSolver( csd_file, p['computationType']) # --- This part is specific to Metafor --- solidSolver.saveAllFacs = p['mtfSaveAllFacs'] cupyutil.mpiBarrier(comm) # --- Initialize the FSI manager --- # manager = cupyman.Manager(fluidSolver, solidSolver, p['nDim'], p['computationType'], comm) cupyutil.mpiBarrier() # --- Initialize the interpolator --- # interpolator = cupyinterp.MatchingMeshesInterpolator( manager, fluidSolver, solidSolver, comm) # --- Initialize the FSI criterion --- # criterion = cupycrit.DispNormCriterion(p['tollFSI']) cupyutil.mpiBarrier() # --- Initialize the FSI algorithm --- # algorithm = cupyalgo.AlgorithmIQN_ILS( manager, fluidSolver, solidSolver, interpolator, criterion, p['nFSIIterMax'], p['dt'], p['tTot'], p['timeIterTreshold'], p['omegaMax'], p['nbTimeToKeep'], p['computeTangentMatrixBasedOnFirstIt'], comm) # --- Launch the FSI computation --- # algorithm.run() # --- Exit computation --- # del manager del criterion del fluidSolver del solidSolver del interpolator del algorithm cupyutil.mpiBarrier(comm) return 0
def main(_p, nogui): p = getParameters(_p) comm = None myid = 0 numberPart = 0 rootProcess = 0 cupyutil.load(fileName, p['withMPI'], comm, myid, numberPart) if p['withMPI']: from mpi4py import MPI comm = MPI.COMM_WORLD myid = comm.Get_rank() numberPart = comm.Get_size() else: comm = None myid = 0 numberPart = 1 # --- Input parameters --- # CFD_file = '../../../tests/SU2_Metafor/AGARD445_Static_SU2Conf.cfg' CSD_file = 'AGARD445_Static_MetaforConf' # --- Initialize the fluid solver --- # import cupydoInterfaces.SU2Interface if comm != None: FluidSolver = cupydoInterfaces.SU2Interface.SU2Solver( CFD_file, p['nZones_SU2'], p['nDim'], p['computationType'], p['nodalLoadsType'], p['withMPI'], comm) else: FluidSolver = cupydoInterfaces.SU2Interface.SU2Solver( CFD_file, p['nZones_SU2'], p['nDim'], p['computationType'], p['nodalLoadsType'], p['withMPI'], 0) cupyutil.mpiBarrier(comm) # --- Initialize the solid solver --- # SolidSolver = None if myid == rootProcess: import cupydoInterfaces.MtfInterface SolidSolver = cupydoInterfaces.MtfInterface.MtfSolver( CSD_file, p['computationType']) SolidSolver.saveAllFacs = p['mtfSaveAllFacs'] cupyutil.mpiBarrier(comm) # --- Initialize the FSI manager --- # manager = cupyman.Manager(FluidSolver, SolidSolver, p['nDim'], p['computationType'], comm) cupyutil.mpiBarrier() # --- Initialize the interpolator --- # interpolator = cupyinterp.TPSInterpolator(manager, FluidSolver, SolidSolver, comm) solverList = interpolator.getLinearSolvers() for ii in range(2): solverList[ii].setMaxNumberIterations(1000) solverList[ii].setPreconditioner("JACOBI") # --- Initialize the FSI criterion --- # criterion = cupycrit.DispNormCriterion(p['tollFSI']) cupyutil.mpiBarrier() # --- Initialize the FSI algorithm --- # algorithm = cupyalgo.AlgorithmBGSStaticRelax(manager, FluidSolver, SolidSolver, interpolator, criterion, p['nFSIIterMax'], p['dt'], p['tTot'], p['timeIterTreshold'], p['omegaMax'], comm) # --- Launch the FSI computation --- # algorithm.run() # --- Exit computation --- # del manager del criterion del FluidSolver del SolidSolver del interpolator del algorithm cupyutil.mpiBarrier(comm) return 0
def main(_p, nogui): p = getParameters(_p) comm = None myid = 0 numberPart = 0 rootProcess = 0 cupyutil.load(fileName, p['withMPI'], comm, myid, numberPart) if p['withMPI']: from mpi4py import MPI comm = MPI.COMM_WORLD myid = comm.Get_rank() numberPart = comm.Get_size() else: comm = None myid = 0 numberPart = 1 cfd_file = '../../../tests/SU2_RBM/PitchPlungeAirfoil_BGS_parallel_SU2Conf.cfg' csd_file = '../../../tests/SU2_RBM/PitchPlungeAirfoil_BGS_parallel_RBMConf.cfg' # --- Initialize the fluid solver --- # import cupydoInterfaces.SU2Interface if comm != None: fluidSolver = cupydoInterfaces.SU2Interface.SU2Solver(cfd_file, p['nZones_SU2'], p['nDim'], p['computationType'], p['nodalLoadsType'], p['withMPI'], comm) else: fluidSolver = cupydoInterfaces.SU2Interface.SU2Solver(cfd_file, p['nZones_SU2'], p['nDim'], p['computationType'], p['nodalLoadsType'], p['withMPI'], 0) cupyutil.mpiBarrier(comm) # --- Initialize the solid solver --- # solidSolver = None if myid == rootProcess: import cupydoInterfaces.RBMIntegratorInterface solidSolver = cupydoInterfaces.RBMIntegratorInterface.RBMIntegrator(csd_file, p['computationType']) cupyutil.mpiBarrier(comm) # --- Initialize the FSI manager --- # manager = cupyman.Manager(fluidSolver, solidSolver, p['nDim'], p['computationType'], comm) cupyutil.mpiBarrier() # --- Initialize the interpolator --- # interpolator = cupyinterp.MatchingMeshesInterpolator(manager, fluidSolver, solidSolver, comm) # --- Initialize the FSI criterion --- # criterion = cupycrit.DispNormCriterion(p['tollFSI']) cupyutil.mpiBarrier() # --- Initialize the FSI algorithm --- # algorithm = cupyalgo.AlgorithmBGSStaticRelax(manager, fluidSolver, solidSolver, interpolator, criterion, p['nFSIIterMax'], p['dt'], p['tTot'], p['timeIterTreshold'], p['omegaMax'], comm) # --- Launch the FSI computation --- # algorithm.run() # --- Exit computation --- # del manager del criterion del fluidSolver del solidSolver del interpolator del algorithm cupyutil.mpiBarrier(comm) return 0