12 const int index, boost::shared_ptr<VectorDouble> diff_data_ptr,
13 boost::shared_ptr<Range> ent_ptr)
16 dataPtr(data_ptr), dataVec(data_vec), iNdex(index),
17 diffDataPtr(diff_data_ptr), entsPtr(ent_ptr) {
39 const auto nb_integration_points =
getGaussPts().size2();
47 double norm_on_element = 0.;
49 for (
int gg = 0; gg != nb_integration_points; gg++) {
51 norm_on_element += t_w * t_data * t_data;
58 norm_on_element *= vol;
68 const int index, boost::shared_ptr<MatrixDouble> diff_data_ptr,
69 boost::shared_ptr<Range> ent_ptr)
72 dataPtr(data_ptr), dataVec(data_vec), iNdex(index),
73 diffDataPtr(diff_data_ptr), entsPtr(ent_ptr) {
88 if (entsPtr->find(this->getFEEntityHandle()) == entsPtr->end())
93 if (dataPtr != diffDataPtr)
94 *diffDataPtr -= *dataPtr;
99 const auto nb_integration_points = getGaussPts().size2();
101 const double vol = getMeasure();
103 auto t_w = getFTensor0IntegrationWeight();
105 auto t_data = getFTensor1FromMat<DIM>(*diffDataPtr);
107 double norm_on_element = 0.;
109 for (
int gg = 0; gg != nb_integration_points; ++gg) {
111 norm_on_element += t_w * (t_data(
i) * t_data(
i));
118 norm_on_element *= vol;
120 CHKERR VecSetValue(dataVec, iNdex, norm_on_element, ADD_VALUES);
125 template <
int DIM_1,
int DIM_2>
128 const int index, boost::shared_ptr<MatrixDouble> diff_data_ptr,
129 boost::shared_ptr<Range> ent_ptr)
132 dataPtr(data_ptr), dataVec(data_vec), iNdex(index),
133 diffDataPtr(diff_data_ptr), entsPtr(ent_ptr) {
140 template <
int DIM_1,
int DIM_2>
148 if (entsPtr->find(this->getFEEntityHandle()) == entsPtr->end())
153 if (dataPtr != diffDataPtr)
154 *diffDataPtr -= *dataPtr;
160 const auto nb_integration_points = getGaussPts().size2();
162 const double vol = getMeasure();
164 auto t_w = getFTensor0IntegrationWeight();
166 auto t_data = getFTensor2FromMat<DIM_1, DIM_2>(*diffDataPtr);
168 double norm_on_element = 0.;
170 for (
int gg = 0; gg != nb_integration_points; gg++) {
172 norm_on_element += t_w * (t_data(
i,
j) * t_data(
i,
j));
179 norm_on_element *= vol;
181 CHKERR VecSetValue(dataVec, iNdex, norm_on_element, ADD_VALUES);
187 boost::shared_ptr<VectorDouble> data_ptr,
ScalarFun scalar_function)
190 dataPtr(data_ptr), sFunc(scalar_function) {}
197 const int nb_integration_pts =
getGaussPts().size2();
199 dataPtr->resize(nb_integration_pts);
206 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
209 t_val =
sFunc(t_coords(0), t_coords(1), t_coords(2));
219 template <
int SPACE_DIM,
int BASE_DIM>
221 boost::shared_ptr<MatrixDouble> data_ptr,
VectorFunc vector_function)
224 dataPtr(data_ptr), vFunc(vector_function) {}
226 template <
int SPACE_DIM,
int BASE_DIM>
234 const int nb_integration_pts = getGaussPts().size2();
236 dataPtr->resize(
BASE_DIM, nb_integration_pts);
238 auto t_val = getFTensor1FromMat<BASE_DIM>(*(dataPtr));
241 auto t_coords = getFTensor1CoordsAtGaussPts();
243 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
245 auto func_val = vFunc(t_coords(0), t_coords(1), t_coords(2));
247 auto t_func_val = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(func_val);
249 t_val(
i) = t_func_val(
i);