22 #ifndef GEOS_FINITEELEMENT_SPARSITYKERNELBASE_HPP_
23 #define GEOS_FINITEELEMENT_SPARSITYKERNELBASE_HPP_
44 template<
typename SUBREGION_TYPE,
45 typename CONSTITUTIVE_TYPE,
47 int NUM_DOF_PER_TEST_SP,
48 int NUM_DOF_PER_TRIAL_SP >
53 NUM_DOF_PER_TRIAL_SP >
61 NUM_DOF_PER_TRIAL_SP >;
86 SUBREGION_TYPE
const & elementSubRegion,
87 FE_TYPE
const & finiteElementSpace,
88 CONSTITUTIVE_TYPE & inputConstitutiveType,
99 inputConstitutiveType,
105 m_sparsity( inputSparsity )
124 if( row < 0 || row >= m_sparsity.numRows() )
continue;
127 m_sparsity.insertNonZero( row,
148 template<
typename POLICY,
149 typename KERNEL_TYPE >
153 KERNEL_TYPE
const & kernelComponent )
158 forAll< POLICY >( numElems,
162 typename KERNEL_TYPE::StackVariables stack;
164 kernelComponent.setup( k, stack );
166 kernelComponent.complete( k, stack );
185 template<
template<
typename,
187 typename >
class KERNEL_TEMPLATE >
201 m_inputDofNumber( inputDofNumber ),
202 m_rankOffset( rankOffset ),
203 m_inputSparsityPattern( inputSparsityPattern )
220 template<
typename SUBREGION_TYPE,
typename CONSTITUTIVE_TYPE,
typename FE_TYPE >
225 SUBREGION_TYPE
const & elementSubRegion,
226 FE_TYPE
const & finiteElementSpace,
227 CONSTITUTIVE_TYPE & inputConstitutiveType )
229 using Kernel = KERNEL_TEMPLATE< SUBREGION_TYPE, CONSTITUTIVE_TYPE, FE_TYPE >;
234 Kernel::numDofPerTestSupportPoint,
235 Kernel::numDofPerTrialSupportPoint >( nodeManager,
241 inputConstitutiveType,
245 m_inputSparsityPattern );
281 template<
typename REGION_TYPE,
282 template<
typename SUBREGION_TYPE,
283 typename CONSTITUTIVE_TYPE,
284 typename FE_TYPE >
class KERNEL_TEMPLATE >
288 string const & discretizationName,
297 regionBasedKernelApplication< serialPolicy,
298 constitutive::NullModel,
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
static real64 fillSparsity(MeshLevel &mesh, arrayView1d< string const > const &targetRegions, string const &discretizationName, arrayView1d< globalIndex const > const &inputDofNumber, globalIndex const rankOffset, SparsityPattern< globalIndex > &inputSparsityPattern)
Fills matrix sparsity.
#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 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.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Define the base interface for implicit finite element kernels.
globalIndex const m_dofRankOffset
The global rank offset.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Performs the setup phase for the kernel.
real64 const m_dt
time increment
Define the base interface for finite element kernels.
Used to forward arguments to a class that implements the KernelBase interface.
Define the base interface for implicit finite element kernels.
SparsityKernelBase(NodeManager const &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, localIndex const targetRegionIndex, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace, CONSTITUTIVE_TYPE &inputConstitutiveType, arrayView1d< globalIndex const > const &inputDofNumber, globalIndex const rankOffset, real64 const inputDt, SparsityPattern< globalIndex > &inputSparsity)
Constructor.
real64 complete(localIndex const k, StackVariables &stack) const
Performs the complete phase for the kernel.
static real64 kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
Kernel Launcher.
Helper struct to define a specialization of #geos::finiteElement::SparsityKernelBase that may be used...
SparsityKernelFactory(arrayView1d< globalIndex const > const &inputDofNumber, globalIndex const rankOffset, SparsityPattern< globalIndex > &inputSparsityPattern)
Constructor.
auto createKernel(NodeManager const &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, localIndex const targetRegionIndex, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace, CONSTITUTIVE_TYPE &inputConstitutiveType)
Return a new instance of SparsityKernelBase specialized for KERNEL_TEMPLATE.
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).
std::string string
String type.
LvArray::SparsityPattern< COL_INDEX, INDEX_TYPE, LvArray::ChaiBuffer > SparsityPattern
Alias for Sparsity pattern class.
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.
localIndex numCols
The actual number of columns in the element local jacobian matrix (<= maxNumCols).
globalIndex localRowDofIndex[maxNumRows]
C-array storage for the element local row degrees of freedom.
globalIndex localColDofIndex[maxNumCols]
C-array storage for the element local column degrees of freedom.
localIndex numRows
The actual number of rows in the element local jacobian matrix (<= maxNumRows).
Kernel variables allocated on the stack.