ABLATE Source Documentation  0.12.34
ablate::domain::SubDomain Class Reference
+ Inheritance diagram for ablate::domain::SubDomain:

Public Member Functions

 SubDomain (Domain &domain, PetscInt dsNumber, const std::vector< std::shared_ptr< FieldDescription >> &allAuxFields)
 
 SubDomain (const SubDomain &temp_obj)=delete
 
SubDomainoperator= (const SubDomain &temp_obj)=delete
 
void CreateSubDomainStructures ()
 
const FieldGetField (const std::string &fieldName) const
 
const FieldGetField (PetscInt id, FieldLocation location=FieldLocation::SOL) const
 
const std::vector< Field > & GetFields (FieldLocation type=FieldLocation::SOL) const
 
std::vector< FieldGetFields (FieldLocation type, std::string_view tag) const
 
DM GetFieldDM (const Field &field) const noexcept
 
Vec GetVec (const Field &field) const noexcept
 
Vec GetGlobalVec (const Field &field) noexcept
 
auto GetSolutionAccessor (const Field &field) const
 
auto GetConstSolutionAccessor (const Field &field) const
 
auto GetAuxAccessor (const Field &field) const
 
auto GetConstAuxAccessor (const Field &field) const
 
auto GetSolutionAccessor (const std::string &fieldName) const
 
auto GetConstSolutionAccessor (const std::string &fieldName) const
 
auto GetAuxAccessor (const std::string &fieldName)
 
auto GetConstAuxAccessor (const std::string &fieldName)
 
bool ContainsField (const std::string &fieldName)
 
bool InRegion (const domain::Region &) const
 
bool InRegion (PetscInt point) const
 
MPI_Comm GetComm () const
 
DMLabel GetLabel ()
 
const std::string & GetId () const override
 
PetscInt GetDimensions () const noexcept
 
PetscObject GetPetscFieldObject (const Field &field)
 
DM & GetDM () const noexcept
 
DM GetAuxDM () const noexcept
 
Vec GetSolutionVector () const noexcept
 
Vec GetAuxVector () const noexcept
 
Vec GetAuxGlobalVector ()
 
DM GetSubDM ()
 
Vec GetSubSolutionVector ()
 
DM GetSubAuxDM ()
 
Vec GetSubAuxVector ()
 
PetscDS GetDiscreteSystem ()
 
PetscDS GetAuxDiscreteSystem ()
 
PetscInt GetNumberFields () const
 
void ProjectFieldFunctionsToLocalVector (const std::vector< std::shared_ptr< mathFunctions::FieldFunction >> &fieldFunctions, Vec locVec, PetscReal time=0.0) const
 
PetscErrorCode ProjectFieldFunctionsToSubDM (const std::vector< std::shared_ptr< mathFunctions::FieldFunction >> &initialization, Vec globVec, PetscReal time=0.0)
 
void SetsExactSolutions (const std::vector< std::shared_ptr< mathFunctions::FieldFunction >> &exactSolutions)
 
PetscErrorCode GetFieldGlobalVector (const Field &, IS *vecIs, Vec *vec, DM *subdm)
 
PetscErrorCode RestoreFieldGlobalVector (const Field &, IS *vecIs, Vec *vec, DM *subdm)
 
PetscErrorCode GetFieldLocalVector (const Field &, PetscReal time, IS *vecIs, Vec *vec, DM *subdm)
 
PetscErrorCode RestoreFieldLocalVector (const Field &, IS *vecIs, Vec *vec, DM *subdm)
 
