OGS
anonymous_namespace{PythonBoundaryCondition.cpp} Namespace Reference

Functions

void initBCValues (NumLib::IndexValueVector< GlobalIndexType > &bc_values, std::size_t const nnodes)
void checkConsistency (NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::reference_wrapper< ProcessLib::ProcessVariable > > const &pvs)

Function Documentation

◆ checkConsistency()

void anonymous_namespace{PythonBoundaryCondition.cpp}::checkConsistency ( NumLib::LocalToGlobalIndexMap const & dof_table,
std::vector< std::reference_wrapper< ProcessLib::ProcessVariable > > const & pvs )

Definition at line 30 of file PythonBoundaryCondition.cpp.

33{
34 auto const num_vars_dt = dof_table.getNumberOfVariables();
35 auto const num_vars_pv = pvs.size();
36
37 if (static_cast<std::size_t>(num_vars_dt) != num_vars_pv)
38 {
40 "The number of variables in the d.o.f. table does not match the "
41 "number of process variables: {} != {}.",
42 num_vars_dt, num_vars_pv);
43 }
44
45 for (std::size_t var = 0; var < num_vars_pv; ++var)
46 {
47 auto const num_comp_dt = dof_table.getNumberOfVariableComponents(var);
48 auto const num_comp_pv = pvs[var].get().getNumberOfGlobalComponents();
49
50 if (num_comp_dt != num_comp_pv)
51 {
53 "The number of components of variable #{} in the d.o.f. table "
54 "does not match the number of components of process variable "
55 "#{} ({}): {} != {}.",
56 var, var, pvs[var].get().getName(), num_vars_dt, num_vars_pv);
57 }
58 }
59}
#define OGS_FATAL(...)
Definition Error.h:19
std::string getName(std::string const &line)
Returns the name/title from the "Zone"-description.

References getName(), NumLib::LocalToGlobalIndexMap::getNumberOfVariableComponents(), NumLib::LocalToGlobalIndexMap::getNumberOfVariables(), and OGS_FATAL.

◆ initBCValues()

void anonymous_namespace{PythonBoundaryCondition.cpp}::initBCValues ( NumLib::IndexValueVector< GlobalIndexType > & bc_values,
std::size_t const nnodes )

Definition at line 20 of file PythonBoundaryCondition.cpp.

22{
23 bc_values.ids.clear();
24 bc_values.values.clear();
25
26 bc_values.ids.reserve(nnodes);
27 bc_values.values.reserve(nnodes);
28}
std::vector< IndexType > ids
std::vector< double > values

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