Skip to content
Snippets Groups Projects
Commit f504a875 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

changed element access, added assertion

parent 086c64b4
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#define NUMLIB_INTERPOLATION_H #define NUMLIB_INTERPOLATION_H
#include<array> #include<array>
#include<cassert>
namespace NumLib namespace NumLib
{ {
...@@ -34,13 +35,15 @@ void shapeFunctionInterpolate( ...@@ -34,13 +35,15 @@ void shapeFunctionInterpolate(
{ {
auto const num_nodes = shape_matrix_N.size(); auto const num_nodes = shape_matrix_N.size();
assert(num_nodes*NodalDOF == nodal_values.size());
for (unsigned d=0; d<NodalDOF; ++d) for (unsigned d=0; d<NodalDOF; ++d)
{ {
*interpolated_values[d] = 0.0; *interpolated_values[d] = 0.0;
for (unsigned n=0; n<num_nodes; ++n) for (unsigned n=0; n<num_nodes; ++n)
{ {
*interpolated_values[d] += nodal_values[d*num_nodes+n] * shape_matrix_N(n); *interpolated_values[d] += nodal_values[d*num_nodes+n] * shape_matrix_N[n];
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment