OGS
ProcessLib::DeactivatedSubdomainDirichlet Class Referencefinal

Detailed Description

Definition at line 39 of file DeactivatedSubdomainDirichlet.h.

#include <DeactivatedSubdomainDirichlet.h>

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

Public Member Functions

 DeactivatedSubdomainDirichlet (MeshLib::PropertyVector< unsigned char > const &is_active, MathLib::PiecewiseLinearInterpolation time_interval, ParameterLib::Parameter< double > const &parameter, bool const set_outer_nodes_dirichlet_values, DeactivatedSubdomainMesh const &subdomain, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id)
 
void getEssentialBCValues (const double t, GlobalVector const &x, NumLib::IndexValueVector< GlobalIndexType > &bc_values) const override
 Writes the values of essential BCs to bc_values.
 
- Public Member Functions inherited from ProcessLib::BoundaryCondition
virtual void applyNaturalBC (const double, std::vector< GlobalVector * > const &, int const, GlobalMatrix *, GlobalVector &, GlobalMatrix *)
 
virtual void preTimestep (const double, std::vector< GlobalVector * > const &, int const)
 
virtual void postTimestep (const double, std::vector< GlobalVector * > const &, int const)
 
virtual ~BoundaryCondition ()=default
 

Private Member Functions

void config (NumLib::LocalToGlobalIndexMap const &dof_table_bulk)
 

Private Attributes

ParameterLib::Parameter< double > const & _parameter
 
DeactivatedSubdomainMesh const & _subdomain
 
std::unique_ptr< NumLib::LocalToGlobalIndexMap const > _dof_table_boundary
 
int const _variable_id
 
int const _component_id
 
MathLib::PiecewiseLinearInterpolation const _time_interval
 
MeshLib::PropertyVector< unsigned char > const & _is_active
 
bool const _set_outer_nodes_dirichlet_values
 

Constructor & Destructor Documentation

◆ DeactivatedSubdomainDirichlet()

ProcessLib::DeactivatedSubdomainDirichlet::DeactivatedSubdomainDirichlet ( MeshLib::PropertyVector< unsigned char > const & is_active,
MathLib::PiecewiseLinearInterpolation time_interval,
ParameterLib::Parameter< double > const & parameter,
bool const set_outer_nodes_dirichlet_values,
DeactivatedSubdomainMesh const & subdomain,
NumLib::LocalToGlobalIndexMap const & dof_table_bulk,
int const variable_id,
int const component_id )

Definition at line 20 of file DeactivatedSubdomainDirichlet.cpp.

28 : _parameter(parameter),
29 _subdomain(subdomain),
30 _variable_id(variable_id),
31 _component_id(component_id),
32 _time_interval(std::move(time_interval)),
33 _is_active(is_active),
34 _set_outer_nodes_dirichlet_values(set_outer_nodes_dirichlet_values)
35{
36 config(dof_table_bulk);
37}
MathLib::PiecewiseLinearInterpolation const _time_interval
ParameterLib::Parameter< double > const & _parameter
MeshLib::PropertyVector< unsigned char > const & _is_active
void config(NumLib::LocalToGlobalIndexMap const &dof_table_bulk)

References config().

Member Function Documentation

◆ config()

void ProcessLib::DeactivatedSubdomainDirichlet::config ( NumLib::LocalToGlobalIndexMap const & dof_table_bulk)
private

Definition at line 39 of file DeactivatedSubdomainDirichlet.cpp.

41{
44
45 std::vector<MeshLib::Node*> const& bc_nodes = _subdomain.mesh.getNodes();
46 MeshLib::MeshSubset subdomain_mesh_subset(_subdomain.mesh, bc_nodes);
47
48 // Create local DOF table from the BC mesh subset for the given variable
49 // and component id.
50 _dof_table_boundary = dof_table_bulk.deriveBoundaryConstrainedMap(
51 _variable_id, {_component_id}, std::move(subdomain_mesh_subset));
52}
A subset of nodes on a single mesh.
Definition MeshSubset.h:26
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:106
std::unique_ptr< NumLib::LocalToGlobalIndexMap const > _dof_table_boundary
void checkParametersOfDirichletBoundaryCondition(MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id)

References _component_id, _dof_table_boundary, _subdomain, _variable_id, ProcessLib::checkParametersOfDirichletBoundaryCondition(), NumLib::LocalToGlobalIndexMap::deriveBoundaryConstrainedMap(), MeshLib::Mesh::getNodes(), and ProcessLib::DeactivatedSubdomainMesh::mesh.

Referenced by DeactivatedSubdomainDirichlet().

◆ getEssentialBCValues()

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

Writes the values of essential BCs to bc_values.

Reimplemented from ProcessLib::BoundaryCondition.

Definition at line 54 of file DeactivatedSubdomainDirichlet.cpp.

