OGS
ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition Class Referencefinal

Detailed Description

#include <PhaseFieldIrreversibleDamageOracleBoundaryCondition.h>

Inheritance diagram for ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition:
[legend]
Collaboration diagram for ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition:
[legend]

Public Member Functions

 PhaseFieldIrreversibleDamageOracleBoundaryCondition (NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, int const variable_id, int const component_id)
void getEssentialBCValues (const double t, const GlobalVector &x, NumLib::IndexValueVector< GlobalIndexType > &bc_values) const override
 Writes the values of essential BCs to bc_values.
void preTimestep (const double t, std::vector< GlobalVector * > const &x, int const process_id) override
Public Member Functions inherited from ProcessLib::BoundaryCondition
virtual void applyNaturalBC (const double, std::vector< GlobalVector * > const &, int const, GlobalMatrix *, GlobalVector &, GlobalMatrix *)
virtual void postTimestep (const double, std::vector< GlobalVector * > const &, int const)
virtual ~BoundaryCondition ()=default

Private Attributes

NumLib::LocalToGlobalIndexMap const & _dof_table
MeshLib::Mesh const & _mesh
int const _variable_id
int const _component_id
NumLib::IndexValueVector< GlobalIndexType_bc_values

Constructor & Destructor Documentation

◆ PhaseFieldIrreversibleDamageOracleBoundaryCondition()

ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::PhaseFieldIrreversibleDamageOracleBoundaryCondition ( NumLib::LocalToGlobalIndexMap const & dof_table,
MeshLib::Mesh const & mesh,
int const variable_id,
int const component_id )
inline

Definition at line 17 of file PhaseFieldIrreversibleDamageOracleBoundaryCondition.h.

21 : _dof_table(dof_table),
22 _mesh(mesh),
23 _variable_id(variable_id),
24 _component_id(component_id)
25 {
26 if (variable_id >= static_cast<int>(dof_table.getNumberOfVariables()) ||
27 component_id >=
28 dof_table.getNumberOfVariableComponents(variable_id))
29 {
31 "Variable id or component id too high. Actual values: ({:d}, "
32 "{:d}), "
33 "maximum values: ({:d}, {:d}).",
34 variable_id, component_id, dof_table.getNumberOfVariables(),
35 dof_table.getNumberOfVariableComponents(variable_id));
36 }
37 }
#define OGS_FATAL(...)
Definition Error.h:19

References _component_id, _dof_table, _mesh, _variable_id, NumLib::LocalToGlobalIndexMap::getNumberOfVariableComponents(), and NumLib::LocalToGlobalIndexMap::getNumberOfVariables().

Member Function Documentation

◆ getEssentialBCValues()

void ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::getEssentialBCValues ( const double ,
const GlobalVector & ,
NumLib::IndexValueVector< GlobalIndexType > &  ) const
overridevirtual

Writes the values of essential BCs to bc_values.

Reimplemented from ProcessLib::BoundaryCondition.

Definition at line 14 of file PhaseFieldIrreversibleDamageOracleBoundaryCondition.cpp.

17{
18 bc_values.ids.clear();
19 bc_values.values.clear();
20
21 // convert mesh node ids to global index for the given component
22 bc_values.ids.reserve(bc_values.ids.size() + _bc_values.ids.size());
23 bc_values.values.reserve(bc_values.values.size() +
24 _bc_values.values.size());
25
26 std::copy(_bc_values.ids.begin(), _bc_values.ids.end(),
27 std::back_inserter(bc_values.ids));
28 std::copy(_bc_values.values.begin(), _bc_values.values.end(),
29 std::back_inserter(bc_values.values));
30}

References _bc_values, NumLib::IndexValueVector< IndexType >::ids, and NumLib::IndexValueVector< IndexType >::values.

◆ preTimestep()

void ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::preTimestep ( const double t,
std::vector< GlobalVector * > const & x,
int const process_id )
overridevirtual

Reimplemented from ProcessLib::BoundaryCondition.

Definition at line 33 of file PhaseFieldIrreversibleDamageOracleBoundaryCondition.cpp.

36{
37 // phase-field variable is considered irreversible if it loses more than 95%
38 // of the stiffness, which is a widely used threshold.
39 double irreversibleDamage = 0.05;
40
41 _bc_values.ids.clear();
42 _bc_values.values.clear();
43
44 for (auto const& l :
46 {
47 const auto g_idx =
48 _dof_table.getGlobalIndex(l, _variable_id, _component_id);
49
50 if (g_idx < 0)
51 {
52 continue;
53 }
54
55 if ((*x[process_id])[g_idx] <= irreversibleDamage)
56 {
57 _bc_values.ids.emplace_back(g_idx);
58 _bc_values.values.emplace_back(0.0);
59 }
60 }
61}
auto meshLocations(Mesh const &mesh, MeshItemType const item_type)
Definition Mesh.h:227

References _bc_values, _component_id, _dof_table, _mesh, _variable_id, MeshLib::views::meshLocations(), and MeshLib::Node.

Member Data Documentation

◆ _bc_values

NumLib::IndexValueVector<GlobalIndexType> ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::_bc_values
private

◆ _component_id

int const ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::_component_id
private

◆ _dof_table

NumLib::LocalToGlobalIndexMap const& ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::_dof_table
private

◆ _mesh

MeshLib::Mesh const& ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::_mesh
private

◆ _variable_id

int const ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::_variable_id
private

The documentation for this class was generated from the following files: