21 #ifndef GEOS_PHYSICSSOLVERS_MULTIPHYSICS_PHASEFIELDFRACTURESOLVER_HPP_
22 #define GEOS_PHYSICSSOLVERS_MULTIPHYSICS_PHASEFIELDFRACTURESOLVER_HPP_
48 Group *
const parent );
59 return "PhaseFieldFracture";
83 return std::get< toUnderlying( SolverType::SolidMechanics ) >(
m_solvers );
92 return std::get< toUnderlying( SolverType::Damage ) >(
m_solvers );
112 template<
typename FE_TYPE >
116 m_numElems( subRegion.
size() )
127 constexpr
localIndex numNodesPerElement = FE_TYPE::numNodes;
128 constexpr
localIndex n_q_points = FE_TYPE::numQuadraturePoints;
130 real64 xLocal[ numNodesPerElement ][ 3 ];
131 real64 nodalDamageLocal[ numNodesPerElement ];
133 for(
localIndex a = 0; a < numNodesPerElement; ++a )
135 localIndex const localNodeIndex = elemToNodes( k, a );
137 for(
int dim=0; dim < 3; ++dim )
139 xLocal[a][dim] = xNodes[ localNodeIndex ][dim];
142 nodalDamageLocal[ a ] = nodalDamage[ localNodeIndex ];
147 real64 N[ numNodesPerElement ];
148 FE_TYPE::calcN( q, N );
150 real64 dNdX[ numNodesPerElement ][ 3 ];
151 real64 const detJ = FE_TYPE::calcGradN( q, xLocal, dNdX );
156 real64 qDamageGrad[3] = {0, 0, 0};
157 finiteElement::feOps::valueAndGradient( N, dNdX, nodalDamageLocal, qDamage, qDamageGrad );
159 damageFieldOnMaterial( k, q ) = qDamage;
161 for(
int dim=0; dim < 3; ++dim )
163 damageGradOnMaterial[k][q][dim] = qDamageGrad[dim];
#define GEOS_HOST_DEVICE
Marks a host-device function.
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
std::tuple< SOLVERS *... > m_solvers
Pointers of the single-physics solvers.
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
SolidMechanicsLagrangianFEM * solidMechanicsSolver() const
accessor for the pointer to the solid mechanics solver
static string coupledSolverAttributePrefix()
String used to form the solverName used to register solvers in CoupledSolver.
virtual void postInputInitialization() override final
PhaseFieldDamageFEM * damageSolver() const
accessor for the pointer to the damage solver
PhaseFieldFractureSolver(const string &name, Group *const parent)
main constructor for PhaseFieldFractureSolver objects
virtual void initializePostInitialConditionsPreSubGroups() override final
Called by InitializePostInitialConditions() prior to initializing sub-Groups.
string getCatalogName() const override
~PhaseFieldFractureSolver() override=default
Destructor for the class.
static string catalogName()
name of the solver in the object catalog
virtual void mapSolutionBetweenSolvers(DomainPartition &domain, integer const solverType) override final
Maps the solution obtained from one solver to the fields used by the other solver(s)
CRSMatrix< real64, globalIndex > m_localMatrix
Local system matrix and rhs.
DofManager m_dofManager
Data structure to handle degrees of freedom.
ParallelVector m_solution
System solution vector.
ParallelVector m_rhs
System right-hand side vector.
localIndex size() const
Get the "size" of the group, which determines the number of elements in resizable wrappers.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
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.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.