57{
58 [[maybe_unused]] auto const& bulk_node_ids =
60 [[maybe_unused]] auto const& bulk_element_ids =
62
63 auto is_inactive_id = [&](std::size_t const bulk_element_id)
64 { return _is_active[bulk_element_id] == 0; };
65
66 auto is_inactive_element = [&](MeshLib::Element const* const e)
67 { return is_inactive_id(bulk_element_ids[e->getID()]); };
68
69 std::vector<std::size_t> inactive_nodes_in_bc_mesh;
70 std::copy_if(begin(_subdomain.inner_nodes), end(_subdomain.inner_nodes),
71 back_inserter(inactive_nodes_in_bc_mesh),
72 [&](std::size_t const n)
73 {
74 const auto& connected_elements =
76
77 return std::all_of(begin(connected_elements),
78 end(connected_elements),
79 is_inactive_element);
80 });
81
83 {
84 std::copy_if(begin(_subdomain.outer_nodes), end(_subdomain.outer_nodes),
85 back_inserter(inactive_nodes_in_bc_mesh),
86 [&](std::size_t const n)
87 {
88 const auto& connected_elements =
90
91 return std::all_of(begin(connected_elements),
92 end(connected_elements),
93 is_inactive_element);
94 });
95 }
96 else
97 {
98 for (std::size_t i = 0; i < _subdomain.outer_nodes.size(); ++i)
99 {
100 auto const& connected_elements = _subdomain.outer_nodes_elements[i];
101 if (std::all_of(begin(connected_elements), end(connected_elements),
102 is_inactive_id))
103 {
104 inactive_nodes_in_bc_mesh.push_back(_subdomain.outer_nodes[i]);
105 }
106 }
107 }
108
109 auto time_interval_contains = [&](double const t)
110 {
111 return _time_interval.getSupportMin() <= t &&
113 };
114 if (time_interval_contains(t))
115 {
117 _parameter, _subdomain.mesh, inactive_nodes_in_bc_mesh,
119 return;
120 }
121
122 bc_values.ids.clear();
123 bc_values.values.clear();
124}
std::vector< Element const * > const & getElementsConnectedToNode(std::size_t node_id) const
Definition Mesh.cpp:256
PropertyVector< std::size_t > const * bulkElementIDs(Mesh const &mesh)
Definition Mesh.cpp:300
PropertyVector< std::size_t > const * bulkNodeIDs(Mesh const &mesh)
Definition Mesh.cpp:292
void getEssentialBCValuesLocal(ParameterLib::Parameter< double > const &parameter, MeshLib::Mesh const &bc_mesh, std::vector< std::size_t > const &nodes_in_bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, int const variable_id, int const component_id, const double t, GlobalVector const &, NumLib::IndexValueVector< GlobalIndexType > &bc_values)
std::vector< std::vector< std::size_t > > outer_nodes_elements

References _component_id, _dof_table_boundary, _is_active, _parameter, _set_outer_nodes_dirichlet_values, _subdomain, _time_interval, _variable_id, MeshLib::bulkElementIDs(), MeshLib::bulkNodeIDs(), MeshLib::Mesh::getElementsConnectedToNode(), ProcessLib::getEssentialBCValuesLocal(), MathLib::PiecewiseLinearInterpolation::getSupportMax(), MathLib::PiecewiseLinearInterpolation::getSupportMin(), NumLib::IndexValueVector< typename >::ids, ProcessLib::DeactivatedSubdomainMesh::inner_nodes, ProcessLib::DeactivatedSubdomainMesh::mesh, ProcessLib::DeactivatedSubdomainMesh::outer_nodes, ProcessLib::DeactivatedSubdomainMesh::outer_nodes_elements, and NumLib::IndexValueVector< typename >::values.

Member Data Documentation

◆ _component_id

int const ProcessLib::DeactivatedSubdomainDirichlet::_component_id
private

Definition at line 65 of file DeactivatedSubdomainDirichlet.h.

Referenced by config(), and getEssentialBCValues().

◆ _dof_table_boundary

std::unique_ptr<NumLib::LocalToGlobalIndexMap const> ProcessLib::DeactivatedSubdomainDirichlet::_dof_table_boundary
private

Definition at line 63 of file DeactivatedSubdomainDirichlet.h.

Referenced by config(), and getEssentialBCValues().

◆ _is_active

MeshLib::PropertyVector<unsigned char> const& ProcessLib::DeactivatedSubdomainDirichlet::_is_active
private

Definition at line 68 of file DeactivatedSubdomainDirichlet.h.

Referenced by getEssentialBCValues().

◆ _parameter

ParameterLib::Parameter<double> const& ProcessLib::DeactivatedSubdomainDirichlet::_parameter
private

Definition at line 59 of file DeactivatedSubdomainDirichlet.h.

Referenced by getEssentialBCValues().

◆ _set_outer_nodes_dirichlet_values

bool const ProcessLib::DeactivatedSubdomainDirichlet::_set_outer_nodes_dirichlet_values
private

Definition at line 70 of file DeactivatedSubdomainDirichlet.h.

Referenced by getEssentialBCValues().

◆ _subdomain

DeactivatedSubdomainMesh const& ProcessLib::DeactivatedSubdomainDirichlet::_subdomain
private

Definition at line 61 of file DeactivatedSubdomainDirichlet.h.

Referenced by config(), and getEssentialBCValues().

◆ _time_interval

MathLib::PiecewiseLinearInterpolation const ProcessLib::DeactivatedSubdomainDirichlet::_time_interval
private

Definition at line 67 of file DeactivatedSubdomainDirichlet.h.

Referenced by getEssentialBCValues().

◆ _variable_id

int const ProcessLib::DeactivatedSubdomainDirichlet::_variable_id
private

Definition at line 64 of file DeactivatedSubdomainDirichlet.h.

Referenced by config(), and getEssentialBCValues().


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