21 std::string property_name,
25 int const variable_id,
int const component_id)
31 std::vector<MeshLib::Node*>
const& bc_nodes = bc_mesh.
getNodes();
37 variable_id, {component_id}, std::move(bc_mesh_subset));
42 "Found mesh property '{:s}' in the mesh '{:s}' which is for "
43 "boundary assignment. This mesh property is the built-in property "
44 "of the class SolutionDependentDirichletBoundaryCondition.",
45 property_name, bc_mesh.
getName());
55 auto const& nodes = bc_mesh.
getNodes();
58 auto const id = nodes[i]->getID();
60 (*_solution_dependent_bc)[i] = parameter(0, pos)[0];
63 _parameter = std::make_unique<ParameterLib::MeshNodeParameter<double>>(
76 double const , std::vector<GlobalVector*>
const& x,
79 auto const& nodes =
_bc_mesh.getNodes();
82 auto const id = nodes[i]->getID();
87 assert(global_index >= 0);
88 (*_solution_dependent_bc)[i] = x[process_id]->get(global_index);
96 DBUG(
"Parsing SolutionDependentDirichletBoundaryCondition.");
105 auto const initial_value_parameter_string =
109 return {property_name, initial_value_parameter_string};
112std::unique_ptr<SolutionDependentDirichletBoundaryCondition>
117 int const component_id,
118 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
120 DBUG(
"Constructing SolutionDependentDirichletBoundaryCondition.");
139 return std::make_unique<SolutionDependentDirichletBoundaryCondition>(
140 config.
property_name, initial_value_parameter, bc_mesh, dof_table_bulk,
141 variable_id, component_id);
MathLib::EigenVector GlobalVector
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
T getConfigParameter(std::string const ¶m) const
void checkConfigParameter(std::string const ¶m, std::string_view const value) const
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).
Properties & getProperties()
const std::string getName() const
Get name of the mesh.
std::size_t getNumberOfNodes() const
Get the number of nodes.
std::size_t getNumberOfElements() const
Get the number of elements.
bool existsPropertyVector(std::string_view name) const
std::unique_ptr< 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
PropertyVector< T > * getOrCreateMeshProperty(Mesh &mesh, std::string const &property_name, MeshItemType const item_type, int const number_of_components)
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const ¶meter_name, std::vector< std::unique_ptr< ParameterBase > > const ¶meters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
void getEssentialBCValuesLocal(ParameterLib::Parameter< double > const ¶meter, 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)
void checkParametersOfDirichletBoundaryCondition(MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id)
std::unique_ptr< SolutionDependentDirichletBoundaryCondition > createSolutionDependentDirichletBoundaryCondition(SolutionDependentDirichletBoundaryConditionConfig 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)
SolutionDependentDirichletBoundaryConditionConfig parseSolutionDependentDirichletBoundaryCondition(BaseLib::ConfigTree const &config)
std::string initial_value_parameter_string
std::string property_name