25 template <
unsigned DOFOffset,
typename NodalValues,
typename ShapeMatrix>
32 template <
unsigned DOFOffset,
typename NodalValues,
typename ShapeMatrix,
33 typename... ScalarTypes>
35 const ShapeMatrix& shape_matrix_N,
36 double& interpolated_value,
37 ScalarTypes&... interpolated_values)
39 auto const num_nodes = shape_matrix_N.size();
42 for (
auto n = decltype(num_nodes){0}; n < num_nodes; ++n)
44 iv += nodal_values[DOFOffset * num_nodes + n] * shape_matrix_N[n];
47 interpolated_value = iv;
49 shapeFunctionInterpolate<DOFOffset + 1>(nodal_values, shape_matrix_N,
50 interpolated_values...);
78 template <
typename NodalValues,
typename ShapeMatrix,
typename... ScalarTypes>
80 const ShapeMatrix& shape_matrix_N,
81 double& interpolated_value,
82 ScalarTypes&... interpolated_values)
84 auto const num_nodal_dof =
sizeof...(interpolated_values) + 1;
85 auto const num_nodes = shape_matrix_N.size();
87 assert(num_nodes * num_nodal_dof ==
88 static_cast<std::size_t
>(nodal_values.size()));
92 detail::shapeFunctionInterpolate<0>(nodal_values, shape_matrix_N,
94 interpolated_values...);
104 template <
typename LowerOrderShapeFunction,
typename HigherOrderMeshElementType,
105 int GlobalDim,
typename EigenMatrixType>
108 Eigen::MatrixBase<EigenMatrixType>
const& node_values,
111 assert(
dynamic_cast<HigherOrderMeshElementType const*
>(&element));
112 assert(node_values.cols() == 1);
114 using SF = LowerOrderShapeFunction;
121 for (
int n = 0; n < number_base_nodes; ++n)
123 std::size_t
const global_index =
getNodeIndex(element, n);
124 interpolated_values_global_vector[global_index] = node_values[n];
131 int const number_higher_order_nodes = number_all_nodes - number_base_nodes;
132 std::vector<MathLib::Point3d> higher_order_nodes;
133 higher_order_nodes.reserve(number_higher_order_nodes);
134 for (
int n = 0; n < number_higher_order_nodes; ++n)
136 higher_order_nodes.emplace_back(
138 [number_base_nodes + n]);
142 auto const shape_matrices =
147 for (
int n = 0; n < number_higher_order_nodes; ++n)
149 std::size_t
const global_index =
151 interpolated_values_global_vector[global_index] =
152 shape_matrices[n].N * node_values;
virtual unsigned getNumberOfNodes() const =0
virtual unsigned getNumberOfBaseNodes() const =0
std::size_t getNodeIndex(Element const &element, unsigned const idx)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > computeShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, PointContainer const &points)
void shapeFunctionInterpolate(const NodalValues &nodal_values, const ShapeMatrix &shape_matrix_N, double &interpolated_value, ScalarTypes &... interpolated_values)
void interpolateToHigherOrderNodes(MeshLib::Element const &element, bool const is_axially_symmetric, Eigen::MatrixBase< EigenMatrixType > const &node_values, MeshLib::PropertyVector< double > &interpolated_values_global_vector)