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

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

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

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