17 const std::string &inName,
18 const std::string &inFilePath)
44 PetscFunctionBeginUser;
46 ierr = PetscFinalized(&finalized); CHKERRV(ierr);
47 if (finalized)
return;
49 ierr = DMDestroy(&
da); CHKERRV(ierr);
55 PetscFunctionBeginUser;
63 ierr = DMDestroy(&
da); CHKERRQ(ierr);
69 PetscFunctionReturn(0);
76 PetscFunctionBeginUser;
80 PetscFunctionReturn(0);
84 const std::string &type,
85 const std::string &name,
86 const std::string &filePath,
89 PetscFunctionBeginUser;
92 body = std::make_shared<SingleBodyPoints>(comm, dim, name, filePath);
94 SETERRQ1(PETSC_COMM_WORLD, PETSC_ERR_ARG_WRONG,
95 "The type of body file \"%s\" is not recognized!\n",
98 PetscFunctionReturn(0);
PetscInt nPts
Total number of Lagrangian points.
std::string name
Name of the body.
PetscInt edPt
Global index of the last local Lagrangian point.
MPI_Comm comm
MPI communicator.
PetscMPIInt mpiRank
Rank of the local process.
PetscMPIInt mpiSize
Total number of processes.
PetscInt bgPt
Global index of the first local Lagrangian point.
PetscInt dim
Number of dimensions.
virtual PetscErrorCode destroy()
Manually destroy data.
DM da
Parallel layout of the body (as a 1D DMDA object).
PetscErrorCode printInfo() const
Print information about the body.
type::IntVec1D offsetsAllProcs
Offset on each process.
type::IntVec2D meshIdx
Index of the closest Eulerian mesh cell for each local Lagrangian point.
type::IntVec1D nLclAllProcs
Vector with the number of local unknowns on each process.
std::string filePath
Path of the file with the body coordinates.
type::RealVec2D coords
Coordinates of ALL Lagrangian points.
SingleBodyBase()=default
Default constructor.
std::string info
String with information about the body.
PetscInt nLclPts
Local number of Lagrangian points.
virtual ~SingleBodyBase()
Default destructor.
PetscErrorCode createSingleBody(const MPI_Comm &comm, const PetscInt &dim, const std::string &type, const std::string &name, const std::string &filePath, type::SingleBody &body)
Factory function to create a single body.
std::shared_ptr< body::SingleBodyBase > SingleBody
Definition of type::SingleBody.
PetscErrorCode print(const std::string &info)
Print information of a parallel object to standard output.
std::vector< IntVec1D > IntVec2D
2D std::vector holding PetscInt.
std::vector< RealVec1D > RealVec2D
2D std::vector holding PetscReal.
std::vector< PetscInt > IntVec1D
1D std::vector holding PetscInt.
Prototypes of I/O functions.
A toolbox for building flow solvers.
body::SingleBodyBase, type::SingleBody factory function.
Definition of body::SingleBodyPoints.