14#include <range/v3/algorithm/fill.hpp>
27 std::size_t
const global_component_id);
33 std::size_t
const global_component_id);
38 std::size_t
const mesh_item_id,
44 std::size_t
const variable_id,
45 std::size_t
const component_id,
46 std::size_t
const bulk_element_id,
54 std::vector<GlobalIndexType>& indices);
61 LocalToGlobalIndexMap
const& dof_table);
68template <
typename Functor>
80 ranges::fill(output_vector, 0);
82 int const n_components =
84 for (
int component = 0; component < n_components; ++component)
86 auto const& mesh_subset =
87 local_to_global_index_map.
getMeshSubset(variable_id, component);
91 auto const node_id = l.item_id;
93 l, variable_id, component);
94 double const value = input_vector[input_index];
104template <
typename Functor>
106 GlobalVector const& input_vector_on_bulk_mesh,
int const variable_id,
109 std::span<std::size_t const>
const&
110 map_submesh_node_id_to_bulk_mesh_node_id,
111 Functor map_function)
119 ranges::fill(output_vector_on_submesh, 0);
121 int const n_components =
123 for (
int component = 0; component < n_components; ++component)
125 auto const& mesh_subset =
126 local_to_global_index_map.
getMeshSubset(variable_id, component);
127 auto const mesh_id = mesh_subset.
getMeshID();
129 for (std::size_t submesh_node_id = 0;
130 submesh_node_id < map_submesh_node_id_to_bulk_mesh_node_id.size();
133 std::size_t
const bulk_node_id =
134 map_submesh_node_id_to_bulk_mesh_node_id[submesh_node_id];
137 auto const input_index = local_to_global_index_map.
getGlobalIndex(
138 l, variable_id, component);
147 double const value = input_vector_on_bulk_mesh[input_index];
149 output_vector_on_submesh.
getComponent(submesh_node_id, component) =
156 std::size_t
const mesh_item_id,
157 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_tables,
158 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)
auto meshLocations(Mesh const &mesh, MeshItemType const item_type)
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 getNodalValue(GlobalVector const &x, MeshLib::Location const &location, NumLib::LocalToGlobalIndexMap const &dof_table, 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)
double getNonGhostNodalValue(GlobalVector const &x, MeshLib::Location const &location, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const global_component_id)
double norm(GlobalVector const &x, unsigned const global_component, MathLib::VecNormType norm_type, LocalToGlobalIndexMap const &dof_table)