22 #include "constitutive/solid/CoupledSolidBase.hpp"
23 #include "constitutive/solid/SolidBase.hpp"
24 #include "constitutive/solid/SolidFields.hpp"
26 #include "constitutive/ConstitutiveManager.hpp"
33 namespace surfaceGenerationKernels
42 constitutive::ConstitutiveManager
const & constitutiveManager,
43 string const solidMaterialKey ):
44 m_elementRegionManager( elemManager ),
49 constitutiveManager ) )
51 m_solidMaterialFullIndex.resize( elemManager.
numRegions() );
55 string const & solidMaterialName = region.getSubRegion( 0 ).getReference<
string >( solidMaterialKey );
56 constitutive::ConstitutiveBase
const & solid = constitutiveManager.getConstitutiveRelation< constitutive::ConstitutiveBase >( solidMaterialName );
57 m_solidMaterialFullIndex[regionIndex] = solid.getIndexInParent();
62 calculateSingleNodalForce(
localIndex const er,
66 real64 ( & force )[ 3 ] )
const
70 NodeManager const & nodeManager = m_elementRegionManager.
getParent().template getGroup< NodeManager >( MeshLevel::groupStructKeys::nodeManagerString() );
84 finiteElement::FiniteElementDispatchHandler< ALL_FE_TYPES >::dispatch3D( *
finiteElement, [ & ](
auto const & fe )
86 using FE_TYPE = TYPEOFREF( fe );
87 typename FE_TYPE::StackVariables feStack;
88 constexpr
localIndex numQuadraturePoints = FE_TYPE::numQuadraturePoints;
89 constexpr
localIndex numNodesPerElement = FE_TYPE::numNodes;
90 real64 xLocal[numNodesPerElement][3] = { { 0 } };
93 for(
localIndex a = 0; a < numSupportPoints; ++a )
95 LvArray::tensorOps::copy< 3 >( xLocal[a], X[toNodesRelation( ei, a )] );
98 for(
localIndex q = 0; q < numQuadraturePoints; ++q )
100 real64 const quadratureStress[6] = LVARRAY_TENSOROPS_INIT_LOCAL_6 ( m_stress[er][esr][m_solidMaterialFullIndex[er]][ei][q] );
101 real64 dNdX[numNodesPerElement][3] = {{0}};
103 real64 const detJxW = FE_TYPE::calcJacobian( q, xLocal, feStack, J );
104 FE_TYPE::calcGradN( q, xLocal, feStack, dNdX );
105 surfaceGenerationKernelsHelpers::computeNodalForce( quadratureStress, dNdX[targetNode], detJxW, force );
110 surfaceGenerationKernelsHelpers::scaleNodalForce( m_bulkModulus[er][esr][m_solidMaterialFullIndex[er]][ei], m_shearModulus[er][esr][m_solidMaterialFullIndex[er]][ei], force );
132 constitutive::ConstitutiveManager
const & constitutiveManager,
133 string const solidMaterialKey,
134 string const porosityModelKey ):
139 m_porosityMaterialFullIndex.resize( elemManager.
numRegions() );
143 string const & porosityModelName = region.getSubRegion( 0 ).getReference<
string >( porosityModelKey );
144 constitutive::ConstitutiveBase
const & porosityModel = constitutiveManager.getConstitutiveRelation< constitutive::ConstitutiveBase >( porosityModelName );
145 m_porosityMaterialFullIndex[regionIndex] = porosityModel.getIndexInParent();
155 real64 ( & force )[ 3 ] )
const override
160 NodeManager const & nodeManager = m_elementRegionManager.
getParent().template getGroup< NodeManager >( MeshLevel::groupStructKeys::nodeManagerString() );
174 finiteElement::FiniteElementDispatchHandler< ALL_FE_TYPES >::dispatch3D( *
finiteElement, [ & ](
auto const & fe )
176 using FE_TYPE = TYPEOFREF( fe );
177 typename FE_TYPE::StackVariables feStack;
178 constexpr
localIndex numQuadraturePoints = FE_TYPE::numQuadraturePoints;
179 constexpr
localIndex numNodesPerElement = FE_TYPE::numNodes;
180 real64 xLocal[numNodesPerElement][3] = {{0}};
183 for(
localIndex a = 0; a < numSupportPoints; ++a )
185 LvArray::tensorOps::copy< 3 >( xLocal[a], X[toNodesRelation( ei, a )] );
188 for(
localIndex q = 0; q < numQuadraturePoints; ++q )
190 real64 totalStress[6] = LVARRAY_TENSOROPS_INIT_LOCAL_6 ( m_stress[er][esr][m_solidMaterialFullIndex[er]][ei][q] );
192 LvArray::tensorOps::symAddIdentity< 3 >( totalStress, -m_biotCoefficient[er][esr][m_porosityMaterialFullIndex[er]][ei] * m_pressure[er][esr][ei] );
194 real64 dNdX[numNodesPerElement][3] = {{0}};
196 real64 const detJxW = FE_TYPE::calcJacobian( q, xLocal, feStack, J );
197 FE_TYPE::calcGradN( q, xLocal, feStack, dNdX );
198 surfaceGenerationKernelsHelpers::computeNodalForce( totalStress, dNdX[targetNode], detJxW, force );
203 surfaceGenerationKernelsHelpers::scaleNodalForce( m_bulkModulus[er][esr][m_solidMaterialFullIndex[er]][ei], m_shearModulus[er][esr][m_solidMaterialFullIndex[er]][ei], force );
216 template<
typename LAMBDA >
218 constitutive::ConstitutiveManager
const & constitutiveManager,
219 string const solidMaterialKey,
223 if( isPoroelastic == 0 )
225 lambda( NodalForceKernel( elemManager, constitutiveManager, solidMaterialKey ) );
229 string const porosityModelKey = constitutive::CoupledSolidBase::viewKeyStruct::porosityModelNameString();
230 lambda( PoroElasticNodalForceKernel( elemManager, constitutiveManager, solidMaterialKey, porosityModelKey ) );
#define GEOS_MARK_FUNCTION
Mark function with both Caliper and NVTX if enabled.
SUBREGIONTYPE const & getSubRegion(KEY_TYPE const &key) const
Get a reference to a subregion.
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
MaterialViewAccessor< LHS > constructFullMaterialViewAccessor(string const &viewName, constitutive::ConstitutiveManager const &cm) const
This is a const function to construct a MaterialViewAccessor to access the material data.
localIndex numRegions() const
Get number of the regions.
void forElementRegionsComplete(LAMBDA lambda) const
This const function is used to launch kernel function over all the types of element regions.
ElementViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > > constructArrayViewAccessor(string const &name, string const &neighborName=string()) const
This is a function to construct a ElementViewAccessor to access array data registered on the mesh.
array1d< array1d< array1d< VIEWTYPE > > > MaterialViewAccessor
The MaterialViewAccessor at the ElementRegionManager level is a 3D array of VIEWTYPE.
array1d< array1d< VIEWTYPE > > ElementViewAccessor
The ElementViewAccessor at the ElementRegionManager level is an array of array of VIEWTYPE.
T const & getRegion(KEY_TYPE const &key) const
Get a element region.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Group & getParent()
Access the group's parent.
Base class for FEM element implementations.
void calculateSingleNodalForce(localIndex const er, localIndex const esr, localIndex const ei, localIndex const targetNode, real64(&force)[3]) const override
array2d< real64, nodes::REFERENCE_POSITION_PERM > & referencePosition()
Get the mutable reference position array. This table will contain all the node coordinates.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Array< T, 3, PERMUTATION > array3d
Alias for 3D array.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
int integer
Signed integer type.
Array< T, 1 > array1d
Alias for 1D array.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.