18 int const variable,
int const component,
unsigned const num_nodes,
19 Eigen::Ref<Eigen::VectorXd> all_nodal_dof_for_this_component)
21 bool dof_not_found =
false;
23 for (
unsigned element_node_id = 0; element_node_id < num_nodes;
26 auto const& node = *element.
getNode(element_node_id);
27 auto const node_id = node.
getID();
30 auto const dof_idx = dof_table.
getGlobalIndex(loc, variable, component);
51 "This d.o.f. has been found in the d.o.f. "
52 "table, but before some d.o.f. has not been "
53 "found. Something has gone terribly wrong. "
54 "Some assumption in the implementation is "
57 all_nodal_dof_for_this_component[element_node_id] = x[dof_idx];
69 std::size_t
const mesh_id,
77 Eigen::MatrixXd primary_variables_mat(num_nodes, num_comp_total);
79 for (
int var = 0; var < num_var; ++var)
83 for (
int comp = 0; comp < num_comp; ++comp)
85 auto const global_component =
87 auto all_nodal_dof_for_this_component =
88 primary_variables_mat.col(global_component);
90 collectDofsToMatrixSingleComponentForSomeNodes(
91 element, mesh_id, dof_table, x, var, comp, num_nodes,
92 all_nodal_dof_for_this_component);
96 return primary_variables_mat;
102 int const variable,
int const component)
105 Eigen::VectorXd primary_variables_vec(num_nodes);
107 collectDofsToMatrixSingleComponentForSomeNodes(
108 element, mesh_id, dof_table, x, variable, component, num_nodes,
109 primary_variables_vec);
111 return primary_variables_vec;
MathLib::EigenVector GlobalVector
std::size_t getID() const
virtual unsigned getNumberOfNodes() const =0
virtual unsigned getNumberOfBaseNodes() const =0
virtual const Node * getNode(unsigned idx) const =0
int getGlobalComponent(int const variable_id, int const component_id) const
int getNumberOfVariables() const
GlobalIndexType getGlobalIndex(MeshLib::Location const &l, int const variable_id, int const component_id) const
int getNumberOfVariableComponents(int variable_id) const
int getNumberOfGlobalComponents() const
static constexpr NUMLIB_EXPORT GlobalIndexType const nop
Eigen::MatrixXd collectDofsToMatrix(MeshLib::Element const &element, std::size_t const mesh_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x)
Eigen::VectorXd collectDofsToMatrixOnBaseNodesSingleComponent(MeshLib::Element const &element, std::size_t const mesh_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, int const variable, int const component)
void collectDofsToMatrixSingleComponentForSomeNodes(MeshLib::Element const &element, std::size_t const mesh_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, int const variable, int const component, unsigned const num_nodes, Eigen::Ref< Eigen::VectorXd > all_nodal_dof_for_this_component)