|
| ParticleSolver (std::string solverId, std::shared_ptr< domain::Region >, std::shared_ptr< parameters::Parameters > options, std::vector< FieldDescription > fields, std::vector< std::shared_ptr< processes::Process >> processes, std::shared_ptr< initializers::Initializer > initializer, std::vector< std::shared_ptr< mathFunctions::FieldFunction >> fieldInitialization, std::vector< std::shared_ptr< mathFunctions::FieldFunction >> exactSolutions={}) |
|
| ParticleSolver (std::string solverId, std::shared_ptr< domain::Region >, std::shared_ptr< parameters::Parameters > options, const std::vector< std::shared_ptr< FieldDescription >> &fields, std::vector< std::shared_ptr< processes::Process >> processes, std::shared_ptr< initializers::Initializer > initializer, std::vector< std::shared_ptr< mathFunctions::FieldFunction >> fieldInitialization, std::vector< std::shared_ptr< mathFunctions::FieldFunction >> exactSolutions={}) |
|
void | Setup () override |
|
void | Initialize () override |
|
DM | GetParticleDM () |
|
TS | GetParticleTS () |
|
const std::string & | GetId () const override |
|
PetscErrorCode | Save (PetscViewer viewer, PetscInt steps, PetscReal time) override |
|
PetscErrorCode | Restore (PetscViewer viewer, PetscInt steps, PetscReal time) override |
|
virtual void | Register (std::shared_ptr< ablate::domain::SubDomain > subDomain) |
|
const std::string & | GetSolverId () const |
|
ablate::domain::SubDomain & | GetSubDomain () noexcept |
|
const ablate::domain::SubDomain & | GetSubDomain () const noexcept |
|
std::shared_ptr< domain::Region > | GetRegion () const noexcept |
|
void | PreStage (TS ts, PetscReal stagetime) |
|
void | PreStep (TS ts) |
|
void | PostStep (TS ts) |
|
void | PostEvaluate (TS ts) |
|
void | RegisterPreStep (const std::function< void(TS ts, Solver &)> &preStep) |
|
void | RegisterPreStage (const std::function< void(TS ts, Solver &, PetscReal)> &preStage) |
|
void | RegisterPostStep (const std::function< void(TS ts, Solver &)> &postStep) |
|
void | RegisterPostEvaluate (const std::function< void(TS ts, Solver &)> &postEval) |
|
void | GetCellRange (ablate::domain::Range &cellRange) const |
|
void | GetFaceRange (ablate::domain::Range &faceRange) const |
|
void | GetRange (PetscInt depth, ablate::domain::Range &range) const |
|
void | RestoreRange (ablate::domain::Range &range) const |
|
virtual SerializerType | Serialize () const |
|
|
static const char | ParticleVelocity [] = "ParticleVelocity" |
|
static const char | ParticleDiameter [] = "ParticleDiameter" |
|
static const char | ParticleDensity [] = "ParticleDensity" |
|
static const char | PackedSolution [] = "PackedSolution" |
|
static const char | ParticleInitialLocation [] = "InitialLocation" |
|
static const char | ParticleCoordinates [] = "coordinates" |
| These coordinates are part of the solution vector.
|
|
|
static PetscErrorCode | ComputeParticleError (TS particleTS, Vec u, Vec e) |
|
static PetscErrorCode | ComputeParticleRHS (TS ts, PetscReal t, Vec X, Vec F, void *ctx) |
|
static PetscErrorCode | DMPlexInsertBoundaryValues_Plex (DM dm, PetscDS ds, PetscBool insertEssential, Vec locX, PetscReal time, Vec faceGeomFVM, Vec cellGeomFVM, Vec gradFVM) |
|
static PetscErrorCode | DMPlexInsertTimeDerivativeBoundaryValues_Plex (DM dm, PetscDS ds, PetscBool insertEssential, Vec locX, PetscReal time, Vec faceGeomFVM, Vec cellGeomFVM, Vec gradFVM) |
|
static PetscErrorCode | SaveKeyValue (PetscViewer viewer, const char *name, PetscScalar value) |
|
static PetscErrorCode | RestoreKeyValue (PetscViewer viewer, const char *name, PetscScalar &value) |
|
template<class T > |
static PetscErrorCode | SaveKeyValue (PetscViewer viewer, const char *name, T value) |
|
template<class T > |
static PetscErrorCode | RestoreKeyValue (PetscViewer viewer, const char *name, T &value) |
|
template<class T > |
static SerializerType | DetermineSerializerType (const T &types) |
|
◆ ParticleSolver() [1/2]
default constructor
- Parameters
-
solverId | |
options | |
fields | |
processes | |
initializer | |
fieldInitialization | |
exactSolutions | |
◆ ParticleSolver() [2/2]
shared pointer version of the constructor
- Parameters
-
solverId | |
options | |
fields | |
processes | |
initializer | |
fieldInitialization | |
exactSolutions | |
◆ ComputeParticleError()
PetscErrorCode ablate::particles::ParticleSolver::ComputeParticleError |
( |
TS |
particleTS, |
|
|
Vec |
u, |
|
|
Vec |
e |
|
) |
| |
|
staticprotected |
computes the error based upon the the specified exact solution and initial particle location
- Parameters
-
- Returns
◆ ComputeParticleExactSolution()
PetscErrorCode ablate::particles::ParticleSolver::ComputeParticleExactSolution |
( |
TS |
particleTS, |
|
|
Vec |
exactSolutionVec |
|
) |
| |
|
static |
Helper function useful for tests
- Parameters
-
- Returns
◆ ComputeParticleRHS()
PetscErrorCode ablate::particles::ParticleSolver::ComputeParticleRHS |
( |
TS |
ts, |
|
|
PetscReal |
t, |
|
|
Vec |
X, |
|
|
Vec |
F, |
|
|
void * |
ctx |
|
) |
| |
|
staticprotected |
computes the particle rhs for the particle TS
- Parameters
-
- Returns
◆ CoordinatesFromSolutionVector()
void ablate::particles::ParticleSolver::CoordinatesFromSolutionVector |
( |
| ) |
|
|
protected |
map the solution vector coordinates to the particle coordinates
◆ CoordinatesToSolutionVector()
void ablate::particles::ParticleSolver::CoordinatesToSolutionVector |
( |
| ) |
|
|
protected |
map the coordinates to the solution vector
◆ GetField() [1/3]
template<class T >
void ablate::particles::ParticleSolver::GetField |
( |
const Field & |
field, |
|
|
T ** |
values |
|
) |
| |
|
inlineprotected |
Get the array based upon field
◆ GetField() [2/3]
const Field& ablate::particles::ParticleSolver::GetField |
( |
const std::string & |
fieldName | ) |
const |
|
inlineprotected |
Get field information based upon field name
◆ GetField() [3/3]
template<class T >
const Field& ablate::particles::ParticleSolver::GetField |
( |
const std::string & |
fieldName, |
|
|
T ** |
values |
|
) |
| |
|
inlineprotected |
Get the array and field information based upon field name
◆ GetId()
const std::string& ablate::particles::ParticleSolver::GetId |
( |
| ) |
const |
|
inlineoverridevirtual |
only required function, returns the id of the object. Should be unique for the simulation
- Returns
Implements ablate::io::Serializable.
◆ GetParticleDM()
DM ablate::particles::ParticleSolver::GetParticleDM |
( |
| ) |
|
|
inline |
return access to the particle dm
- Returns
- the swamParticle dm
◆ GetParticleTS()
TS ablate::particles::ParticleSolver::GetParticleTS |
( |
| ) |
|
|
inline |
return access to the particle dm
- Returns
- the swamParticle dm
◆ MacroStepParticles()
void ablate::particles::ParticleSolver::MacroStepParticles |
( |
TS |
macroTS, |
|
|
bool |
swarmMigrate |
|
) |
| |
|
protectedvirtual |
◆ ProjectFunction()
void ablate::particles::ParticleSolver::ProjectFunction |
( |
const std::shared_ptr< mathFunctions::FieldFunction > & |
fieldFunction, |
|
|
PetscReal |
time = 0.0 |
|
) |
| |
|
protected |
Project the field function to the particle field
◆ RegisterParticleField()
void ablate::particles::ParticleSolver::RegisterParticleField |
( |
const FieldDescription & |
fieldDescriptor | ) |
|
|
protected |
The register fields adds the field to the swarm
- Parameters
-
The unique name of the particle field
The name of the components
The name of the components
The field type (sol or aux)
The type of field
The offset in the local array, 0 for aux, computed for sol
The size of the component for this data
◆ Restore()
PetscErrorCode ablate::particles::ParticleSolver::Restore |
( |
PetscViewer |
viewer, |
|
|
PetscInt |
steps, |
|
|
PetscReal |
time |
|
) |
| |
|
overridevirtual |
◆ RestoreField() [1/2]
template<class T >
void ablate::particles::ParticleSolver::RestoreField |
( |
const Field & |
field, |
|
|
T ** |
values |
|
) |
| |
|
inlineprotected |
Restore the array and field information based upon field name
◆ RestoreField() [2/2]
template<class T >
void ablate::particles::ParticleSolver::RestoreField |
( |
const std::string & |
fieldName, |
|
|
T ** |
values |
|
) |
| |
|
inlineprotected |
Restore the array and field information based upon field name
◆ Save()
PetscErrorCode ablate::particles::ParticleSolver::Save |
( |
PetscViewer |
viewer, |
|
|
PetscInt |
steps, |
|
|
PetscReal |
time |
|
) |
| |
|
overridevirtual |
◆ Setup()
void ablate::particles::ParticleSolver::Setup |
( |
| ) |
|
|
overridevirtual |
Setup and size the subDomain with the subDomain
DMSWARM_PIC is suitable for particle-in-cell methods. Configured as DMSWARM_PIC, the swarm will be aware of, another DM which serves as the background mesh. Fields specific to particle-in-cell methods are registered by default. These include spatial coordinates, a unique identifier, a cell index and an index for the owning rank. The background mesh will (by default) define the spatial decomposition of the points defined in the swarm. DMSWARM_PIC provides support for particle-in-cell operations such as defining initial point coordinates, communicating particles between sub-domains, projecting particle data fields on to the mesh.
Implements ablate::solver::Solver.
◆ StoreInitialParticleLocations()
void ablate::particles::ParticleSolver::StoreInitialParticleLocations |
( |
| ) |
|
|
protected |
stores the initial particle locations in the ParticleInitialLocation field
◆ SwarmMigrate()
void ablate::particles::ParticleSolver::SwarmMigrate |
( |
| ) |
|
|
protected |
Migrate the particle between ranks based upon the background mesh
◆ ParticleVelocity
const char ablate::particles::ParticleSolver::ParticleVelocity[] = "ParticleVelocity" |
|
inlinestatic |
common field names for particles
The documentation for this class was generated from the following files: