25 std::size_t
const node_id,
26 std::size_t
const global_component_id);
32 std::size_t
const node_id,
33 std::size_t
const global_component_id);
38 std::size_t
const mesh_item_id,
46 std::vector<GlobalIndexType>& indices);
53 LocalToGlobalIndexMap
const& dof_table,
MeshLib::Mesh const& mesh);
60template <
typename Functor>
72 std::fill(begin(output_vector), end(output_vector), 0);
74 int const n_components =
76 for (
int component = 0; component < n_components; ++component)
78 auto const& mesh_subset =
79 local_to_global_index_map.
getMeshSubset(variable_id, component);
80 auto const mesh_id = mesh_subset.
getMeshID();
81 for (
auto const& node : mesh_subset.getNodes())
83 auto const node_id = node->getID();
87 l, variable_id, component);
88 double const value = input_vector[input_index];
98template <
typename Functor>
100 GlobalVector const& input_vector_on_bulk_mesh,
int const variable_id,
103 std::vector<std::size_t>
const& map_submesh_node_id_to_bulk_mesh_node_id,
104 Functor map_function)
112 std::fill(begin(output_vector_on_submesh), end(output_vector_on_submesh),
115 int const n_components =
117 for (
int component = 0; component < n_components; ++component)
119 auto const& mesh_subset =
120 local_to_global_index_map.
getMeshSubset(variable_id, component);
121 auto const mesh_id = mesh_subset.
getMeshID();
123 for (std::size_t submesh_node_id = 0;
124 submesh_node_id < map_submesh_node_id_to_bulk_mesh_node_id.size();
127 std::size_t
const bulk_node_id =
128 map_submesh_node_id_to_bulk_mesh_node_id[submesh_node_id];
131 auto const input_index = local_to_global_index_map.
getGlobalIndex(
132 l, variable_id, component);
141 double const value = input_vector_on_bulk_mesh[input_index];
143 output_vector_on_submesh.
getComponent(submesh_node_id, component) =
150 std::size_t
const mesh_item_id,
151 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_tables,
152 std::vector<GlobalVector*>
const& x);
Global vector based on Eigen vector.
std::size_t getMeshID() const
return this mesh ID
PROP_VAL_TYPE & getComponent(std::size_t tuple_index, int component)
Returns the value for the given component stored in the given tuple.
MathLib::RowColumnIndices< GlobalIndexType > RowColumnIndices
GlobalIndexType getGlobalIndex(MeshLib::Location const &l, int const variable_id, int const component_id) const
int getNumberOfVariableComponents(int variable_id) const
MeshLib::MeshSubset const & getMeshSubset(int const variable_id, int const component_id) const
static constexpr NUMLIB_EXPORT GlobalIndexType const nop
void setLocalAccessibleVector(PETScVector const &x)
double getNodalValue(GlobalVector const &x, MeshLib::Mesh const &mesh, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const node_id, std::size_t const global_component_id)
void transformVariableFromGlobalVector(GlobalVector const &input_vector, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector, Functor map_function)
double norm(GlobalVector const &x, unsigned const global_component, MathLib::VecNormType norm_type, LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
double getNonGhostNodalValue(GlobalVector const &x, MeshLib::Mesh const &mesh, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const node_id, std::size_t const global_component_id)
std::vector< GlobalIndexType > getIndices(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
NumLib::LocalToGlobalIndexMap::RowColumnIndices getRowColumnIndices(std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< GlobalIndexType > &indices)
Eigen::VectorXd getLocalX(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x)