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 24 of file PhaseFieldIrreversibleDamageOracleBoundaryCondition.h.

28 : _dof_table(dof_table),
29 _mesh(mesh),
30 _variable_id(variable_id),
31 _component_id(component_id)
32 {
33 if (variable_id >= static_cast<int>(dof_table.getNumberOfVariables()) ||
34 component_id >=
35 dof_table.getNumberOfVariableComponents(variable_id))
36 {
38 "Variable id or component id too high. Actual values: ({:d}, "
39 "{:d}), "
40 "maximum values: ({:d}, {:d}).",
41 variable_id, component_id, dof_table.getNumberOfVariables(),
42 dof_table.getNumberOfVariableComponents(variable_id));
43 }
44 }
#define OGS_FATAL(...)
Definition Error.h:26

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 21 of file PhaseFieldIrreversibleDamageOracleBoundaryCondition.cpp.

24{
25 bc_values.ids.clear();
26 bc_values.values.clear();
27
28 // convert mesh node ids to global index for the given component
29 bc_values.ids.reserve(bc_values.ids.size() + _bc_values.ids.size());
30 bc_values.values.reserve(bc_values.values.size() +
31 _bc_values.values.size());
32
33 std::copy(_bc_values.ids.begin(), _bc_values.ids.end(),
34 std::back_inserter(bc_values.ids));
35 std::copy(_bc_values.values.begin(), _bc_values.values.end(),
36 std::back_inserter(bc_values.values));
37}

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 40 of file PhaseFieldIrreversibleDamageOracleBoundaryCondition.cpp.

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

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: