GEOS
Static Public Member Functions | List of all members
geos::FieldSpecificationImpl Class Reference

Methods to apply field specifications. More...

#include <FieldSpecificationImpl.hpp>

Static Public Member Functions

template<typename OBJECT_TYPE , typename BC_TYPE = FieldSpecification, typename LAMBDA >
static void apply (BC_TYPE const &fs, MeshLevel &mesh, LAMBDA &&lambda)
 Apply this field specification to the discretization. More...
 
template<typename OBJECT_TYPE , typename BC_TYPE = FieldSpecification, typename LAMBDA >
static void apply (BC_TYPE const &fs, MeshLevel &mesh, LAMBDA &&lambda, real64 const &time, string const &fieldName)
 If applicable in the current time and field, apply this field specification to the discretization. More...
 
template<typename FIELD_OP , typename POLICY , typename T , int N, int USD>
static void applyFieldValueKernel (FieldSpecification const &fs, ArrayView< T, N, USD > const &field, SortedArrayView< localIndex const > const &targetSet, real64 const time, dataRepository::Group &dataGroup)
 
template<typename FIELD_OP , typename POLICY = parallelHostPolicy>
static void applyFieldValue (FieldSpecification const &fs, SortedArrayView< localIndex const > const &targetSet, real64 const time, dataRepository::Group &dataGroup, string const &fieldName)
 
template<typename FIELD_OP , typename POLICY , typename T , int NDIM, int USD>
static void applyBoundaryConditionToSystemKernel (FieldSpecification const &fs, SortedArrayView< localIndex const > const &targetSet, real64 const time, dataRepository::Group const &dataGroup, arrayView1d< globalIndex const > const &dofMap, globalIndex const dofRankOffset, CRSMatrixView< real64, globalIndex const > const &matrix, arrayView1d< real64 > const &rhs, ArrayView< T const, NDIM, USD > const &fieldView)
 Apply a boundary condition to a system of equations. More...
 
template<typename FIELD_OP , typename POLICY >
static void applyBoundaryConditionToSystem (FieldSpecification const &fs, SortedArrayView< localIndex const > const &targetSet, real64 const time, dataRepository::Group const &dataGroup, string const &fieldName, string const &dofMapName, globalIndex const dofRankOffset, CRSMatrixView< real64, globalIndex const > const &matrix, arrayView1d< real64 > const &rhs)
 Apply a boundary condition to a system of equations. More...
 
template<typename FIELD_OP , typename POLICY , typename LAMBDA >
static void applyBoundaryConditionToSystem (FieldSpecification const &fs, SortedArrayView< localIndex const > const &targetSet, real64 const time, dataRepository::Group const &dataGroup, arrayView1d< globalIndex const > const &dofMap, globalIndex const dofRankOffset, CRSMatrixView< real64, globalIndex const > const &matrix, arrayView1d< real64 > const &rhs, LAMBDA &&lambda)
 Apply a boundary condition to a system of equations. More...
 
template<typename FIELD_OP , typename POLICY , typename LAMBDA >
static void applyBoundaryConditionToSystem (FieldSpecification const &fs, SortedArrayView< localIndex const > const &targetSet, real64 const time, real64 const dt, dataRepository::Group const &dataGroup, arrayView1d< globalIndex const > const &dofMap, globalIndex const dofRankOffset, CRSMatrixView< real64, globalIndex const > const &matrix, arrayView1d< real64 > const &rhs, LAMBDA &&lambda)
 Apply a boundary condition to a system of equations. More...
 
template<typename FIELD_OP , typename POLICY , typename LAMBDA >
static void computeRhsContribution (FieldSpecification const &fs, SortedArrayView< localIndex const > const &targetSet, real64 const time, real64 const dt, dataRepository::Group const &dataGroup, arrayView1d< globalIndex const > const &dofMap, globalIndex const dofRankOffset, CRSMatrixView< real64, globalIndex const > const &matrix, arrayView1d< globalIndex > const &dof, arrayView1d< real64 > const &rhsContribution, LAMBDA &&lambda)
 Compute the contributions that will be added/enforced to the right-hand side, and collect the corresponding dof numbers. More...
 
template<typename POLICY >
static void zeroSystemRowsForBoundaryCondition (FieldSpecification const &fs, SortedArrayView< localIndex const > const &targetSet, arrayView1d< globalIndex const > const &dofMap, CRSMatrixView< real64, globalIndex const > const &matrix)
 Function to zero matrix rows to apply boundary conditions. More...
 

Detailed Description

Methods to apply field specifications.

Definition at line 43 of file FieldSpecificationImpl.hpp.

