v0.8.23
DataStructures.cpp
Go to the documentation of this file.
1 /** \file DataStructures.cpp
2 \brief Implementation for Data Structures in Forces and Sources
3 
4 */
5 
6 /* This file is part of MoFEM.
7  * MoFEM is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 #include <cblas.h>
24 #include <lapack_wrap.h>
25 #include <gm_rule.h>
26 #ifdef __cplusplus
27 }
28 #endif
29 
30 namespace MoFEM {
31 
33  : sEnse(0), oRder(0), bAse(NOBASE) {
34  for (int b = 0; b != LASTBASE; ++b) {
35  N[b].reset(new MatrixDouble());
36  diffN[b].reset(new MatrixDouble());
37  }
38 }
39 
40 int DataForcesAndSourcesCore::EntData::getSense() const { return sEnse; }
41 
42 boost::shared_ptr<MatrixDouble> &
44  const FieldApproximationBase base) {
45  return N[base];
46 }
47 
48 const boost::shared_ptr<MatrixDouble> &
50  const FieldApproximationBase base) const {
51  return N[base];
52 }
53 
54 boost::shared_ptr<MatrixDouble> &
56  const FieldApproximationBase base) {
57  return diffN[base];
58 }
59 
60 const boost::shared_ptr<MatrixDouble> &
62  const FieldApproximationBase base) const {
63  return diffN[base];
64 }
65 
67  const FieldApproximationBase base) const {
68  return *(getNSharedPtr(base));
69 }
70 
72  const FieldApproximationBase base) const {
73  return *(getDiffNSharedPtr(base));
74 }
75 
77  const EntityType type) {
78 
80 
81  data->dataOnEntities[MBENTITYSET].push_back(new EntData());
82 
83  switch (type) {
84  case MBENTITYSET:
85  break;
86  case MBTET:
87  data->dataOnEntities[MBVERTEX].push_back(new EntData());
88  for (int ee = 0; ee != 6; ++ee) {
89  data->dataOnEntities[MBEDGE].push_back(new EntData());
90  }
91  for (int ff = 0; ff != 4; ++ff) {
92  data->dataOnEntities[MBTRI].push_back(new EntData());
93  }
94  data->dataOnEntities[MBTET].push_back(new EntData());
95  break;
96  case MBTRI:
97  data->dataOnEntities[MBVERTEX].push_back(new EntData());
98  for (int ee = 0; ee != 3; ++ee) {
99  data->dataOnEntities[MBEDGE].push_back(new EntData());
100  }
101  data->dataOnEntities[MBTRI].push_back(new EntData());
102  break;
103  case MBEDGE:
104  data->dataOnEntities[MBVERTEX].push_back(new EntData());
105  data->dataOnEntities[MBEDGE].push_back(new EntData());
106  break;
107  case MBVERTEX:
108  data->dataOnEntities[MBVERTEX].push_back(new EntData());
109  break;
110  case MBPRISM:
111  data->dataOnEntities[MBVERTEX].push_back(new EntData());
112  for (int ee = 0; ee != 9; ++ee) {
113  data->dataOnEntities[MBEDGE].push_back(new EntData());
114  }
115  for (int qq = 0; qq != 5; ++qq) {
116  data->dataOnEntities[MBQUAD].push_back(new EntData());
117  }
118  for (int ff = 0; ff != 5; ++ff) {
119  data->dataOnEntities[MBTRI].push_back(new EntData());
120  }
121  data->dataOnEntities[MBPRISM].push_back(new EntData());
122  break;
123  default:
125  }
126 }
127 
129  constructor_data(this, type);
130 }
131 
134  for (EntityType tt = MBVERTEX; tt != MBMAXTYPE; ++tt)
135  dataOnEntities[tt].clear();
136  constructor_data(this, type);
138 }
139 
141  DerivedDataForcesAndSourcesCore *derived_data,
142  const boost::shared_ptr<DataForcesAndSourcesCore> &data_ptr) {
143 
146 
147  for (int tt = MBVERTEX; tt != MBMAXTYPE; ++tt) {
148  auto &ent_data = data_ptr->dataOnEntities[tt];
149  auto &derived_ent_data = derived_data->dataOnEntities[tt];
150  for (auto &e : ent_data) {
151  boost::shared_ptr<EntData> ent_data_ptr(data_ptr, &e);
152  derived_ent_data.push_back(new DerivedEntData(ent_data_ptr));
153  }
154  }
155 }
156 
158  const boost::shared_ptr<DataForcesAndSourcesCore> &data_ptr)
159  : DataForcesAndSourcesCore(), dataPtr(data_ptr) {
161 }
162 
166  for (EntityType tt = MBVERTEX; tt != MBMAXTYPE; ++tt)
167  dataOnEntities[tt].clear();
170 }
171 
173  const boost::shared_ptr<DataForcesAndSourcesCore::EntData> &ent_data_ptr)
174  : entDataPtr(ent_data_ptr) {}
175 
177  return entDataPtr->getSense();
178 }
179 
180 boost::shared_ptr<MatrixDouble> &
182  const FieldApproximationBase base) {
183  return entDataPtr->getNSharedPtr(base);
184 }
185 boost::shared_ptr<MatrixDouble> &
187  const FieldApproximationBase base) {
188  return entDataPtr->getDiffNSharedPtr(base);
189 }
190 const boost::shared_ptr<MatrixDouble> &
192  const FieldApproximationBase base) const {
193  return entDataPtr->getNSharedPtr(base);
194 }
195 const boost::shared_ptr<MatrixDouble> &
197  const FieldApproximationBase base) const {
198  return entDataPtr->getDiffNSharedPtr(base);
199 }
200 
201 std::ostream &operator<<(std::ostream &os,
203  os << "sEnse: " << e.getSense() << std::endl
204  << "oRder: " << e.getOrder() << std::endl
205  << "global indices: " << e.getIndices() << std::endl
206  << "local indices: " << e.getLocalIndices() << std::endl;
207  os.precision(2);
208  os << "fieldData: " << std::fixed << e.getFieldData() << std::endl;
209  MatrixDouble base = e.getN();
210  MatrixDouble diff_base = e.getDiffN();
211  const double eps = 1e-6;
212  for (unsigned int ii = 0; ii != base.size1(); ii++) {
213  for (unsigned int jj = 0; jj != base.size2(); jj++) {
214  if (fabs(base(ii, jj)) < eps)
215  base(ii, jj) = 0;
216  }
217  }
218  for (unsigned int ii = 0; ii != diff_base.size1(); ii++) {
219  for (unsigned int jj = 0; jj != diff_base.size2(); jj++) {
220  if (fabs(diff_base(ii, jj)) < eps)
221  diff_base(ii, jj) = 0;
222  }
223  }
224  os << "N: " << std::fixed << base << std::endl
225  << "diffN: " << std::fixed << diff_base;
226  return os;
227 }
228 
229 std::ostream &operator<<(std::ostream &os, const DataForcesAndSourcesCore &e) {
230  for (unsigned int nn = 0; nn < e.dataOnEntities[MBVERTEX].size(); nn++) {
231  os << "dataOnEntities[MBVERTEX][" << nn << "]" << std::endl
232  << e.dataOnEntities[MBVERTEX][nn] << std::endl;
233  }
234  for (unsigned int ee = 0; ee < e.dataOnEntities[MBEDGE].size(); ee++) {
235  os << "dataOnEntities[MBEDGE][" << ee << "]" << std::endl
236  << e.dataOnEntities[MBEDGE][ee] << std::endl;
237  }
238  for (unsigned int ff = 0; ff < e.dataOnEntities[MBTRI].size(); ff++) {
239  os << "dataOnEntities[MBTRI][" << ff << "] " << std::endl
240  << e.dataOnEntities[MBTRI][ff] << std::endl;
241  }
242  for (unsigned int vv = 0; vv < e.dataOnEntities[MBTET].size(); vv++) {
243  os << "dataOnEntities[MBTET][" << vv << "]" << std::endl
244  << e.dataOnEntities[MBTET][vv] << std::endl;
245  }
246  return os;
247 }
248 
249 /** \name Specializations for H1/L2 */
250 
251 /**@{*/
252 
253 template <>
255 DataForcesAndSourcesCore::EntData::getFTensor1FieldData<3>() {
256  if (dOfs[0]->getNbOfCoeffs() != 3) {
257  std::stringstream s;
258  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
259  s << " but you ask for tensor rank 1 dimension 3";
260  THROW_MESSAGE(s.str());
261  }
262  double *ptr = &*fieldData.data().begin();
263  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(ptr, &ptr[1],
264  &ptr[2]);
265 }
266 
267 template <>
269 DataForcesAndSourcesCore::EntData::getFTensor1FieldData<2>() {
270  if (dOfs[0]->getNbOfCoeffs() != 2) {
271  std::stringstream s;
272  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
273  s << " but you ask for tensor rank 1 dimension 3";
274  THROW_MESSAGE(s.str());
275  }
276  double *ptr = &*fieldData.data().begin();
277  return FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2>(ptr, &ptr[1]);
278 }
279 
280 template <>
282 DataForcesAndSourcesCore::EntData::getFTensor2FieldData<3, 3>() {
283  if (dOfs[0]->getNbOfCoeffs() != 9) {
284  std::stringstream s;
285  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
286  s << " but you ask for tensor rank 2 dimensions 3 by 3 so 9 coefficients "
287  "is expected";
288  THROW_MESSAGE(s.str());
289  }
290  double *ptr = &*fieldData.data().begin();
292  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5], &ptr[6], &ptr[7],
293  &ptr[8]);
294 }
295 
296 template <>
298 DataForcesAndSourcesCore::EntData::getFTensor2SymmetricFieldData<3>() {
299  if (dOfs[0]->getNbOfCoeffs() != 6) {
300  std::stringstream s;
301  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
302  s << " but you ask for symmetric tensor rank 2 dimensions 3 by 3 so 6 "
303  "coefficients "
304  "is expected";
305  THROW_MESSAGE(s.str());
306  }
307  double *ptr = &*fieldData.data().begin();
309  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5]);
310 }
311 
314  if (dOfs[0]->getNbOfCoeffs() != 1) {
315  std::stringstream s;
316  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
317  s << " but expected scalar field, tensor of rank 0";
318  THROW_MESSAGE(s.str());
319  }
321  &*fieldData.data().begin());
322 }
323 
324 template <int Tensor_Dim>
327  const FieldApproximationBase base) {
328  std::stringstream s;
329  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
330  THROW_MESSAGE(s.str());
332 }
333 
334 template <int Tensor_Dim>
337  return getFTensor1DiffN<Tensor_Dim>(bAse);
338 }
339 
340 template <int Tensor_Dim>
343  const FieldApproximationBase base, const int bb) {
344  std::stringstream s;
345  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
346  THROW_MESSAGE(s.str());
348 }
349 
350 template <int Tensor_Dim>
353  return getFTensor1DiffN<Tensor_Dim>(bAse, bb);
354 }
355 
356 /**
357  * \brief Get spatial derivative of base function tensor for dimension 3d
358  */
359 template <>
361 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(
362  const FieldApproximationBase base) {
363  double *ptr = &*getDiffN(base).data().begin();
364  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
365 }
366 
367 /**
368  * \brief Get spatial derivative of base function tensor for dimension 3d
369  */
370 template <>
372 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>() {
373  return getFTensor1DiffN<3>(bAse);
374 }
375 
376 /**
377  * \brief Get spatial derivative of base function tensor for dimension 3d
378  */
379 template <>
381 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(
382  const FieldApproximationBase base, const int bb) {
383  double *ptr = &*getDiffN(base).data().begin();
385  &ptr[3 * bb], &ptr[3 * bb + 1], &ptr[3 * bb + 2], getDiffN(base).size2());
386 }
387 
388 /**
389  * \brief Get spatial derivative of base function tensor for dimension 3d
390  */
391 template <>
393 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(const int bb) {
394  return getFTensor1DiffN<3>(bAse, bb);
395 }
396 
397 /**
398  * \brief Get spatial derivative of base function tensor for dimension 2d
399  */
400 template <>
402 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(
403  const FieldApproximationBase base) {
404  double *ptr = &*getDiffN(base).data().begin();
405  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
406 }
407 
408 /**
409  * \brief Get spatial derivative of base function tensor for dimension 2d
410  */
411 template <>
413 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>() {
414  return getFTensor1DiffN<2>(bAse);
415 }
416 
417 /**
418  * \brief Get spatial derivative of base function tensor for dimension 3d
419  */
420 template <>
422 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(
423  const FieldApproximationBase base, const int bb) {
424  double *ptr = &*getDiffN(base).data().begin();
425  return FTensor::Tensor1<double *, 2>(&ptr[2 * bb], &ptr[2 * bb + 1],
426  getDiffN(base).size1());
427 }
428 
429 /**
430  * \brief Get spatial derivative of base function tensor for dimension 3d
431  */
432 template <>
434 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(const int bb) {
435  return getFTensor1DiffN<2>(bAse, bb);
436 }
437 
438 template <int Tensor_Dim>
441  const FieldApproximationBase base, const int gg, const int bb) {
442  std::stringstream s;
443  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
444  THROW_MESSAGE(s.str());
446 }
447 
448 /**
449  * \brief Get spatial derivative of base function tensor for dimension 3d
450  */
451 template <>
453 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(
454  const FieldApproximationBase base, const int gg, const int bb) {
455  double *ptr = &getDiffN(base)(gg, 3 * bb);
456  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
457 }
458 
459 /**
460  * \brief Get spatial derivative of base function tensor for dimension 3d
461  */
462 template <>
464 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(const int gg,
465  const int bb) {
466  return getFTensor1DiffN<3>(bAse, gg, bb);
467 }
468 
469 /**
470  * \brief Get spatial derivative of base function tensor for dimension 2d
471  */
472 template <>
474 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(
475  const FieldApproximationBase base, const int gg, const int bb) {
476  double *ptr = &getDiffN(base)(gg, 2 * bb);
477  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
478 }
479 
480 /**
481  * \brief Get spatial derivative of base function tensor for dimension 2d
482  */
483 template <>
485 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(const int gg,
486  const int bb) {
487  return getFTensor1DiffN<2>(bAse, gg, bb);
488 }
489 
490 /**@}*/
491 
492 /** \name Specializations for HDiv/HCrul */
493 
494 /**@{*/
495 
496 template <int Tensor_Dim>
499  std::stringstream s;
500  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
501  THROW_MESSAGE(s.str());
503 }
504 
505 template <int Tensor_Dim>
508  const int gg, const int bb) {
509  std::stringstream s;
510  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
511  THROW_MESSAGE(s.str());
513 }
514 
515 template <int Tensor_Dim0, int Tensor_Dim1>
517  Tensor_Dim0, Tensor_Dim1>
519  FieldApproximationBase base) {
520  std::stringstream s;
521  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
522  << " not implemented";
523  THROW_MESSAGE(s.str());
525 }
526 
527 template <int Tensor_Dim0, int Tensor_Dim1>
529  Tensor_Dim0, Tensor_Dim1>
531  const int gg,
532  const int bb) {
533  std::stringstream s;
534  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
535  << " not implemented";
536  THROW_MESSAGE(s.str());
538 }
539 
540 template <>
542 DataForcesAndSourcesCore::EntData::getFTensor1N<3>(
543  FieldApproximationBase base) {
544  double *t_n_ptr = &*getN(base).data().begin();
545  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
546  &t_n_ptr[HVEC1],
547  &t_n_ptr[HVEC2]);
548 }
549 
550 template <>
552 DataForcesAndSourcesCore::EntData::getFTensor1N<3>(FieldApproximationBase base,
553  const int gg, const int bb) {
554  double *t_n_ptr = &getN(base)(gg, 3 * bb);
555  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
556  &t_n_ptr[HVEC1],
557  &t_n_ptr[HVEC2]);
558 }
559 
560 template <>
562 DataForcesAndSourcesCore::EntData::getFTensor2DiffN<3, 3>(
563  FieldApproximationBase base) {
564  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
566  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
567  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
568  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
569 }
570 
571 template <>
573 DataForcesAndSourcesCore::EntData::getFTensor2DiffN<3, 3>(
574  FieldApproximationBase base, const int gg, const int bb) {
575  double *t_diff_n_ptr = &getDiffN(base)(gg, 9 * bb);
577  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
578  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
579  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
580 }
581 
582 template <>
584 DataForcesAndSourcesCore::EntData::getFTensor2DiffN<3, 2>(
585  FieldApproximationBase base) {
586  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
588  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
589  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1]);
590 }
591 
592 template <>
594 DataForcesAndSourcesCore::EntData::getFTensor2DiffN<3, 2>(
595  FieldApproximationBase base, const int gg, const int bb) {
596  double *t_diff_n_ptr = &getDiffN(base)(gg, 6 * bb);
598  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
599  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1]);
600 }
601 
602 template <int Tensor_Dim0, int Tensor_Dim1>
604  Tensor_Dim0, Tensor_Dim1>
606  std::stringstream s;
607  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
608  << " not implemented";
609  THROW_MESSAGE(s.str());
611  Tensor_Dim0, Tensor_Dim1>();
612 }
613 
614 template <>
616 DataForcesAndSourcesCore::EntData::getFTensor2N<3, 3>(
617  FieldApproximationBase base) {
618  double *t_n_ptr = &*(getN(base).data().begin());
620 
621  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
622 
623  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
624 
625  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
626 
627  );
628 }
629 
630 template <int Tensor_Dim0, int Tensor_Dim1>
632  Tensor_Dim0, Tensor_Dim1>
634  const int gg, const int bb) {
635  std::stringstream s;
636  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
637  << " not implemented";
638  THROW_MESSAGE(s.str());
640  Tensor_Dim0, Tensor_Dim1>();
641 }
642 
643 template <>
645 DataForcesAndSourcesCore::EntData::getFTensor2N<3, 3>(
646  FieldApproximationBase base, const int gg, const int bb) {
647  double *t_n_ptr = &getN(base)(gg, 9 * bb);
649 
650  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
651 
652  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
653 
654  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
655 
656  );
657 }
658 
659 /**@}*/
660 
661 } // namespace MoFEM
boost::shared_ptr< MatrixDouble > N[LASTBASE]
Base functions.
data structure for finite element entityIt keeps that about indices of degrees of freedom,...
DerivedDataForcesAndSourcesCore(const boost::shared_ptr< DataForcesAndSourcesCore > &data_ptr)
static void constructor_derived_data(DerivedDataForcesAndSourcesCore *derived_data, const boost::shared_ptr< DataForcesAndSourcesCore > &data_ptr)
const MatrixDouble & getDiffN() const
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:74
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
static void constructor_data(DataForcesAndSourcesCore *data, const EntityType type)
const VectorInt & getLocalIndices() const
get local indices of dofs on entity
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2DiffN()
Get derivatives of base functions for Hdiv space.
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620
MoFEMErrorCode setElementType(const EntityType type)
virtual const MatrixDouble & getDiffN(const FieldApproximationBase base) const
get derivatives of base functions
boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr(const FieldApproximationBase base)
virtual MoFEMErrorCode setElementType(const EntityType type)
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0FieldData()
Resturn scalar files as a FTensor of rank 0.
int getSense() const
get entity sense, need to calculate base functions with conforming approximation fields
boost::ptr_vector< EntData > dataOnEntities[MBMAXTYPE]
T data[Tensor_Dim]
const VectorInt & getIndices() const
Get global indices of dofs on entity.
virtual const MatrixDouble & getN(const FieldApproximationBase base) const
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FieldApproximationBase
approximation base
Definition: definitions.h:143
boost::shared_ptr< MatrixDouble > diffN[LASTBASE]
Derivatives of base functions.
const boost::shared_ptr< DataForcesAndSourcesCore > dataPtr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
DataForcesAndSourcesCore::EntData EntData
virtual int getSense() const
get entity sense, need to calculate base functions with conforming approximation fields
virtual boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr(const FieldApproximationBase base)
ApproximationOrder getOrder() const
get approximation order
Derived ata on single entity (This is passed as argument to DataOperator::doWork)
boost::shared_ptr< MatrixDouble > & getNSharedPtr(const FieldApproximationBase base)
T data[Tensor_Dim0][Tensor_Dim1]
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN()
Get derivatives of base functions.
friend std::ostream & operator<<(std::ostream &os, const DataForcesAndSourcesCore &e)
DerivedEntData(const boost::shared_ptr< DataForcesAndSourcesCore::EntData > &ent_data_ptr)
Data on single entity (This is passed as argument to DataOperator::doWork)
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr(const FieldApproximationBase base)
auto getFTensor2N()
Get base functions for Hdiv space.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
static const double eps
const VectorDouble & getFieldData() const
get dofs values
const int N
Definition: speed_test.cpp:3
std::bitset< LASTBASE > bAse
bases on element
auto getFTensor1N()
Get base functions for Hdiv space.
this class derive data form other data structure