GEOSX
Public Types | Static Public Member Functions | List of all members
geosx::FieldSpecificationEqual Struct Reference

#include <FieldSpecificationOps.hpp>

Inheritance diagram for geosx::FieldSpecificationEqual:
Inheritance graph
[legend]

Public Types

using base_type = FieldSpecificationOp< OpEqual >
 Alias for FieldSpecificationOp< OpEqual >
 
- Public Types inherited from geosx::FieldSpecificationOp< OpEqual >
using OpType = OpEqual
 Alias for OP, the operator.
 

Static Public Member Functions

template<typename LAI >
static void SpecifyFieldValue (globalIndex const dof, typename LAI::ParallelMatrix &matrix, real64 &rhs, real64 const bcValue, real64 const fieldValue)
 Function to apply a Dirichlet like boundary condition to a single dof in a system of equations. More...
 
static GEOSX_HOST_DEVICE void SpecifyFieldValue (globalIndex const dof, globalIndex const dofRankOffset, CRSMatrixView< real64, globalIndex const > const &matrix, real64 &rhs, real64 const bcValue, real64 const fieldValue)
 Function to apply a Dirichlet like boundary condition to a single dof in a system of equations. More...
 
template<typename LAI >
static void PrescribeRhsValues (typename LAI::ParallelVector &rhs, localIndex const num, globalIndex *const dof, real64 *const values)
 Function to add some values of a vector. More...
 
template<typename POLICY >
static void PrescribeRhsValues (arrayView1d< real64 > const &rhs, arrayView1d< globalIndex const > const &dof, globalIndex const dofRankOffset, arrayView1d< real64 const > const &values)
 Function to add some values of a vector. More...
 
- Static Public Member Functions inherited from geosx::FieldSpecificationOp< OpEqual >
static GEOSX_HOST_DEVICE std::enable_if< !traits::is_tensorT< T >, void >::type SpecifyFieldValue (arrayView1d< T > const &field, localIndex const index, integer const component, real64 const value)
 Pointwise application of a value to a field. More...
 
static GEOSX_HOST_DEVICE std::enable_if< traits::is_tensorT< T >, void >::type SpecifyFieldValue (arrayView1d< T > const &field, localIndex const index, integer const component, real64 const value)
 Pointwise application of value to a field variable. More...
 
static GEOSX_HOST_DEVICE std::enable_if< !traits::is_tensorT< T >, void >::type SpecifyFieldValue (arrayView2d< T, USD > const &field, localIndex const index, integer const component, real64 const value)
 Pointwise application of a value to a field variable. More...
 
static GEOSX_HOST_DEVICE std::enable_if< traits::is_tensorT< T >, void >::type SpecifyFieldValue (arrayView2d< T, USD > const &field, localIndex const index, integer const component, real64 const value)
 Pointwise application of a value to a field variable. More...
 
static GEOSX_HOST_DEVICE std::enable_if< !traits::is_tensorT< T >, void >::type SpecifyFieldValue (arrayView3d< T, USD > const &field, localIndex const index, integer const component, real64 const value)
 Pointwise application of a value to a field variable. More...
 
static GEOSX_HOST_DEVICE std::enable_if< traits::is_tensorT< T >, void >::type SpecifyFieldValue (arrayView3d< T, USD > const &field, localIndex const index, integer const component, real64 const value)
 Pointwise application of a value to a field variable. More...
 
static GEOSX_HOST_DEVICE std::enable_if< !traits::is_tensorT< T >, void >::type ReadFieldValue (arrayView1d< T const > const &field, localIndex const index, integer const component, real64 &value)
 Read a field value. More...
 
static GEOSX_HOST_DEVICE std::enable_if< traits::is_tensorT< T >, void >::type ReadFieldValue (arrayView1d< T const > const &field, localIndex const index, integer const component, real64 &value)
 Read a field value. More...
 
static GEOSX_HOST_DEVICE std::enable_if< !traits::is_tensorT< T >, void >::type ReadFieldValue (arrayView2d< T const, USD > const &field, localIndex const index, integer const component, real64 &value)
 Read value from a 2d field. More...
 
static GEOSX_HOST_DEVICE std::enable_if< traits::is_tensorT< T >, void >::type ReadFieldValue (arrayView2d< T const, USD > const &field, localIndex const index, integer const component, real64 &value)
 This function is not meaningful. It exists for generic purposes, but will result in an error if called. More...
 