Member Function Documentation

◆ apply() [1/2]

template<typename OBJECT_TYPE , typename BC_TYPE , typename LAMBDA >
void geos::FieldSpecificationImpl::apply ( BC_TYPE const &  fs,
MeshLevel mesh,
LAMBDA &&  lambda 
)
static

Apply this field specification to the discretization.

Template Parameters
OBJECT_TYPEThe type of discretization/mesh object that the specification is being applied to.
BC_TYPEThe type of BC being applied
LAMBDA
Parameters
fsThe field specification data object
meshThe MeshLevel that the specification is applied to
lambdaThe being executed

Definition at line 337 of file FieldSpecificationImpl.hpp.

◆ apply() [2/2]

template<typename OBJECT_TYPE , typename BC_TYPE , typename LAMBDA >
void geos::FieldSpecificationImpl::apply ( BC_TYPE const &  fs,
MeshLevel mesh,
LAMBDA &&  lambda,
real64 const &  time,
string const &  fieldName 
)
static

If applicable in the current time and field, apply this field specification to the discretization.

Template Parameters
OBJECT_TYPEThe type of discretization/mesh object that the specification is being applied to.
BC_TYPEThe type of BC being applied
LAMBDA
Parameters
fsThe field specification data object
meshThe MeshLevel that the specification is applied to
lambdaThe being executed
timeThe time at which the field will be evaluated. For instance if the field is a time dependent function, this is the evaluation time.
fieldNameThe name of the field/variable that the value will be applied to. It may not be necessary that this name is in the data repository, as the user supplied lambda may apply whatever it condition it would like. However, this name is used for comparing against the value given in the specification.

This function checks if the field should be applied, and applies it. More specifically, this function simply checks the values of fieldName against its FieldSpecification object and decides on whether or not to call the user defined lambda.

Definition at line 362 of file FieldSpecificationImpl.hpp.

◆ applyBoundaryConditionToSystem() [1/3]

template<typename FIELD_OP , typename POLICY , typename LAMBDA >
void geos::FieldSpecificationImpl::applyBoundaryConditionToSystem ( FieldSpecification const &  fs,
SortedArrayView< localIndex const > const &  targetSet,
real64 const  time,
dataRepository::Group const &  dataGroup,
arrayView1d< globalIndex const > const &  dofMap,
globalIndex const  dofRankOffset,
CRSMatrixView< real64, globalIndex const > const &  matrix,
arrayView1d< real64 > const &  rhs,
LAMBDA &&  lambda 
)
static

Apply a boundary condition to a system of equations.

Template Parameters
FIELD_OPA wrapper struct to define how the boundary condition operates on the variables. Either OpEqual or OpAdd.
POLICYExecution policy to use when iterating over target set.
LAMBDAThe type of lambda function passed into the parameter list.
Parameters
[in]fsThe field specification data object.
[in]targetSetThe set of indices which the boundary condition will be applied.
[in]timeThe time at which any time dependent functions are to be evaluated as part of the application of the boundary condition.
[in]dataGroupThe Group that contains the field to apply the boundary condition to.
[in]dofMapThe map from the local index of the primary field to the global degree of freedom number.
[in]dofRankOffsetOffset of dof indices on current rank.
[in,out]matrixLocal part of the system matrix.
[in,out]rhsLocal part of the system rhs vector.
[in]lambdaA lambda function which defines how the value that is passed into the functions provided by the FIELD_OP templated type.

This function applies the boundary condition to a linear system of equations. This function is typically called from within the lambda to a call to BoundaryConditionManager::ApplyBoundaryCondition().

Definition at line 542 of file FieldSpecificationImpl.hpp.

◆ applyBoundaryConditionToSystem() [2/3]

template<typename FIELD_OP , typename POLICY >
void geos::FieldSpecificationImpl::applyBoundaryConditionToSystem ( FieldSpecification const &  fs,
SortedArrayView< localIndex const > const &  targetSet,
real64 const  time,
dataRepository::Group const &  dataGroup,
string const &  fieldName,
string const &  dofMapName,
globalIndex const  dofRankOffset,
CRSMatrixView< real64, globalIndex const > const &  matrix,
arrayView1d< real64 > const &  rhs 
)
static

Apply a boundary condition to a system of equations.