PetscErrorCode Save (PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
 
PetscErrorCode Restore (PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
 
void CreateEmptySubDM (DM *inDM, std::shared_ptr< domain::Region > region={})
 
void GetRange (const std::shared_ptr< ablate::domain::Region > &region, PetscInt depth, ablate::domain::Range &range) const
 
void GetCellRange (const std::shared_ptr< ablate::domain::Region > &region, ablate::domain::Range &cellRange) const
 
void GetFaceRange (const std::shared_ptr< ablate::domain::Region > &region, ablate::domain::Range &faceRange) const
 
void RestoreRange (ablate::domain::Range &range) const
 
- Public Member Functions inherited from ablate::io::Serializable
virtual SerializerType Serialize () const
 

Additional Inherited Members

- Public Types inherited from ablate::io::Serializable
enum class  SerializerType { none , collective , serial }
 
- Static Protected Member Functions inherited from ablate::io::Serializable
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)
 

Constructor & Destructor Documentation

◆ SubDomain()

ablate::domain::SubDomain::SubDomain ( Domain domain,
PetscInt  dsNumber,
const std::vector< std::shared_ptr< FieldDescription >> &  allAuxFields 
)

Create a subdomain based upon a domain

Parameters
domain
dsNumberds number in the dm,
allAuxFieldsand a list of aux fields to create in this subdomain

Member Function Documentation

◆ ContainsField()

bool ablate::domain::SubDomain::ContainsField ( const std::string &  fieldName)
inline

Determine if the field is available as either a sol or aux field

Parameters
fieldName
Returns

◆ CreateEmptySubDM()

void ablate::domain::SubDomain::CreateEmptySubDM ( DM *  inDM,
std::shared_ptr< domain::Region region = {} 
)

This checks for whether the label describing the subdomain exists. If it does, use DMPlexFilter. If not, use DMClone to return new DM.

Parameters
inDM

◆ CreateSubDomainStructures()

void ablate::domain::SubDomain::CreateSubDomainStructures ( )

Create the auxDM, auxVec, and other structures on the subDomain

◆ GetAuxAccessor() [1/2]

auto ablate::domain::SubDomain::GetAuxAccessor ( const Field field) const
inline

Returns the accessor for the specified aux field

Parameters
field
Returns

◆ GetAuxAccessor() [2/2]

auto ablate::domain::SubDomain::GetAuxAccessor ( const std::string &  fieldName)
inline

Returns the accessor for the specified aux field

Parameters
field
Returns

◆ GetAuxDiscreteSystem()

PetscDS ablate::domain::SubDomain::GetAuxDiscreteSystem ( )
inline

Get an aux DS if it is available

Returns

◆ GetAuxDM()

DM ablate::domain::SubDomain::GetAuxDM ( ) const
inlinenoexcept

Returns the dm describing the aux fields living in this subdomain. The dm is defined across the entire mesh, but the fields are only define under this subdomain

Returns

◆ GetAuxGlobalVector()

Vec ablate::domain::SubDomain::GetAuxGlobalVector ( )

Return the global aux vector with information updated from the auxLocVec

◆ GetAuxVector()

Vec ablate::domain::SubDomain::GetAuxVector ( ) const
inlinenoexcept

Returns the local aux vector

Returns

◆ GetCellRange()

void ablate::domain::SubDomain::GetCellRange ( const std::shared_ptr< ablate::domain::Region > &  region,
ablate::domain::Range cellRange 
) const
inline

Return the range of cells in the subDomain and region.

Parameters
region
cellRange

◆ GetComm()

MPI_Comm ablate::domain::SubDomain::GetComm ( ) const
inline

The comm used to define this subDomain and resulting solvers

Returns

◆ GetConstAuxAccessor() [1/2]

auto ablate::domain::SubDomain::GetConstAuxAccessor ( const Field field) const
inline

Returns the accessor for the specified aux field

Parameters
field
Returns

◆ GetConstAuxAccessor() [2/2]

auto ablate::domain::SubDomain::GetConstAuxAccessor ( const std::string &  fieldName)
inline

Returns the accessor for the specified aux field

Parameters
field
Returns

◆ GetConstSolutionAccessor() [1/2]

auto ablate::domain::SubDomain::GetConstSolutionAccessor ( const Field field) const
inline

Returns the accessor for the specified solution field by name

Parameters
field
Returns

◆ GetConstSolutionAccessor() [2/2]

auto ablate::domain::SubDomain::GetConstSolutionAccessor ( const std::string &  fieldName) const
inline

Returns the accessor for the specified solution field

Parameters
field
Returns

◆ GetDimensions()

PetscInt ablate::domain::SubDomain::GetDimensions ( ) const
inlinenoexcept

Returns the number of physical dimensions defining the dm

Returns

◆ GetDiscreteSystem()

PetscDS ablate::domain::SubDomain::GetDiscreteSystem ( )
inline

Get the discreteSystem describe system for this subDomain

Returns

◆ GetDM()

DM& ablate::domain::SubDomain::GetDM ( ) const
inlinenoexcept

Returns raw access to the global dm

Returns

◆ GetFaceRange()

void ablate::domain::SubDomain::GetFaceRange ( const std::shared_ptr< ablate::domain::Region > &  region,
ablate::domain::Range faceRange 
) const
inline

Return the range of faces/edges in the subDomain and region.

Parameters
region
cellRange

◆ GetField() [1/2]

const Field& ablate::domain::SubDomain::GetField ( const std::string &  fieldName) const
inline

returns a references to the field (sol/aux) for a given field name

Parameters
fieldNamethe string name of the field
Returns
a reference to the Field object

◆ GetField() [2/2]

const Field& ablate::domain::SubDomain::GetField ( PetscInt  id,
FieldLocation  location = FieldLocation::SOL 
) const
inline

returns a references to the field for a given id and location

Parameters
id
location
Returns

◆ GetFieldDM()

DM ablate::domain::SubDomain::GetFieldDM ( const Field field) const
inlinenoexcept

gets the dm corresponding to a field location (aux/sol)

Parameters
field
Returns

◆ GetFieldGlobalVector()

PetscErrorCode ablate::domain::SubDomain::GetFieldGlobalVector ( const Field field,
IS *  vecIs,
Vec *  vec,
DM *  subdm 
)

Get a global vector with only a single field

Parameters
vecIs
vec
subdm
Returns

◆ GetFieldLocalVector()

PetscErrorCode ablate::domain::SubDomain::GetFieldLocalVector ( const Field field,
PetscReal  time,
IS *  vecIs,
Vec *  vec,
DM *  subdm 
)

Get a local vector (with boundary values) with only a single field

Parameters
vecIs
timetime is ued to insert boundary conditions for the global solution vector
vec
subdm
Returns

◆ GetFields() [1/2]

std::vector< ablate::domain::Field > ablate::domain::SubDomain::GetFields ( FieldLocation  type,
std::string_view  tag 
) const

returns all fields of a certain type with a specific tag. This can be costly and should be used only for setup

Parameters
type
tag
Returns

◆ GetFields() [2/2]

const std::vector<Field>& ablate::domain::SubDomain::GetFields ( FieldLocation  type = FieldLocation::SOL) const
inline

returns all fields of a certain type

Parameters
type(defaults to SOL)
Returns

◆ GetGlobalVec()

Vec ablate::domain::SubDomain::GetGlobalVec ( const Field field)
inlinenoexcept

Returns always returns a global vector of sol or aux

Parameters
field
Returns

◆ GetId()

const std::string& ablate::domain::SubDomain::GetId ( ) const
inlineoverridevirtual

Return the id describing this region

Returns

Implements ablate::io::Serializable.

◆ GetLabel()

DMLabel ablate::domain::SubDomain::GetLabel ( )
inline

The label (if any) used to define this subDomain

Returns

◆ GetNumberFields()

PetscInt ablate::domain::SubDomain::GetNumberFields ( ) const
inline

The number of aux and solution fields in this subdomain

Returns

◆ GetPetscFieldObject()

PetscObject ablate::domain::SubDomain::GetPetscFieldObject ( const Field field)

Get the petscField object from the dm or auxDm for this region

Parameters
fieldName
Returns

◆ GetRange()

void ablate::domain::SubDomain::GetRange ( const std::shared_ptr< ablate::domain::Region > &  region,
PetscInt  depth,
ablate::domain::Range range 
) const
inline

Return the range of DMPlex objects at a given depth in the subDomain and region.

Parameters
region
depth
range

◆ GetSolutionAccessor() [1/2]

auto ablate::domain::SubDomain::GetSolutionAccessor ( const Field field) const
inline

Returns the accessor for the specified solution field by name

Parameters
field
Returns

◆ GetSolutionAccessor() [2/2]

auto ablate::domain::SubDomain::GetSolutionAccessor ( const std::string &  fieldName) const
inline

Returns the accessor for the specified solution field

Parameters
field
Returns

◆ GetSolutionVector()

Vec ablate::domain::SubDomain::GetSolutionVector ( ) const
inlinenoexcept

Returns the global solution vector

Returns

◆ GetSubAuxDM()

DM ablate::domain::SubDomain::GetSubAuxDM ( )

The SubDM is defined as a dm that lives only over this subdomain region. It may be useful for outputting. This function will create (if needed) and return the subdomain for the aux variables. If a subdomain is not needed (same ds over entire dm) the global aux dm is returned.

Returns

◆ GetSubAuxVector()

Vec ablate::domain::SubDomain::GetSubAuxVector ( )

Returns a "global" aux vector defined over the subDomain

Returns

◆ GetSubDM()

DM ablate::domain::SubDomain::GetSubDM ( )

The SubDM is defined as a dm that lives only over this subdomain region. It may be useful for outputting. This function will create (if needed) and return the subdomain. If a subdomain is not needed (same ds over entire dm) the global dm is returned.

Returns

◆ GetSubSolutionVector()

Vec ablate::domain::SubDomain::GetSubSolutionVector ( )

Returns a "global" solution vector defined over the subDomain

Returns

◆ GetVec()

Vec ablate::domain::SubDomain::GetVec ( const Field field) const
inlinenoexcept

Returns the global solution field or the local aux vector depending upon the field

Parameters
field
Returns

◆ InRegion() [1/2]

bool ablate::domain::SubDomain::InRegion ( const domain::Region region) const

Determine if the provided region lives inside of subdomain region

Returns

◆ InRegion() [2/2]

bool ablate::domain::SubDomain::InRegion ( PetscInt  point) const
inline

determines if this point is in this region as defined by the label and labelID

Parameters
point
Returns

◆ ProjectFieldFunctionsToLocalVector()

void ablate::domain::SubDomain::ProjectFieldFunctionsToLocalVector ( const std::vector< std::shared_ptr< mathFunctions::FieldFunction >> &  fieldFunctions,
Vec  locVec,
PetscReal  time = 0.0 
) const

project the list of field function into the provided local vector. Allows solution and aux vectors

Parameters
fieldFunctions
globVec

◆ ProjectFieldFunctionsToSubDM()

PetscErrorCode ablate::domain::SubDomain::ProjectFieldFunctionsToSubDM ( const std::vector< std::shared_ptr< mathFunctions::FieldFunction >> &  initialization,
Vec  globVec,
PetscReal  time = 0.0 
)

Support function to project the fields on to vector that lives only on the subDM

Parameters
initialization
globVec
time

◆ Restore()

PetscErrorCode ablate::domain::SubDomain::Restore ( PetscViewer  viewer,
PetscInt  sequenceNumber,
PetscReal  time 
)
overridevirtual

Serialization restore

Parameters
viewer
sequenceNumber
time

Implements ablate::io::Serializable.

◆ RestoreFieldGlobalVector()

PetscErrorCode ablate::domain::SubDomain::RestoreFieldGlobalVector ( const Field field,
IS *  vecIs,
Vec *  vec,
DM *  subdm 
)

Restore a global vector with only a single field

Parameters
vecIs
vec
subdm
Returns

◆ RestoreFieldLocalVector()

PetscErrorCode ablate::domain::SubDomain::RestoreFieldLocalVector ( const Field field,
IS *  vecIs,
Vec *  vec,
DM *  subdm 
)

Restore a local vector with only a single field

Parameters
vecIs
vec
subdm
Returns

◆ RestoreRange()

void ablate::domain::SubDomain::RestoreRange ( ablate::domain::Range range) const
inline

Restore the range of cells in the subDomain and region.

Parameters
range

◆ Save()

PetscErrorCode ablate::domain::SubDomain::Save ( PetscViewer  viewer,
PetscInt  sequenceNumber,
PetscReal  time 
)
overridevirtual

Serialization save

Parameters
viewer
sequenceNumber
time

Implements ablate::io::Serializable.

◆ SetsExactSolutions()

void ablate::domain::SubDomain::SetsExactSolutions ( const std::vector< std::shared_ptr< mathFunctions::FieldFunction >> &  exactSolutions)

set exactSolutions if the fields live in the ds

Parameters
exactSolutions

The documentation for this class was generated from the following files: