25 int const variable,
int const component,
unsigned const num_nodes,
26 Eigen::Ref<Eigen::VectorXd> all_nodal_dof_for_this_component)
28 bool dof_not_found =
false;
30 for (
unsigned element_node_id = 0; element_node_id < num_nodes;
33 auto const& node = *element.
getNode(element_node_id);
34 auto const node_id = node.
getID();
37 auto const dof_idx = dof_table.
getGlobalIndex(loc, variable, component);
58 "This d.o.f. has been found in the d.o.f. "
59 "table, but before some d.o.f. has not been "
60 "found. Something has gone terribly wrong. "
61 "Some assumption in the implementation is "
64 all_nodal_dof_for_this_component[element_node_id] = x[dof_idx];
76 std::size_t
const mesh_id,
84 Eigen::MatrixXd primary_variables_mat(num_nodes, num_comp_total);
86 for (
int var = 0; var < num_var; ++var)
90 for (
int comp = 0; comp < num_comp; ++comp)
92 auto const global_component =
94 auto all_nodal_dof_for_this_component =
95 primary_variables_mat.col(global_component);
97 collectDofsToMatrixSingleComponentForSomeNodes(
98 element, mesh_id, dof_table, x, var, comp, num_nodes,
99 all_nodal_dof_for_this_component);
103 return primary_variables_mat;
109 int const variable,
int const component)
112 Eigen::VectorXd primary_variables_vec(num_nodes);
114 collectDofsToMatrixSingleComponentForSomeNodes(
115 element, mesh_id, dof_table, x, variable, component, num_nodes,
116 primary_variables_vec);
118 return primary_variables_vec;
Global vector based on Eigen vector.
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)