Template Parameters
FIELD_OPA wrapper struct to define how the boundary condition operates on the variables. Either OpEqual or OpAdd.
POLICYExecution policy to use when iterating over target set.
Parameters
[in]fsThe field specification data object
[in]targetSetThe set of indices which the boundary condition will be applied.
[in]timeThe time at which any time dependent functions are to be evaluated as part of the application of the boundary condition.
[in]dataGroupThe Group that contains the field to apply the boundary condition to.
[in]fieldNameThe name of the field to apply the boundary condition to.
[in]dofMapNameThe name of the map from the local index of the primary field to the global degree of freedom number.
[in]dofRankOffsetOffset of dof indices on current rank.
[in,out]matrixLocal part of the system matrix.
[in,out]rhsLocal part of the system rhs vector.

This function applies the boundary condition to a linear system of equations. This function is typically called from within the lambda to a call to BoundaryConditionManager::ApplyBoundaryCondition().

Definition at line 508 of file FieldSpecificationImpl.hpp.

◆ applyBoundaryConditionToSystem() [3/3]

template<typename FIELD_OP , typename POLICY , typename LAMBDA >
void geos::FieldSpecificationImpl::applyBoundaryConditionToSystem ( FieldSpecification const &  fs,
SortedArrayView< localIndex const > const &  targetSet,
real64 const  time,
real64 const  dt,
dataRepository::Group const &  dataGroup,
arrayView1d< globalIndex const > const &  dofMap,
globalIndex const  dofRankOffset,
CRSMatrixView< real64, globalIndex const > const &  matrix,
arrayView1d< real64 > const &  rhs,
LAMBDA &&  lambda 
)
static

Apply a boundary condition to a system of equations.

Template Parameters
FIELD_OPA wrapper struct to define how the boundary condition operates on the variables. Either OpEqual or OpAdd.
POLICYExecution policy to use when iterating over target set.
LAMBDAThe type of lambda function passed into the parameter list.
Parameters
[in]fsThe field specification data object.
[in]targetSetThe set of indices which the boundary condition will be applied.
[in]timeThe time at which any time dependent functions are to be evaluated as part of the application of the boundary condition.
[in]dttime step size which is applied as a factor to bc values
[in]dataGroupThe Group that contains the field to apply the boundary condition to.
[in]dofMapThe map from the local index of the primary field to the global degree of freedom number.
[in]dofRankOffsetOffset of dof indices on current rank.
[in,out]matrixLocal part of the system matrix.
[in,out]rhsLocal part of the system rhs vector.
[in]lambdaA lambda function which defines how the value that is passed into the functions provided by the FIELD_OP templated type.

This function applies the boundary condition to a linear system of equations. This function is typically called from within the lambda to a call to BoundaryConditionManager::ApplyBoundaryCondition().

Definition at line 567 of file FieldSpecificationImpl.hpp.

◆ applyBoundaryConditionToSystemKernel()

template<typename FIELD_OP , typename POLICY , typename T , int NDIM, int USD>
void geos::FieldSpecificationImpl::applyBoundaryConditionToSystemKernel ( FieldSpecification const &  fs,
SortedArrayView< localIndex const > const &  targetSet,
real64 const  time,
dataRepository::Group const &  dataGroup,
arrayView1d< globalIndex const > const &  dofMap,
globalIndex const  dofRankOffset,
CRSMatrixView< real64, globalIndex const > const &  matrix,
arrayView1d< real64 > const &  rhs,
ArrayView< T const, NDIM, USD > const &  fieldView 
)
static

Apply a boundary condition to a system of equations.

Template Parameters
FIELD_OPA wrapper struct to define how the boundary condition operates on the variables. Either OpEqual or OpAdd.
POLICYExecution policy to use when iterating over the target set.
TData type of the field.
NDIMNumber of dimensions in the field array.
USDUnit stride dimension of the field array.
Parameters
fsThe field specification data object.
targetSetThe set of indices which the boundary condition will be applied.
timeThe time at which any time dependent functions are to be evaluated as part of the application of the boundary condition.
dataGroupThe Group that contains the field to apply the boundary condition to.
dofMapThe map from the local index of the primary field to the global degree of freedom number.
dofRankOffsetOffset of dof indices on current rank.
matrixLocal part of the system matrix.
rhsLocal part of the system rhs vector.
fieldViewArray view of the field data.
Note
This function is rarely used directly. More often it is called by other ApplyBoundaryCondition functions.

Definition at line 478 of file FieldSpecificationImpl.hpp.

◆ applyFieldValue()

template<typename FIELD_OP , typename POLICY >
void geos::FieldSpecificationImpl::applyFieldValue ( FieldSpecification const &  fs,
SortedArrayView< localIndex const > const &  targetSet,
real64 const  time,
dataRepository::Group dataGroup,
string const &  fieldName 
)
static
Template Parameters
FIELD_OPtype that contains static functions to apply the value to the field
Parameters
[in]fsthe field specification data object
[in]targetSetthe set of indices which the value will be applied.
[in]timeThe time at which any time dependent functions are to be evaluated as part of the application of the value.
[in]dataGroupthe Group that contains the field to apply the value to.
[in]fieldNamethe name of the field to apply the value to.

