22 #include "constitutive/solid/CoupledSolidBase.hpp"
23 #include "constitutive/solid/SolidBase.hpp"
25 #include "constitutive/ConstitutiveManager.hpp"
32 namespace surfaceGenerationKernels
41 constitutive::ConstitutiveManager
const & constitutiveManager,
42 string const solidMaterialKey ):
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 localIndex const numQuadraturePoints = m_detJ[er][esr].size( 1 );
73 for(
localIndex q = 0; q < numQuadraturePoints; ++q )
75 real64 const quadratureStress[6] = LVARRAY_TENSOROPS_INIT_LOCAL_6 ( m_stress[er][esr][m_solidMaterialFullIndex[er]][ei][q] );
76 real64 const dNdX[3] = LVARRAY_TENSOROPS_INIT_LOCAL_3 ( m_dNdX[er][esr][ei][q][targetNode] );
77 surfaceGenerationKernelsHelpers::computeNodalForce( quadratureStress, dNdX, m_detJ[er][esr][ei][q], force );
81 surfaceGenerationKernelsHelpers::scaleNodalForce( m_bulkModulus[er][esr][m_solidMaterialFullIndex[er]][ei], m_shearModulus[er][esr][m_solidMaterialFullIndex[er]][ei], force );
105 constitutive::ConstitutiveManager
const & constitutiveManager,
106 string const solidMaterialKey,
107 string const porosityModelKey ):
112 m_porosityMaterialFullIndex.resize( elemManager.
numRegions() );
116 string const & porosityModelName = region.getSubRegion( 0 ).getReference<
string >( porosityModelKey );
117 constitutive::ConstitutiveBase
const & porosityModel = constitutiveManager.getConstitutiveRelation< constitutive::ConstitutiveBase >( porosityModelName );
118 m_porosityMaterialFullIndex[regionIndex] = porosityModel.getIndexInParent();
128 real64 ( & force )[ 3 ] )
const override
133 localIndex const numQuadraturePoints = m_detJ[er][esr].size( 1 );
136 for(
localIndex q = 0; q < numQuadraturePoints; ++q )
138 real64 totalStress[6] = LVARRAY_TENSOROPS_INIT_LOCAL_6 ( m_stress[er][esr][m_solidMaterialFullIndex[er]][ei][q] );
139 real64 const dNdX[3] = LVARRAY_TENSOROPS_INIT_LOCAL_3 ( m_dNdX[er][esr][ei][q][targetNode] );
141 LvArray::tensorOps::symAddIdentity< 3 >( totalStress, -m_biotCoefficient[er][esr][m_porosityMaterialFullIndex[er]][ei] * m_pressure[er][esr][ei] );
143 surfaceGenerationKernelsHelpers::computeNodalForce( totalStress, dNdX, m_detJ[er][esr][ei][q], force );
147 surfaceGenerationKernelsHelpers::scaleNodalForce( m_bulkModulus[er][esr][m_solidMaterialFullIndex[er]][ei], m_shearModulus[er][esr][m_solidMaterialFullIndex[er]][ei], force );
160 template<
typename LAMBDA >
162 constitutive::ConstitutiveManager
const & constitutiveManager,
163 string const solidMaterialKey,
167 if( isPoroelastic == 0 )
169 lambda( NodalForceKernel( elemManager, constitutiveManager, solidMaterialKey ) );
173 string const porosityModelKey = constitutive::CoupledSolidBase::viewKeyStruct::porosityModelNameString();
174 lambda( PoroElasticNodalForceKernel( elemManager, constitutiveManager, solidMaterialKey, porosityModelKey ) );
#define GEOS_MARK_FUNCTION
Mark function with both Caliper and NVTX if enabled.
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.
ElementViewAccessor< LHS > constructViewAccessor(string const &name, string const &neighborName=string()) const
This is a const function to construct a ElementViewAccessor to access the data registered on the mesh...
void calculateSingleNodalForce(localIndex const er, localIndex const esr, localIndex const ei, localIndex const targetNode, real64(&force)[3]) const override
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
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).
std::int32_t integer
Signed integer type.
Array< T, 4, PERMUTATION > array4d
Alias for 4D array.
ArrayView< T, 4, USD > arrayView4d
Alias for 4D array view.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Array< T, 1 > array1d
Alias for 1D array.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.