GEOS
PhaseFieldDamageFEM.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_PHYSICSSOLVERS_SIMPLEPDE_PHASEFIELDDAMAGE_HPP_
21 #define GEOS_PHYSICSSOLVERS_SIMPLEPDE_PHASEFIELDDAMAGE_HPP_
22 
26 
27 namespace geos
28 {
29 namespace dataRepository
30 {
31 class Group;
32 }
33 class DomainPartition;
34 
36 {
37 public:
38  PhaseFieldDamageFEM( const string & name, Group * const parent );
39 
40  virtual ~PhaseFieldDamageFEM() override;
41 
42  static string catalogName()
43  {
44  return "PhaseFieldDamageFEM";
45  }
49  string getCatalogName() const override { return catalogName(); }
50 
51  static string coupledSolverAttributePrefix() { return "damage"; }
52 
53  virtual void registerDataOnMesh( Group & meshBodies ) override final;
54 
63  virtual real64 solverStep( real64 const & time_n,
64  real64 const & dt,
65  integer const cycleNumber,
66  DomainPartition & domain ) override;
67 
68  virtual real64 explicitStep( real64 const & time_n,
69  real64 const & dt,
70  integer const cycleNumber,
71  DomainPartition & domain ) override;
72 
73  virtual void setupDofs( DomainPartition const & domain,
74  DofManager & dofManager ) const override;
75 
76  virtual void assembleSystem( real64 const time, real64 const dt,
77  DomainPartition & domain,
78  DofManager const & dofManager,
80  arrayView1d< real64 > const & localRhs ) override;
81 
82  virtual void applyBoundaryConditions( real64 const time, real64 const dt,
83  DomainPartition & domain,
84  DofManager const & dofManager,
86  arrayView1d< real64 > const & localRhs ) override;
87 
88  virtual real64 calculateResidualNorm( real64 const & time_n,
89  real64 const & dt,
90  DomainPartition const & domain,
91  DofManager const & dofManager,
92  arrayView1d< real64 const > const & localRhs ) override;
93 
94  virtual void applySystemSolution( DofManager const & dofManager,
95  arrayView1d< real64 const > const & localSolution,
96  real64 const scalingFactor,
97  real64 const dt,
98  DomainPartition & domain ) override;
99 
100  virtual void updateState( DomainPartition & domain ) override final;
101 
102  virtual void
104  real64 const &,
105  DomainPartition & ) override {}
106 
107  virtual void implicitStepComplete( real64 const & time,
108  real64 const & dt,
109  DomainPartition & domain ) override;
110 
111  virtual void
113 
116  void applyDirichletBCImplicit( real64 const time,
117  DofManager const & dofManager,
118  DomainPartition & domain,
119  CRSMatrixView< real64, globalIndex const > const & localMatrix,
120  arrayView1d< real64 > const & localRhs );
121 
122  void applyIrreversibilityConstraint( DofManager const & dofManager,
123  DomainPartition & domain,
124  CRSMatrixView< real64, globalIndex const > const & localMatrix,
125  arrayView1d< real64 > const & localRhs );
126 
127  virtual void saveSequentialIterationState( DomainPartition & domain ) override;
128 
130  {
131  SteadyState,
132  ImplicitTransient,
134  };
135 
137  {
138  static constexpr char const * irreversibilityFlagString() { return "irreversibilityFlag"; }
139  static constexpr char const * damageUpperBoundString() { return "damageUpperBound"; }
140  static constexpr char const * viscousRegularizationCoeffString() { return "viscousRegularizationCoeff"; }
141  static constexpr char const * fracturePressureTermFlagString() { return "fracturePressureTermFlag"; }
142  static constexpr char const * solidModelNamesString() { return "solidMaterialNames"; }
143 
144  dataRepository::ViewKey timeIntegrationOption = { "timeIntegrationOption" };
145  } PhaseFieldDamageFEMViewKeys;
146 
147 protected:
148 
149  virtual void setConstitutiveNamesCallSuper( ElementSubRegionBase & subRegion ) const override;
150 
151 private:
152  TimeIntegrationOption m_timeIntegrationOption;
153  integer m_irreversibilityFlag;
154  real64 m_damageUpperBound;
155  integer m_fracturePressureTermFlag;
156 
158  real64 m_viscousRegularizationCoeff;
159 };
160 
163  "SteadyState",
164  "ImplicitTransient",
165  "ExplicitTransient" );
166 
167 } /* namespace geos */
168 
169 #endif /* GEOS_PHYSICSSOLVERS_SIMPLEPDE_PHASEFIELDDAMAGE_HPP_ */
The DoFManager is responsible for allocating global dofs, constructing sparsity patterns,...
Definition: DofManager.hpp:45
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
string getCatalogName() const override
virtual void setConstitutiveNamesCallSuper(ElementSubRegionBase &subRegion) const override
This function sets constitutive name fields on an ElementSubRegionBase, and calls the base function i...
virtual void registerDataOnMesh(Group &meshBodies) override final
Register wrappers that contain data on the mesh objects.
virtual void saveSequentialIterationState(DomainPartition &domain) override
Save the state of the solver for sequential iteration.
Base class for all physics solvers.
virtual void resetStateToBeginningOfStep(DomainPartition &) override
reset state of physics back to the beginning of the step.
virtual void updateState(DomainPartition &domain) override final
Recompute all dependent quantities from primary variables (including constitutive models)
virtual void applyBoundaryConditions(real64 const time, real64 const dt, DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
apply boundary condition to system
virtual void applySystemSolution(DofManager const &dofManager, arrayView1d< real64 const > const &localSolution, real64 const scalingFactor, real64 const dt, DomainPartition &domain) override
Function to apply the solution vector to the state.
virtual real64 solverStep(real64 const &time_n, real64 const &dt, integer const cycleNumber, DomainPartition &domain) override
entry function to perform a solver step
virtual void setupDofs(DomainPartition const &domain, DofManager &dofManager) const override
Populate degree-of-freedom manager with fields relevant to this solver.
virtual void assembleSystem(real64 const time, real64 const dt, DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
function to assemble the linear system matrix and rhs
virtual void implicitStepComplete(real64 const &time, real64 const &dt, DomainPartition &domain) override
perform cleanup for implicit timestep
virtual real64 explicitStep(real64 const &time_n, real64 const &dt, integer const cycleNumber, DomainPartition &domain) override
Entry function for an explicit time integration step.
virtual real64 calculateResidualNorm(real64 const &time_n, real64 const &dt, DomainPartition const &domain, DofManager const &dofManager, arrayView1d< real64 const > const &localRhs) override
calculate the norm of the global system residual
virtual void implicitStepSetup(real64 const &, real64 const &, DomainPartition &) override
function to perform setup for implicit timestep
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
Definition: Group.hpp:1666
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:179
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
LvArray::CRSMatrixView< T, COL_INDEX, INDEX_TYPE const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
Definition: DataTypes.hpp:309
int integer
Signed integer type.
Definition: DataTypes.hpp:81
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "richardson", "preconditioner")
Declare strings associated with enumeration values.
Structure to hold scoped key names.