This function applies the value to a field variable. This function is typically called from within the lambda to a call to FieldSpecificationManager::applyFieldValue().

Definition at line 449 of file FieldSpecificationImpl.hpp.

◆ applyFieldValueKernel()

template<typename FIELD_OP , typename POLICY , typename T , int N, int USD>
void geos::FieldSpecificationImpl::applyFieldValueKernel ( FieldSpecification const &  fs,
ArrayView< T, N, USD > const &  field,
SortedArrayView< localIndex const > const &  targetSet,
real64 const  time,
dataRepository::Group dataGroup 
)
static
Template Parameters
FIELD_OPtype that contains static functions to apply the value to the field
Parameters
[in]fsthe field specification data object.
[in]fieldthe field to apply the value to.
[in]targetSetthe set of indices which the value will be applied.
[in]timeThe time at which any time dependent functions are to be evaluated as part of the application of the value.
[in]dataGroupthe Group that contains the field to apply the value to.

This function applies the value to a field variable.

Definition at line 380 of file FieldSpecificationImpl.hpp.

◆ computeRhsContribution()

template<typename FIELD_OP , typename POLICY , typename LAMBDA >
void geos::FieldSpecificationImpl::computeRhsContribution ( FieldSpecification const &  fs,
SortedArrayView< localIndex const > const &  targetSet,
real64 const  time,
real64 const  dt,
dataRepository::Group const &  dataGroup,
arrayView1d< globalIndex const > const &  dofMap,
globalIndex const  dofRankOffset,
CRSMatrixView< real64, globalIndex const > const &  matrix,
arrayView1d< globalIndex > const &  dof,
arrayView1d< real64 > const &  rhsContribution,
LAMBDA &&  lambda 
)
static

Compute the contributions that will be added/enforced to the right-hand side, and collect the corresponding dof numbers.

Template Parameters
FIELD_OPA wrapper struct to define how the boundary condition operates on the variables. Either OpEqual or OpAdd.
POLICYExecution policy to use when iterating over target set.
LAMBDAThe type of lambda function passed into the parameter list.
Parameters
[in]fsThe field specification data object.
[in]targetSetThe set of indices which the boundary condition will be applied.
[in]timeThe time at which any time dependent functions are to be evaluated as part of the application of the boundary condition.
[in]dttime step size which is applied as a factor to bc values
[in]dataGroupThe Group that contains the field to apply the boundary condition to.
[in]dofMapThe map from the local index of the primary field to the global degree of freedom number.
[in]dofRankOffsetOffset of dof indices on current rank.
[in,out]matrixLocal part of the system matrix.
[in,out]dofarray storing the degrees of freedom of the rhsContribution, to know where in the rhs they will be added/enforced
[in,out]rhsContributionarray storing the values that will be added/enforced to the right-hand side
[in]lambdaA lambda function which defines how the value that is passed into the functions provided by the FIELD_OP templated type.

Note that this function only computes the rhs contributions, but does not apply them to the right-hand side. The application of these rhs contributions is done in applyBoundaryConditionToSystem.

Why did we have to extract the computation of the rhs contributions from applyBoundaryConditionToSystem? Because applyBoundaryConditionToSystem is not very well suited to apply the rhsContributions to the equation layout used in the compositional solvers. Therefore, the compositional solvers do not call applyBoundaryConditionToSystem, but instead call computeRhsContribution directly, and apply these rhs contributions "manually" according to the equation layout used in the solver

Definition at line 602 of file FieldSpecificationImpl.hpp.

◆ zeroSystemRowsForBoundaryCondition()

template<typename POLICY >
void geos::FieldSpecificationImpl::zeroSystemRowsForBoundaryCondition ( FieldSpecification const &  fs,
SortedArrayView< localIndex const > const &  targetSet,
arrayView1d< globalIndex const > const &  dofMap,
CRSMatrixView< real64, globalIndex const > const &  matrix 
)
static

Function to zero matrix rows to apply boundary conditions.

Template Parameters
POLICYthe execution policy to use when zeroing rows
Parameters
[in]fsThe field specification data object
[in]targetSetThe set of indices which the boundary condition will be applied.
[in]dofMapThe map from the local index of the primary field to the global degree of freedom number.
[in,out]matrixthe local system matrix

This function zeroes the rows of the matrix that correspond to boundary conditions.

Definition at line 689 of file FieldSpecificationImpl.hpp.


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