v0.8.16
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 #include <Includes.hpp>
21 #include <version.h>
22 #include <definitions.h>
23 #include <Common.hpp>
24 
25 #include <h1_hdiv_hcurl_l2.h>
26 
27 #include <UnknownInterface.hpp>
28 
29 #include <MaterialBlocks.hpp>
30 #include <BCData.hpp>
31 #include <TagMultiIndices.hpp>
32 #include <CoordSysMultiIndices.hpp>
33 #include <FieldMultiIndices.hpp>
34 #include <EntsMultiIndices.hpp>
35 #include <DofsMultiIndices.hpp>
36 #include <FEMultiIndices.hpp>
37 #include <ProblemsMultiIndices.hpp>
39 #include <BCMultiIndices.hpp>
40 #include <CoreDataStructures.hpp>
41 #include <SeriesMultiIndices.hpp>
42 
43 #include <LoopMethods.hpp>
44 #include <Interface.hpp>
45 #include <Core.hpp>
46 
47 #include <FTensor.hpp>
48 #include <DataStructures.hpp>
49 
50 #include <boost/scoped_ptr.hpp>
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55  #include <cblas.h>
56  #include <lapack_wrap.h>
57  #include <gm_rule.h>
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 namespace MoFEM {
63 
64 template <>
67  ublas::vector<double, DoubleAllocator> &data) {
69  &*data.data().begin());
70 }
71 
72 template <>
74 getFTensor1FromMat<3, double, ublas::row_major, DoubleAllocator>(
75  MatrixDouble &data) {
76  if (data.size1() != 3) {
77  THROW_MESSAGE("Wrong size of data matrix");
78  }
80  &data(0, 0), &data(1, 0), &data(2, 0));
81 }
82 
83 template <>
85 getFTensor1FromMat<2, double, ublas::row_major, DoubleAllocator>(
86  MatrixDouble &data) {
87  if (data.size1() != 2) {
88  THROW_MESSAGE("Wrong size of data matrix");
89  }
91  &data(1, 0));
92 }
93 
94 template <>
96 getFTensor2FromMat<3, 3, double, ublas::row_major, DoubleAllocator>(
97  MatrixDouble &data) {
98  if (data.size1() != 9) {
99  THROW_MESSAGE("Wrong size of data matrix; numer of rows is " +
100  boost::lexical_cast<std::string>(data.size1()));
101  }
103  &data(0, 0), &data(1, 0), &data(2, 0), &data(3, 0), &data(4, 0),
104  &data(5, 0), &data(6, 0), &data(7, 0), &data(8, 0));
105 }
106 
107 template <>
109 getFTensor2FromMat<3, 2, double, ublas::row_major, DoubleAllocator>(
110  MatrixDouble &data) {
111  if (data.size1() != 6) {
112  THROW_MESSAGE("Wrong size of data matrix");
113  }
115  &data(0, 0), &data(1, 0), &data(2, 0), &data(3, 0), &data(4, 0),
116  &data(5, 0));
117 }
118 
119 template <>
121 getFTensor2SymmetricFromMat<3, double, ublas::row_major, DoubleAllocator>(
122  MatrixDouble &data) {
123  if (data.size1() != 6) {
124  THROW_MESSAGE("Wrong size of data matrix");
125  }
127  &data(0, 0), &data(1, 0), &data(2, 0), &data(3, 0), &data(4, 0),
128  &data(5, 0));
129 }
130 
132  : sEnse(0), oRder(0), bAse(NOBASE) {
133  for (int b = 0; b != LASTBASE;++b) {
134  N[b].reset(new MatrixDouble());
135  diffN[b].reset(new MatrixDouble());
136  }
137 }
138 
140  const EntityType type) {
141 
143 
144  data->dataOnEntities[MBENTITYSET].push_back(new EntData());
145 
146  switch (type) {
147  case MBENTITYSET:
148  break;
149  case MBTET:
150  data->dataOnEntities[MBVERTEX].push_back(new EntData());
151  for (int ee = 0; ee != 6; ++ee) {
152  data->dataOnEntities[MBEDGE].push_back(new EntData());
153  }
154  for (int ff = 0; ff != 4; ++ff) {
155  data->dataOnEntities[MBTRI].push_back(new EntData());
156  }
157  data->dataOnEntities[MBTET].push_back(new EntData());
158  break;
159  case MBTRI:
160  data->dataOnEntities[MBVERTEX].push_back(new EntData());
161  for (int ee = 0; ee != 3; ++ee) {
162  data->dataOnEntities[MBEDGE].push_back(new EntData());
163  }
164  data->dataOnEntities[MBTRI].push_back(new EntData());
165  break;
166  case MBEDGE:
167  data->dataOnEntities[MBVERTEX].push_back(new EntData());
168  data->dataOnEntities[MBEDGE].push_back(new EntData());
169  break;
170  case MBVERTEX:
171  data->dataOnEntities[MBVERTEX].push_back(new EntData());
172  break;
173  case MBPRISM:
174  data->dataOnEntities[MBVERTEX].push_back(new EntData());
175  for (int ee = 0; ee != 9; ++ee) {
176  data->dataOnEntities[MBEDGE].push_back(new EntData());
177  }
178  for (int qq = 0; qq != 5; ++qq) {
179  data->dataOnEntities[MBQUAD].push_back(new EntData());
180  }
181  for (int ff = 0; ff != 5; ++ff) {
182  data->dataOnEntities[MBTRI].push_back(new EntData());
183  }
184  data->dataOnEntities[MBPRISM].push_back(new EntData());
185  break;
186  default:
188  }
189 }
190 
192  constructor_data(this, type);
193 }
194 
197  for (EntityType tt = MBVERTEX; tt != MBMAXTYPE; ++tt)
198  dataOnEntities[tt].clear();
199  constructor_data(this, type);
201 }
202 
204  DerivedDataForcesAndSourcesCore *derived_data,
205  const boost::shared_ptr<DataForcesAndSourcesCore> &data_ptr) {
206 
209 
210  for (int tt = MBVERTEX; tt != MBMAXTYPE; ++tt) {
211  auto &ent_data = data_ptr->dataOnEntities[tt];
212  auto &derived_ent_data = derived_data->dataOnEntities[tt];
213  for (auto &e : ent_data) {
214  boost::shared_ptr<EntData> ent_data_ptr(data_ptr, &e);
215  derived_ent_data.push_back(new DerivedEntData(ent_data_ptr));
216  }
217  }
218 }
219 
221  const boost::shared_ptr<DataForcesAndSourcesCore> &data_ptr)
222  : DataForcesAndSourcesCore(), dataPtr(data_ptr) {
224 }
225 
229  for (EntityType tt = MBVERTEX; tt != MBMAXTYPE; ++tt)
230  dataOnEntities[tt].clear();
233 }
234 
235 std::ostream &operator<<(std::ostream &os,
237  os << "sEnse: " << e.getSense() << std::endl
238  << "oRder: " << e.getOrder() << std::endl
239  << "global indices: " << e.getIndices() << std::endl
240  << "local indices: " << e.getLocalIndices() << std::endl;
241  os.precision(2);
242  os << "fieldData: " << std::fixed << e.getFieldData() << std::endl;
243  MatrixDouble base = e.getN();
244  MatrixDouble diff_base = e.getDiffN();
245  const double eps = 1e-6;
246  for (unsigned int ii = 0; ii != base.size1(); ii++) {
247  for (unsigned int jj = 0; jj != base.size2(); jj++) {
248  if (fabs(base(ii, jj)) < eps)
249  base(ii, jj) = 0;
250  }
251  }
252  for (unsigned int ii = 0; ii != diff_base.size1(); ii++) {
253  for (unsigned int jj = 0; jj != diff_base.size2(); jj++) {
254  if (fabs(diff_base(ii, jj)) < eps)
255  diff_base(ii, jj) = 0;
256  }
257  }
258  os << "N: " << std::fixed << base << std::endl
259  << "diffN: " << std::fixed << diff_base;
260  return os;
261 }
262 
263 std::ostream &operator<<(std::ostream &os, const DataForcesAndSourcesCore &e) {
264  for (unsigned int nn = 0; nn < e.dataOnEntities[MBVERTEX].size(); nn++) {
265  os << "dataOnEntities[MBVERTEX][" << nn << "]" << std::endl
266  << e.dataOnEntities[MBVERTEX][nn] << std::endl;
267  }
268  for (unsigned int ee = 0; ee < e.dataOnEntities[MBEDGE].size(); ee++) {
269  os << "dataOnEntities[MBEDGE][" << ee << "]" << std::endl
270  << e.dataOnEntities[MBEDGE][ee] << std::endl;
271  }
272  for (unsigned int ff = 0; ff < e.dataOnEntities[MBTRI].size(); ff++) {
273  os << "dataOnEntities[MBTRI][" << ff << "] " << std::endl
274  << e.dataOnEntities[MBTRI][ff] << std::endl;
275  }
276  for (unsigned int vv = 0; vv < e.dataOnEntities[MBTET].size(); vv++) {
277  os << "dataOnEntities[MBTET][" << vv << "]" << std::endl
278  << e.dataOnEntities[MBTET][vv] << std::endl;
279  }
280  return os;
281 }
282 
283 /** \name Specializations for H1/L2 */
284 
285 /**@{*/
286 
287 template <>
289 DataForcesAndSourcesCore::EntData::getFTensor1FieldData<3>() {
290  if (dOfs[0]->getNbOfCoeffs() != 3) {
291  std::stringstream s;
292  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
293  s << " but you ask for tensor rank 1 dimension 3";
294  THROW_MESSAGE(s.str());
295  }
296  double *ptr = &*fieldData.data().begin();
297  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(ptr, &ptr[1],
298  &ptr[2]);
299 }
300 
301 template <>
303 DataForcesAndSourcesCore::EntData::getFTensor1FieldData<2>() {
304  if (dOfs[0]->getNbOfCoeffs() != 2) {
305  std::stringstream s;
306  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
307  s << " but you ask for tensor rank 1 dimension 3";
308  THROW_MESSAGE(s.str());
309  }
310  double *ptr = &*fieldData.data().begin();
311  return FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2>(ptr, &ptr[1]);
312 }
313 
314 template <>
316 DataForcesAndSourcesCore::EntData::getFTensor2FieldData<3, 3>() {
317  if (dOfs[0]->getNbOfCoeffs() != 9) {
318  std::stringstream s;
319  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
320  s << " but you ask for tensor rank 2 dimensions 3 by 3 so 9 coefficients "
321  "is expected";
322  THROW_MESSAGE(s.str());
323  }
324  double *ptr = &*fieldData.data().begin();
326  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5], &ptr[6], &ptr[7],
327  &ptr[8]);
328 }
329 
330 template <>
332 DataForcesAndSourcesCore::EntData::getFTensor2SymmetricFieldData<3>() {
333  if (dOfs[0]->getNbOfCoeffs() != 6) {
334  std::stringstream s;
335  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
336  s << " but you ask for symmetric tensor rank 2 dimensions 3 by 3 so 6 "
337  "coefficients "
338  "is expected";
339  THROW_MESSAGE(s.str());
340  }
341  double *ptr = &*fieldData.data().begin();
343  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5]);
344 }
345 
348  if (dOfs[0]->getNbOfCoeffs() != 1) {
349  std::stringstream s;
350  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
351  s << " but expected scalar field, tensor of rank 0";
352  THROW_MESSAGE(s.str());
353  }
355  &*fieldData.data().begin());
356 }
357 
358 template <int Tensor_Dim>
361  const FieldApproximationBase base) {
362  std::stringstream s;
363  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
364  THROW_MESSAGE(s.str());
366 }
367 
368 template <int Tensor_Dim>
371  return getFTensor1DiffN<Tensor_Dim>(bAse);
372 }
373 
374 template <int Tensor_Dim>
377  const FieldApproximationBase base, const int bb) {
378  std::stringstream s;
379  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
380  THROW_MESSAGE(s.str());
382 }
383 
384 template <int Tensor_Dim>
387  return getFTensor1DiffN<Tensor_Dim>(bAse, bb);
388 }
389 
390 /**
391  * \brief Get spatial derivative of base function tensor for dimension 3d
392  */
393 template <>
395 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(
396  const FieldApproximationBase base) {
397  double *ptr = &*getDiffN(base).data().begin();
398  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
399 }
400 
401 /**
402  * \brief Get spatial derivative of base function tensor for dimension 3d
403  */
404 template <>
406 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>() {
407  return getFTensor1DiffN<3>(bAse);
408 }
409 
410 /**
411  * \brief Get spatial derivative of base function tensor for dimension 3d
412  */
413 template <>
415 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(
416  const FieldApproximationBase base, const int bb) {
417  double *ptr = &*getDiffN(base).data().begin();
419  &ptr[3 * bb], &ptr[3 * bb + 1], &ptr[3 * bb + 2], getDiffN(base).size2());
420 }
421 
422 /**
423  * \brief Get spatial derivative of base function tensor for dimension 3d
424  */
425 template <>
427 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(const int bb) {
428  return getFTensor1DiffN<3>(bAse, bb);
429 }
430 
431 /**
432  * \brief Get spatial derivative of base function tensor for dimension 2d
433  */
434 template <>
436 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(
437  const FieldApproximationBase base) {
438  double *ptr = &*getDiffN(base).data().begin();
439  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
440 }
441 
442 /**
443  * \brief Get spatial derivative of base function tensor for dimension 2d
444  */
445 template <>
447 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>() {
448  return getFTensor1DiffN<2>(bAse);
449 }
450 
451 /**
452  * \brief Get spatial derivative of base function tensor for dimension 3d
453  */
454 template <>
456 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(
457  const FieldApproximationBase base, const int bb) {
458  double *ptr = &*getDiffN(base).data().begin();
459  return FTensor::Tensor1<double *, 2>(&ptr[2 * bb], &ptr[2 * bb + 1],
460  getDiffN(base).size1());
461 }
462 
463 /**
464  * \brief Get spatial derivative of base function tensor for dimension 3d
465  */
466 template <>
468 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(const int bb) {
469  return getFTensor1DiffN<2>(bAse, bb);
470 }
471 
472 template <int Tensor_Dim>
475  const FieldApproximationBase base, const int gg, const int bb) {
476  std::stringstream s;
477  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
478  THROW_MESSAGE(s.str());
480 }
481 
482 /**
483  * \brief Get spatial derivative of base function tensor for dimension 3d
484  */
485 template <>
487 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(
488  const FieldApproximationBase base, const int gg, const int bb) {
489  double *ptr = &getDiffN(base)(gg, 3 * bb);
490  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
491 }
492 
493 /**
494  * \brief Get spatial derivative of base function tensor for dimension 3d
495  */
496 template <>
498 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<3>(const int gg,
499  const int bb) {
500  return getFTensor1DiffN<3>(bAse, gg, bb);
501 }
502 
503 /**
504  * \brief Get spatial derivative of base function tensor for dimension 2d
505  */
506 template <>
508 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(
509  const FieldApproximationBase base, const int gg, const int bb) {
510  double *ptr = &getDiffN(base)(gg, 2 * bb);
511  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
512 }
513 
514 /**
515  * \brief Get spatial derivative of base function tensor for dimension 2d
516  */
517 template <>
519 DataForcesAndSourcesCore::EntData::getFTensor1DiffN<2>(const int gg,
520  const int bb) {
521  return getFTensor1DiffN<2>(bAse, gg, bb);
522 }
523 
524 /**@}*/
525 
526 /** \name Specializations for HDiv/HCrul */
527 
528 /**@{*/
529 
530 template <int Tensor_Dim>
533  FieldApproximationBase base) {
534  std::stringstream s;
535  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
536  THROW_MESSAGE(s.str());
538 }
539 
540 template <int Tensor_Dim>
543  const int gg,
544  const int bb) {
545  std::stringstream s;
546  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
547  THROW_MESSAGE(s.str());
549 }
550 
551 template <int Tensor_Dim0, int Tensor_Dim1>
553  Tensor_Dim0, Tensor_Dim1>
555  FieldApproximationBase base) {
556  std::stringstream s;
557  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
558  << " not implemented";
559  THROW_MESSAGE(s.str());
561 }
562 
563 template <int Tensor_Dim0, int Tensor_Dim1>
565  Tensor_Dim0, Tensor_Dim1>
567  FieldApproximationBase base, const int gg, const int bb) {
568  std::stringstream s;
569  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
570  << " not implemented";
571  THROW_MESSAGE(s.str());
573 }
574 
575 template <>
577 DataForcesAndSourcesCore::EntData::getFTensor1N<3>(
578  FieldApproximationBase base) {
579  double *t_n_ptr = &*getN(base).data().begin();
580  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
581  &t_n_ptr[HVEC1],
582  &t_n_ptr[HVEC2]);
583 }
584 
585 template <>
587 DataForcesAndSourcesCore::EntData::getFTensor1N<3>(
588  FieldApproximationBase base, const int gg, const int bb) {
589  double *t_n_ptr = &getN(base)(gg, 3 * bb);
590  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
591  &t_n_ptr[HVEC1],
592  &t_n_ptr[HVEC2]);
593 }
594 
595 template <>
597 DataForcesAndSourcesCore::EntData::getFTensor2DiffN<3, 3>(
598  FieldApproximationBase base) {
599  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
601  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
602  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
603  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
604 }
605 
606 template <>
608 DataForcesAndSourcesCore::EntData::getFTensor2DiffN<3, 3>(
609  FieldApproximationBase base, const int gg, const int bb) {
610  double *t_diff_n_ptr = &getDiffN(base)(gg, 9 * bb);
612  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
613  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
614  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
615 }
616 
617 template <>
619 DataForcesAndSourcesCore::EntData::getFTensor2DiffN<3, 2>(
620  FieldApproximationBase base) {
621  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
623  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
624  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0],
625  &t_diff_n_ptr[HVEC2_1]);
626 }
627 
628 template <>
630 DataForcesAndSourcesCore::EntData::getFTensor2DiffN<3, 2>(
631  FieldApproximationBase base, const int gg, const int bb) {
632  double *t_diff_n_ptr = &getDiffN(base)(gg, 6 * bb);
634  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
635  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1]);
636 }
637 
638 template <int Tensor_Dim0, int Tensor_Dim1>
640  Tensor_Dim0, Tensor_Dim1>
642  std::stringstream s;
643  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
644  << " not implemented";
645  THROW_MESSAGE(s.str());
647  Tensor_Dim0, Tensor_Dim1>();
648 }
649 
650 template <>
652 DataForcesAndSourcesCore::EntData::getFTensor2N<3, 3>(
653  FieldApproximationBase base) {
654  double *t_n_ptr = &*(getN(base).data().begin());
656 
657  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
658 
659  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
660 
661  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
662 
663  );
664 }
665 
666 template <int Tensor_Dim0, int Tensor_Dim1>
668  Tensor_Dim0, Tensor_Dim1>
670  const int gg, const int bb) {
671  std::stringstream s;
672  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
673  << " not implemented";
674  THROW_MESSAGE(s.str());
676  Tensor_Dim0, Tensor_Dim1>();
677 }
678 
679 template <>
681 DataForcesAndSourcesCore::EntData::getFTensor2N<3, 3>(
682  FieldApproximationBase base, const int gg, const int bb) {
683  double *t_n_ptr = &getN(base)(gg, 9 * bb);
685 
686  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
687 
688  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
689 
690  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
691 
692  );
693 }
694 
695 /**@}*/
696 
697 } // namespace MoFEM
boost::shared_ptr< MatrixDouble > N[LASTBASE]
Base functions.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Common.hpp:60
Multi-index containers, data structures for problems and other low-level functions.
Myltindex containers, data structures and other low-level functions.
Multi-index contains, for mofem entities data structures and other low-level functions.
Data structures for Meshset/Blocsk with material data.
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 VectorInt & getLocalIndices() const
get local indices of dofs on entity
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:459
static void constructor_data(DataForcesAndSourcesCore *data, const EntityType type)
Basic structures and data.
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2DiffN()
Get derivatives of base functions for Hdiv space.
Exception to catch.
Definition: Common.hpp:26
Tags for Multi-index containers.
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602
MoFEM interface.
MoFEMErrorCode setElementType(const EntityType type)
virtual MoFEMErrorCode setElementType(const EntityType type)
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. of columns is equal to number of base functions on this entity.
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.
boost::ptr_vector< EntData > dataOnEntities[MBMAXTYPE]
T data[Tensor_Dim]
Data structures for accessing information about finite element and its degrees of freedom...
virtual const MatrixDouble & getDiffN(const FieldApproximationBase base) const
get derivatives of base functions
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0FromVec< double, DoubleAllocator >(ublas::vector< double, DoubleAllocator > &data)
std::ostream & operator<<(std::ostream &os, const DataForcesAndSourcesCore::EntData &e)
Myltindex containes, data structures for mofem adjacencies and other low-level functions.
VectorDouble fieldData
Field data on entity.
Coordinate systems attached to DOFs.
FieldApproximationBase
approximation base
Definition: definitions.h:140
boost::shared_ptr< MatrixDouble > diffN[LASTBASE]
Derivatives of base functions.
const boost::shared_ptr< DataForcesAndSourcesCore > dataPtr
useful compiler directives and definitions
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Common.hpp:212
const VectorDouble & getFieldData() const
get dofs values
Multi-index contains, data structures for mofem finite elements and other low-level functions...
Multi-index containers, data boundary data structures and other low-level functions.
DataForcesAndSourcesCore::EntData EntData
ApproximationOrder getOrder() const
get approximation order
Derived ata on single entity (This is passed as argument to DataOperator::doWork) ...
Field data structure storing information about space, approximation base, coordinate systems...
Functions to approximate hierarchical spaces.
T data[Tensor_Dim0][Tensor_Dim1]
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN()
Get derivatives of base functions.
MoFEM interface.
Myltindex containers, for mofem fields data structures and other low-level functions.
Core interface class for user interface.
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Data on single entity (This is passed as argument to DataOperator::doWork)
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:403
static const double eps
std::bitset< LASTBASE > bAse
bases on element
MoFEM interface.
auto getFTensor1N()
Get base functions for Hdiv space.
this class derive data form other data structure
virtual int getSense() const
get entity sense, need to calculate base functions with conforming approximation fields ...
Tensors class implemented by Walter Landry.
Data structure with Cubit native blocks/meshet with boundary conditions.
Multi-Index contains, data structures for mofem dofs and other low-level functions.