20 #ifndef GEOS_FINITEELEMENT_INTERFACEKERNELBASE_HPP_
21 #define GEOS_FINITEELEMENT_INTERFACEKERNELBASE_HPP_
29 #ifndef SELECTED_FE_TYPES_2D
30 #define SELECTED_FE_TYPES_2D BASE_FE_TYPES_2D
54 template<
typename CONSTITUTIVE_TYPE,
56 int NUM_DOF_PER_TEST_SP,
57 int NUM_DOF_PER_TRIAL_SP >
62 NUM_DOF_PER_TRIAL_SP >
71 NUM_DOF_PER_TRIAL_SP >;
86 FE_TYPE
const & finiteElementSpace,
87 CONSTITUTIVE_TYPE & inputConstitutiveType,
99 inputConstitutiveType,
122 template<
template<
typename CONSTITUTIVE_TYPE,
123 typename FE_TYPE >
class KERNEL_TYPE,
150 template<
typename CONSTITUTIVE_TYPE,
typename FE_TYPE >
157 FE_TYPE
const & finiteElementSpace,
158 CONSTITUTIVE_TYPE & inputConstitutiveType )
166 CONSTITUTIVE_TYPE & > standardArgs { nodeManager,
172 inputConstitutiveType };
174 auto allArgs = camp::tuple_cat_pair( standardArgs, m_args );
175 return camp::make_from_tuple< KERNEL_TYPE< CONSTITUTIVE_TYPE, FE_TYPE > >( allArgs );
181 camp::tuple< ARGS ... > m_args;
207 template<
typename POLICY,
208 typename CONSTITUTIVE_BASE,
209 typename KERNEL_FACTORY >
212 string const & targetRegionName,
215 string const & constitutiveStringName,
216 KERNEL_FACTORY & interfaceKernelFactory )
222 real64 maxResidualContribution = 0;
234 constitutive::ConstitutiveBase * constitutiveRelation =
nullptr;
235 constitutive::NullModel * nullConstitutiveModel =
nullptr;
236 if( subRegion.template hasWrapper< string >( constitutiveStringName ) )
238 string const & constitutiveName = subRegion.template getReference< string >( constitutiveStringName );
239 constitutiveRelation = &subRegion.template getConstitutiveModel( constitutiveName );
243 nullConstitutiveModel = &subRegion.template registerGroup< constitutive::NullModel >(
"nullModelGroup" );
244 constitutiveRelation = nullConstitutiveModel;
247 localIndex const numElems = faceElementList.size();
250 constitutive::ConstitutivePassThru< CONSTITUTIVE_BASE >::execute( *constitutiveRelation,
251 [&maxResidualContribution,
256 &interfaceKernelFactory,
260 (
auto & castedConstitutiveRelation )
263 finiteElement::FiniteElementDispatchHandler< SELECTED_FE_TYPES_2D >::dispatch2D( subRegionFE,
264 [&maxResidualContribution,
269 &interfaceKernelFactory,
275 auto kernel = interfaceKernelFactory.createKernel( nodeManager,
281 castedConstitutiveRelation );
283 using KERNEL_TYPE = decltype( kernel );
286 maxResidualContribution =
287 std::max( maxResidualContribution,
288 KERNEL_TYPE::template kernelLaunch< POLICY, KERNEL_TYPE >( numElems, kernel ) );
294 if( nullConstitutiveModel )
296 subRegion.deregisterGroup(
"nullModelGroup" );
299 return maxResidualContribution;
static real64 interfaceBasedKernelApplication(MeshLevel &mesh, string const &targetRegionName, arrayView1d< localIndex const > const &faceElementList, FiniteElementBase const &subRegionFE, string const &constitutiveStringName, KERNEL_FACTORY &interfaceKernelFactory)
Performs a loop over FaceElementSubRegion and calls a kernel launch with compile time knowledge of su...
#define GEOS_MARK_FUNCTION
Mark function with both Caliper and NVTX if enabled.
This class provides an interface to ObjectManagerBase in order to manage edge data.
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
T const & getRegion(KEY_TYPE const &key) const
Get a element region.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Class facilitating the representation of a multi-level discretization of a MeshBody.
NodeManager const & getNodeManager() const
Get the node manager.
FaceManager const & getFaceManager() const
Get the face manager.
ElementRegionManager const & getElemManager() const
Get the element region manager.
EdgeManager const & getEdgeManager() const
Get the edge manager.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
SUBREGION_TYPE & getUniqueSubRegion()
Returns the unique sub-region of type SUBREGION_TYPE for the current SurfaceElementRegion.
Base class for FEM element implementations.
Define the base interface for implicit finite element kernels.
globalIndex const m_dofRankOffset
The global rank offset.
CRSMatrixView< real64, globalIndex const > const m_matrix
The global Jacobian matrix.
arrayView1d< globalIndex const > const m_dofNumber
The global degree of freedom number.
Define the base class for interface finite element kernels. (2D finite elements belong to FaceElement...
InterfaceKernelBase(NodeManager const &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, localIndex const targetRegionIndex, FaceElementSubRegion &elementSubRegion, FE_TYPE const &finiteElementSpace, CONSTITUTIVE_TYPE &inputConstitutiveType, arrayView1d< globalIndex const > const inputDofNumber, globalIndex const rankOffset, CRSMatrixView< real64, globalIndex const > const inputMatrix, arrayView1d< real64 > const inputRhs, real64 const inputDt)
Constructor.
Used to forward arguments to a class that implements the InterfaceKernelBase interface.
KERNEL_TYPE< CONSTITUTIVE_TYPE, FE_TYPE > createKernel(NodeManager &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, localIndex const targetRegionIndex, FaceElementSubRegion &elementSubRegion, FE_TYPE const &finiteElementSpace, CONSTITUTIVE_TYPE &inputConstitutiveType)
Create a new kernel with the given standard arguments.
InterfaceKernelFactory(ARGS ... args)
Initialize the factory.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Kernel variables allocated on the stack.