static GEOSX_HOST_DEVICE void ReadFieldValue (arrayView3d< T const, USD > const &field, localIndex const index, integer const component, real64 &value)
 This function is not meaningful. It exists for generic purposes, but will result in an error if called. More...
 

Detailed Description

this struct a collection of static functions which adhere to an assumed interface for overwriting a value for a field.

Definition at line 405 of file FieldSpecificationOps.hpp.

Member Function Documentation

◆ PrescribeRhsValues() [1/2]

template<typename LAI >
static void geosx::FieldSpecificationEqual::PrescribeRhsValues ( typename LAI::ParallelVector &  rhs,
localIndex const  num,
globalIndex *const  dof,
real64 *const  values 
)
inlinestatic

Function to add some values of a vector.

Parameters
rhsA ParallelVector object.
numThe number of values in rhs to replace
dofA pointer to the global DOF to be replaced
valuesA pointer to the values corresponding to dof that will be added to rhs.

Definition at line 505 of file FieldSpecificationOps.hpp.

◆ PrescribeRhsValues() [2/2]

template<typename POLICY >
static void geosx::FieldSpecificationEqual::PrescribeRhsValues ( arrayView1d< real64 > const &  rhs,
arrayView1d< globalIndex const > const &  dof,
globalIndex const  dofRankOffset,
arrayView1d< real64 const > const &  values 
)
inlinestatic

Function to add some values of a vector.

Template Parameters
POLICYthe execution policy to use when setting values
Parameters
rhsthe target right-hand side vector
dofa list of global DOF indices to be set
dofRankOffsetoffset of dof indices on current rank
valuesa list of values corresponding to dof that will be added to rhs.

Definition at line 528 of file FieldSpecificationOps.hpp.

◆ SpecifyFieldValue() [1/2]

template<typename LAI >
static void geosx::FieldSpecificationEqual::SpecifyFieldValue ( globalIndex const  dof,
typename LAI::ParallelMatrix &  matrix,
real64 rhs,
real64 const  bcValue,
real64 const  fieldValue 
)
inlinestatic

Function to apply a Dirichlet like boundary condition to a single dof in a system of equations.

Parameters
[in]dofThe degree of freedom that is to be set.
[in,out]matrixA ParallelMatrix object: the system matrix.
[out]rhsThe rhs contribution resulting from the application of the BC.
[in]bcValueThe target value of the Boundary Condition
[in]fieldValueThe current value of the variable to be set.

This function clears the matrix row for the specified dof, sets the diagonal to some appropriately scaled value, and sets rhs to the negative product of the scaled value of the diagonal and the difference between bcValue and fieldValue.

Note
This function assumes the user is doing a Newton-type nonlinear solve and will negate the rhs vector upon assembly. Thus, it sets the value to negative of the desired update for the field. For a linear problem, this may lead to unexpected results.

Definition at line 429 of file FieldSpecificationOps.hpp.

◆ SpecifyFieldValue() [2/2]

static GEOSX_HOST_DEVICE void geosx::FieldSpecificationEqual::SpecifyFieldValue ( globalIndex const  dof,
globalIndex const  dofRankOffset,
CRSMatrixView< real64, globalIndex const > const &  matrix,
real64 rhs,
real64 const  bcValue,
real64 const  fieldValue 
)
inlinestatic

Function to apply a Dirichlet like boundary condition to a single dof in a system of equations.

Parameters
[in]dofThe degree of freedom that is to be set.
[in]dofRankOffsetoffset of dof indices on current rank
[in,out]matrixthe local part of the system matrix
[out]rhsThe rhs contribution resulting from the application of the BC.
[in]bcValueThe target value of the Boundary Condition
[in]fieldValueThe current value of the variable to be set.

This function clears the matrix row for the specified dof, sets the diagonal to some appropriately scaled value, and sets rhs to the negative product of the scaled value of the diagonal and the difference between bcValue and fieldValue.

Note
This function assumes the user is doing a Newton-type nonlinear solve and will negate the rhs vector upon assembly. Thus, it sets the value to negative of the desired update for the field. For a linear problem, this may lead to unexpected results.

Definition at line 466 of file FieldSpecificationOps.hpp.


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