27 std::string property_name,
31 int const variable_id,
int const component_id)
32 : _bc_mesh(bc_mesh), _variable_id(variable_id), _component_id(component_id)
37 std::vector<MeshLib::Node*>
const& bc_nodes = bc_mesh.
getNodes();
43 variable_id, {component_id}, std::move(bc_mesh_subset)));
48 "Found mesh property '{:s}' in the mesh '{:s}' which is for "
49 "boundary assignment. This mesh property is the built-in property "
50 "of the class SolutionDependentDirichletBoundaryCondition.",
51 property_name, bc_mesh.
getName());
61 auto const& nodes = bc_mesh.
getNodes();
64 auto const id = nodes[i]->getID();
66 (*_solution_dependent_bc)[i] = parameter(0, pos)[0];
69 _parameter = std::make_unique<ParameterLib::MeshNodeParameter<double>>(
83 double const , std::vector<GlobalVector*>
const& x,
89 auto const id = nodes[i]->getID();
94 assert(global_index >= 0);
95 (*_solution_dependent_bc)[i] = x[process_id]->get(global_index);
99 std::unique_ptr<SolutionDependentDirichletBoundaryCondition>
103 int const component_id,
104 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
107 "Constructing SolutionDependentDirichletBoundaryCondition from "
116 auto& initial_value_parameter = ParameterLib::findParameter<double>(
119 parameters, 1, &bc_mesh);
135 return std::make_unique<SolutionDependentDirichletBoundaryCondition>(
136 std::move(property_name), initial_value_parameter, bc_mesh,
137 dof_table_bulk, variable_id, component_id);
Defines functions that are shared by DirichletBoundaryCondition and DirichletBoundaryConditionWithinT...
void DBUG(char const *fmt, Args const &... args)
Definition of the Mesh class.
void checkConfigParameter(std::string const ¶m, T const &value) const
T getConfigParameter(std::string const ¶m) const
Global vector based on Eigen vector.
A subset of nodes on a single mesh.
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
std::size_t getID() const
Get id of the mesh.
const std::string getName() const
Get name of the mesh.
Properties & getProperties()
std::size_t getNumberOfNodes() const
Get the number of nodes.
std::size_t getNumberOfElements() const
Get the number of elements.
bool existsPropertyVector(std::string const &name) const
LocalToGlobalIndexMap * deriveBoundaryConstrainedMap(int const variable_id, std::vector< int > const &component_ids, MeshLib::MeshSubset &&new_mesh_subset) const
void setNodeID(std::size_t node_id)
MeshLib::Mesh const & _bc_mesh
void getEssentialBCValues(double const t, GlobalVector const &x, NumLib::IndexValueVector< GlobalIndexType > &bc_values) const override
Writes the values of essential BCs to bc_values.
std::unique_ptr< NumLib::LocalToGlobalIndexMap const > _dof_table_boundary
std::unique_ptr< ParameterLib::MeshNodeParameter< double > > _parameter
MeshLib::PropertyVector< double > * _solution_dependent_bc
SolutionDependentDirichletBoundaryCondition(std::string property_name, ParameterLib::Parameter< double > const ¶meter, MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id)
void postTimestep(double const, std::vector< GlobalVector * > const &x, int const process_id) override
void getEssentialBCValuesLocal(ParameterLib::Parameter< double > const ¶meter, MeshLib::Mesh const &bc_mesh, std::vector< MeshLib::Node * > 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::unique_ptr< SolutionDependentDirichletBoundaryCondition > createSolutionDependentDirichletBoundaryCondition(BaseLib::ConfigTree const &config, MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const ¶meters)
void checkParametersOfDirichletBoundaryCondition(MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id)