7#include <range/v3/algorithm/fill.hpp>
18 MeshLib::Location
const& location,
19 NumLib::LocalToGlobalIndexMap
const& dof_table,
20 std::size_t
const global_component_id);
25 NumLib::LocalToGlobalIndexMap
const& dof_table,
26 std::size_t
const global_component_id);
31 std::size_t
const mesh_item_id,
32 NumLib::LocalToGlobalIndexMap
const& dof_table);
37 std::size_t
const variable_id,
38 std::size_t
const component_id,
39 std::size_t
const bulk_element_id,
40 NumLib::LocalToGlobalIndexMap
const& dof_table);
46 NumLib::LocalToGlobalIndexMap
const& dof_table,
47 std::vector<GlobalIndexType>& indices);
61template <
typename Functor>
73 ranges::fill(output_vector, 0);
75 int const n_components =
77 for (
int component = 0; component < n_components; ++component)
79 auto const& mesh_subset =
80 local_to_global_index_map.
getMeshSubset(variable_id, component);
84 auto const node_id = l.item_id;
86 l, variable_id, component);
87 double const value = input_vector[input_index];
97template <
typename Functor>
99 GlobalVector const& input_vector_on_bulk_mesh,
int const variable_id,
102 std::span<std::size_t const>
const&
103 map_submesh_node_id_to_bulk_mesh_node_id,
104 Functor map_function)
112 ranges::fill(output_vector_on_submesh, 0);
114 int const n_components =
116 for (
int component = 0; component < n_components; ++component)
118 auto const& mesh_subset =
119 local_to_global_index_map.
getMeshSubset(variable_id, component);
120 auto const mesh_id = mesh_subset.
getMeshID();
122 for (std::size_t submesh_node_id = 0;
123 submesh_node_id < map_submesh_node_id_to_bulk_mesh_node_id.size();
126 std::size_t
const bulk_node_id =
127 map_submesh_node_id_to_bulk_mesh_node_id[submesh_node_id];
130 auto const input_index = local_to_global_index_map.
getGlobalIndex(
131 l, variable_id, component);
140 double const value = input_vector_on_bulk_mesh[input_index];
142 output_vector_on_submesh.
getComponent(submesh_node_id, component) =
149 std::size_t
const mesh_item_id,
150 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_tables,
151 std::vector<GlobalVector*>
const& x);
MathLib::EigenVector GlobalVector
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)