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 37 of file PythonBoundaryCondition.cpp.

40{
41 auto const num_vars_dt = dof_table.getNumberOfVariables();
42 auto const num_vars_pv = pvs.size();
43
44 if (static_cast<std::size_t>(num_vars_dt) != num_vars_pv)
45 {
47 "The number of variables in the d.o.f. table does not match the "
48 "number of process variables: {} != {}.",
49 num_vars_dt, num_vars_pv);
50 }
51
52 for (std::size_t var = 0; var < num_vars_pv; ++var)
53 {
54 auto const num_comp_dt = dof_table.getNumberOfVariableComponents(var);
55 auto const num_comp_pv = pvs[var].get().getNumberOfGlobalComponents();
56
57 if (num_comp_dt != num_comp_pv)
58 {
60 "The number of components of variable #{} in the d.o.f. table "
61 "does not match the number of components of process variable "
62 "#{} ({}): {} != {}.",
63 var, var, pvs[var].get().getName(), num_vars_dt, num_vars_pv);
64 }
65 }
66}
#define OGS_FATAL(...)
Definition Error.h:26
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 27 of file PythonBoundaryCondition.cpp.

29{
30 bc_values.ids.clear();
31 bc_values.values.clear();
32
33 bc_values.ids.reserve(nnodes);
34 bc_values.values.reserve(nnodes);
35}
std::vector< IndexType > ids
std::vector< double > values

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