21 #ifndef fiber_default_test_trial_integral_imp_hpp
22 #define fiber_default_test_trial_integral_imp_hpp
24 #include "default_test_trial_integral.hpp"
26 #include "geometrical_data.hpp"
55 template <
typename IntegrandFunctor>
56 void DefaultTestTrialIntegral<IntegrandFunctor>::
57 addGeometricalDependencies(
size_t& geomDeps)
const
59 geomDeps |= INTEGRATION_ELEMENTS;
60 m_functor.addGeometricalDependencies(geomDeps);
63 template <
typename IntegrandFunctor>
64 void DefaultTestTrialIntegral<IntegrandFunctor>::evaluate(
65 const GeometricalData<CoordinateType>& geomData,
66 const CollectionOf3dArrays<BasisFunctionType>& testValues,
67 const CollectionOf3dArrays<BasisFunctionType>& trialValues,
68 const std::vector<CoordinateType>& weights,
69 arma::Mat<ResultType>& result)
const
71 const size_t pointCount = weights.size();
72 assert(testValues.size() == 1);
73 assert(trialValues.size() == 1);
77 const size_t testDofCount = testValues[0].extent(1);
78 const size_t trialDofCount = trialValues[0].extent(1);
79 assert(testValues[0].extent(2) == pointCount);
80 assert(trialValues[0].extent(2) == pointCount);
81 for (
size_t trialDof = 0; trialDof < trialDofCount; ++trialDof)
82 for (
size_t testDof = 0; testDof < testDofCount; ++testDof) {
84 for (
size_t point = 0; point < pointCount; ++point)
85 sum += m_functor.evaluate(
86 geomData.const_slice(point),
87 testValues.const_slice(testDof, point),
88 trialValues.const_slice(trialDof, point)) *
89 geomData.integrationElements(point) *
91 result(testDof, trialDof) = sum;