46#ifndef __USER_DATA_OPERATORS_HPP__
47 #define __USER_DATA_OPERATORS_HPP__
73template <
class T,
class A>
88 boost::shared_ptr<ublas::vector<T, A>> data_ptr,
109 boost::shared_ptr<ublas::vector<T, A>> data_ptr,
116 THROW_MESSAGE(
"Cross-DM field evaluation requires OPROW or OPCOL");
123 boost::shared_ptr<ublas::vector<T, A>> data_ptr,
127 data_vec, zero_type) {}
138 boost::shared_ptr<ublas::vector<T, A>> data_ptr,
139 const EntityType zero_type = MBVERTEX)
155 boost::shared_ptr<ublas::vector<T, A>>
dataPtr;
166template <
class T,
class A>
205 vec.resize(nb_gauss_pts,
false);
232 "Cross-DM field evaluation requires OPROW or OPCOL");
235 for (
size_t i = 0;
i != field_dofs.size(); ++
i) {
237 dofs_by_uid->find(field_dofs[
i]->getLocalUniqueId());
239 (dof_it != dofs_by_uid->end())
240 ? array[(*dof_it)->getPetscLocalDofIdx()]
245 for (
size_t i = 0;
i != local_indices.size(); ++
i)
246 if (local_indices[
i] != -1)
255 const size_t nb_base_functions = data.
getN().size2();
258 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
261 for (; bb != nb_dofs; ++bb) {
262 values_at_gauss_pts += field_data * base_function;
267 for (; bb < nb_base_functions; ++bb)
269 ++values_at_gauss_pts;
292template <PetscData::DataContext CTX>
304 const std::string
field_name, boost::shared_ptr<VectorDouble> data_ptr,
305 const EntityType zero_at_type = MBVERTEX)
321 vec.resize(nb_gauss_pts,
false);
326 const size_t nb_dofs = local_indices.size();
331 auto get_array = [&](
const auto ctx,
auto vec) {
337 <<
"In this case field degrees of freedom are read from vector. "
338 "That usually happens when time solver is used, and acces to "
339 "first or second rates is needed. You probably not set ts_u, "
340 "ts_u_t, or ts_u_tt and associated data structure, i.e. "
341 "data_ctx to CTX_SET_X, CTX_SET_X_T, or CTX_SET_X_TT "
346 CHKERR VecGetArrayRead(vec, &array);
350 auto restore_array = [&](
auto vec) {
351 return VecRestoreArrayRead(vec, &array);
366 "That case is not implemented");
369 std::array<double, MAX_DOFS_ON_ENTITY> dot_dofs_vector;
370 for (
int i = 0;
i != local_indices.size(); ++
i)
371 if (local_indices[
i] != -1)
372 dot_dofs_vector[
i] = array[local_indices[
i]];
374 dot_dofs_vector[
i] = 0;
388 "That case is not implemented");
391 const size_t nb_base_functions = data.
getN().size2();
395 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
397 for (; bb != nb_dofs; ++bb) {
398 values_at_gauss_pts += dot_dofs_vector[bb] * base_function;
403 for (; bb < nb_base_functions; ++bb)
405 ++values_at_gauss_pts;
443template <
int Tensor_Dim,
typename M = MatrixDouble>
456 boost::shared_ptr<M> data_ptr,
457 const EntityType zero_type = MBVERTEX)
480template <
int Tensor_Dim,
typename M>
486 "Not implemented for matrix type = %s and dim = %d",
496template <
int Tensor_Dim>
501 boost::shared_ptr<MatrixDouble> data_ptr,
502 const EntityType zero_type = MBVERTEX,
503 const int max_order = -1)
512 boost::shared_ptr<MatrixDouble> data_ptr,
514 const EntityType zero_type = MBVERTEX,
515 const int max_order = -1)
519 maxOrder(max_order) {
527 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
529 const int max_order = -1)
531 dataPtr(data_ptr), dataVec(data_vec), dataDm(data_dm),
532 zeroType(zero_type), maxOrder(max_order) {
535 THROW_MESSAGE(
"Cross-DM field evaluation requires OPROW or OPCOL");
556template <
int Tensor_Dim>
562 const size_t nb_gauss_pts = getGaussPts().size2();
563 auto &mat = *dataPtr;
566 auto get_values_at_gauss_pts =
569 if (
type == zeroType) {
578 const auto max_size =
582 if (dataVec.use_count()) {
583 dotVector.resize(nb_dofs,
false);
585 CHKERR VecGetArrayRead(dataVec, &array);
590 switch (getOpType()) {
599 "Cross-DM field evaluation requires OPROW or OPCOL");
602 for (
size_t i = 0;
i != field_dofs.size(); ++
i) {
604 dofs_by_uid->find(field_dofs[
i]->getLocalUniqueId());
605 dotVector[
i] = (dof_it != dofs_by_uid->end())
606 ? array[(*dof_it)->getPetscLocalDofIdx()]
611 for (
size_t i = 0;
i != local_indices.size(); ++
i)
612 if (local_indices[
i] != -1)
613 dotVector[
i] = array[local_indices[
i]];
617 CHKERR VecRestoreArrayRead(dataVec, &array);
622 const size_t nb_base_functions = data.
getN().size2();
624 auto t_values_at_gauss_pts = get_values_at_gauss_pts();
626 const size_t size = nb_dofs / Tensor_Dim;
627 if (nb_dofs % Tensor_Dim) {
629 "Nb. of DOFs is inconsistent with Tensor_Dim");
631 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
635 if (field_data.l2() != field_data.l2()) {
636 MOFEM_LOG(
"SELF", Sev::error) <<
"field data: " << field_data;
638 "Wrong number in coefficients");
643 for (; bb !=
size; ++bb) {
647 if (base_function != base_function) {
648 MOFEM_LOG(
"SELF", Sev::error) <<
"base function: " << base_function;
650 "Wrong number number in base functions");
655 if (bb <= max_size) {
656 t_values_at_gauss_pts(
I) += field_data(
I) * base_function;
663 for (; bb < nb_base_functions; ++bb)
665 ++t_values_at_gauss_pts;
669 if (dataVec.use_count()) {
687template <
int Tensor_Dim>
692 Tensor_Dim>::OpCalculateVectorFieldValues_General;
711template <
int Tensor_Dim, CoordinateTypes COORDINATE_SYSTEM = CARTESIAN>
723 const std::string
field_name, boost::shared_ptr<VectorDouble> data_ptr,
724 const EntityType zero_type = MBVERTEX)
737 if constexpr (COORDINATE_SYSTEM ==
POLAR || COORDINATE_SYSTEM ==
SPHERICAL)
739 "%s coordiante not implemented",
745 vec.resize(nb_gauss_pts,
false);
753 const size_t nb_base_functions = data.
getN().size2();
756 const size_t size = nb_dofs / Tensor_Dim;
758 if (nb_dofs % Tensor_Dim) {
760 "Number of dofs should multiple of dimensions");
765 if constexpr (COORDINATE_SYSTEM ==
CARTESIAN) {
767 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
770 for (; bb !=
size; ++bb) {
771 values_at_gauss_pts += field_data(
I) * diff_base_function(
I);
773 ++diff_base_function;
777 for (; bb < nb_base_functions; ++bb)
778 ++diff_base_function;
779 ++values_at_gauss_pts;
789 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
792 for (; bb !=
size; ++bb) {
793 values_at_gauss_pts += field_data(
I) * diff_base_function(
I);
794 values_at_gauss_pts +=
795 base_function * (field_data(0) / t_coords(0));
798 ++diff_base_function;
802 for (; bb < nb_base_functions; ++bb) {
804 ++diff_base_function;
806 ++values_at_gauss_pts;
827template <
int Tensor_Dim, PetscData::DataContext CTX>
832 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
833 const EntityType zero_at_type = MBVERTEX,
bool throw_error =
true)
846 const size_t nb_dofs = local_indices.size();
851 auto get_values_at_gauss_pts =
853 DL>
::size(mat, nb_gauss_pts);
868 auto get_array = [&](
const auto ctx,
auto vec) {
874 <<
"In this case field degrees of freedom are read from vector. "
875 "That usually happens when time solver is used, and access to "
876 "first or second rates is needed. You probably not set ts_u, "
877 "ts_u_t, or ts_u_tt and associated data structure, i.e. "
878 "data_ctx to CTX_SET_X, CTX_SET_DX, CTX_SET_X_T, or "
879 "CTX_SET_X_TT respectively";
883 CHKERR VecGetArrayRead(vec, &array);
887 auto restore_array = [&](
auto vec) {
888 return VecRestoreArrayRead(vec, &array);
906 "That case is not implemented");
910 for (
int i = 0;
i != local_indices.size(); ++
i)
911 if (local_indices[
i] != -1)
931 "That case is not implemented");
934 const size_t nb_base_functions = data.
getN().size2();
936 auto t_values_at_gauss_pts = get_values_at_gauss_pts();
939 const size_t size = nb_dofs / Tensor_Dim;
940 if (nb_dofs % Tensor_Dim) {
943 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
944 auto field_data = getFTensor1FromArray<Tensor_Dim, Tensor_Dim>(
dotVector);
946 for (; bb !=
size; ++bb) {
947 t_values_at_gauss_pts(
I) += field_data(
I) * base_function;
953 for (; bb < nb_base_functions; ++bb)
955 ++t_values_at_gauss_pts;
972template <
int Tensor_Dim>
982template <
int Tensor_Dim>
992template <
int Tensor_Dim>
1006template <
int Tensor_Dim0,
int Tensor_Dim1,
typename M = MatrixDouble>
1012 boost::shared_ptr<M> data_ptr,
1013 const EntityType zero_type = MBVERTEX)
1029template <
int Tensor_Dim0,
int Tensor_Dim1,
typename M>
1035 "Not implemented for matrix type = %s, dim0 = %d and dim1 = %d",
1037 Tensor_Dim0, Tensor_Dim1);
1041template <
int Tensor_Dim0,
int Tensor_Dim1>
1048 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
1057 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
1058 const EntityType zero_type = MBVERTEX)
1064 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
1068 data_vec, zero_type) {}
1080template <
int Tensor_Dim0,
int Tensor_Dim1>
1088 const size_t nb_gauss_pts = data.
getN().size1();
1089 auto get_values_at_gauss_pts =
1091 DL>
::size(mat, nb_gauss_pts);
1092 if (
type == zeroType)
1097 if (dataVec.use_count()) {
1098 dotVector.resize(nb_dofs,
false);
1099 const double *array;
1100 CHKERR VecGetArrayRead(dataVec, &array);
1102 for (
int i = 0;
i != local_indices.size(); ++
i)
1103 if (local_indices[
i] != -1)
1104 dotVector[
i] = array[local_indices[
i]];
1107 CHKERR VecRestoreArrayRead(dataVec, &array);
1112 const size_t nb_base_functions = data.
getN().size2();
1114 auto t_values_at_gauss_pts = get_values_at_gauss_pts();
1117 const size_t size = nb_dofs / (Tensor_Dim0 * Tensor_Dim1);
1118 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
1121 for (; bb !=
size; ++bb) {
1122 t_values_at_gauss_pts(
i,
j) += field_data(
i,
j) * base_function;
1126 for (; bb < nb_base_functions; ++bb)
1128 ++t_values_at_gauss_pts;
1131 if (dataVec.use_count()) {
1143template <
int Tensor_Dim0,
int Tensor_Dim1>
1149 Tensor_Dim0, Tensor_Dim1>::OpCalculateTensor2FieldValues_General;
1157template <
int Tensor_Dim0,
int Tensor_Dim1>
1162 boost::shared_ptr<MatrixDouble> data_ptr,
1163 const EntityType zero_at_type = MBVERTEX)
1176 const size_t nb_gauss_pts =
getGaussPts().size2();
1178 auto get_values_at_gauss_pts =
1181 DL>
::size(mat, nb_gauss_pts);
1185 const size_t nb_dofs = local_indices.size();
1188 const double *array;
1190 for (
size_t i = 0;
i != local_indices.size(); ++
i)
1191 if (local_indices[
i] != -1)
1197 const size_t nb_base_functions = data.
getN().size2();
1200 auto t_values_at_gauss_pts = get_values_at_gauss_pts();
1203 const size_t size = nb_dofs / (Tensor_Dim0 * Tensor_Dim1);
1204 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
1206 getFTensor2FromPtr<Tensor_Dim0, Tensor_Dim1>(&*
dotVector.begin());
1208 for (; bb !=
size; ++bb) {
1209 t_values_at_gauss_pts(
i,
j) += field_data(
i,
j) * base_function;
1213 for (; bb < nb_base_functions; ++bb)
1215 ++t_values_at_gauss_pts;
1234template <
int Tensor_Dim>
1239 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
1240 const EntityType zero_type = MBEDGE,
const int zero_side = 0)
1249 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
1251 const int zero_side = 0)
1263 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
1265 const int zero_side = 0)
1271 THROW_MESSAGE(
"Cross-DM field evaluation requires OPROW or OPCOL");
1282 auto get_values_at_gauss_pts =
1284 DL>
::size(mat, nb_gauss_pts);
1294 const double *array;
1309 "Cross-DM field evaluation requires OPROW or OPCOL");
1312 for (
int i = 0;
i != field_dofs.size(); ++
i) {
1314 dofs_by_uid->find(field_dofs[
i]->getLocalUniqueId());
1315 dotVector[
i] = (dof_it != dofs_by_uid->end())
1316 ? array[(*dof_it)->getPetscLocalDofIdx()]
1321 for (
int i = 0;
i != local_indices.size(); ++
i)
1322 if (local_indices[
i] != -1)
1331 const int nb_base_functions = data.
getN().size2();
1333 auto t_values_at_gauss_pts = get_values_at_gauss_pts();
1336 const int size = nb_dofs / ((Tensor_Dim * (Tensor_Dim + 1)) / 2);
1337 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
1340 for (; bb !=
size; ++bb) {
1341 t_values_at_gauss_pts(
i,
j) += field_data(
i,
j) * base_function;
1345 for (; bb < nb_base_functions; ++bb)
1347 ++t_values_at_gauss_pts;
1373 static const auto t_basis = [] {
1377 t_basis(
i,
j,
A) = 0.;
1378 constexpr double inverse_sqrt_two = 0.70710678118654752440;
1379 constexpr double inverse_sqrt_six = 0.40824829046386301637;
1380 t_basis(0, 0, 0) = inverse_sqrt_two;
1381 t_basis(1, 1, 0) = -inverse_sqrt_two;
1382 t_basis(0, 0, 1) = inverse_sqrt_six;
1383 t_basis(1, 1, 1) = inverse_sqrt_six;
1384 t_basis(2, 2, 1) = -2. * inverse_sqrt_six;
1385 t_basis(0, 1, 2) = inverse_sqrt_two;
1386 t_basis(0, 2, 3) = inverse_sqrt_two;
1387 t_basis(1, 2, 4) = inverse_sqrt_two;
1394 template <
typename T,
int Size>
1397 const double theta = 0.) {
1398 static_assert(Size == 3 || Size == 5,
"Expected three or five coordinates");
1405 t_basis(
i,
j,
A) * t_coordinates(
A) + (theta / 3.) * t_identity(
i,
j);
1410 template <
typename Tensor>
1416 t_coordinates(
A) = t_basis(
i,
j,
A) * t_tensor(
i,
j);
1417 return t_coordinates;
1427template <
int CoordinateSize>
1430 static_assert(CoordinateSize == 3 || CoordinateSize == 5,
1431 "Expected three or five deviator coordinates");
1437 const EntityType zero_type = MBEDGE,
const int zero_side = 0)
1446 data_vec, MBMAXTYPE),
1460 data_vec, MBMAXTYPE),
1470 const int nb_gauss_pts = this->
getGaussPts().size2();
1474 *this->
dataPtr, nb_gauss_pts);
1479 auto get_coordinates =
1481 *this->
dataPtr, nb_gauss_pts);
1485 auto t_coordinates = get_coordinates();
1486 auto t_tensor = get_tensor();
1488 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
1490 t_tensor(
i,
j) = t_deviator(
i,
j);
1514 3>::OpCalculateTensor2SymmetricDeviatorFieldValues_General;
1522 5>::OpCalculateTensor2SymmetricDeviatorFieldValues_General;
1532template <
int Tensor_Dim>
1537 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
1538 const EntityType zero_type = MBEDGE,
const int zero_side = 0)
1551 constexpr auto symm_size = (Tensor_Dim * (Tensor_Dim + 1)) / 2;
1553 auto get_values_at_gauss_pts =
1555 DL>
::size(mat, nb_gauss_pts);
1560 const int nb_dofs = local_indices.size();
1568 <<
"In this case field degrees of freedom are read from vector. "
1569 "That usually happens when time solver is used, and acces to "
1570 "first rates is needed. You probably not set "
1571 "ts_u_t and associated data structure data_ctx to CTX_SET_X_T "
1578 const double *array;
1580 for (
int i = 0;
i != local_indices.size(); ++
i)
1581 if (local_indices[
i] != -1)
1587 const int nb_base_functions = data.
getN().size2();
1590 auto t_values_at_gauss_pts = get_values_at_gauss_pts();
1593 const int size = nb_dofs / symm_size;
1594 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
1595 auto field_data = getFTensorDotData<Tensor_Dim>();
1597 for (; bb !=
size; ++bb) {
1598 t_values_at_gauss_pts(
i,
j) += field_data(
i,
j) * base_function;
1602 for (; bb < nb_base_functions; ++bb)
1604 ++t_values_at_gauss_pts;
1617 static_assert(Dim || !Dim,
"not implemented");
1626 &dotVector[0], &dotVector[1], &dotVector[2], &dotVector[3], &dotVector[4],
1635 &dotVector[0], &dotVector[1], &dotVector[2]);
1649template <
int Tensor_Dim,
typename M = MatrixDouble>
1654 Tensor_Dim,
M>::OpCalculateVectorFieldValues_General;
1661template <
int Tensor_Dim>
1666 Tensor_Dim,
MatrixDouble>::OpCalculateVectorFieldValues_General;
1684template <
int Tensor_Dim>
1690 const size_t nb_gauss_pts = this->getGaussPts().size2();
1691 auto &mat = *this->dataPtr;
1693 auto get_gradients_at_pts =
1695 DL>
::size(mat, nb_gauss_pts);
1696 if (
type == this->zeroType) {
1703 if (this->dataVec.use_count()) {
1704 this->dotVector.resize(nb_dofs,
false);
1707 this->dotVector.clear();
1708 const double *array;
1709 CHKERR VecGetArrayRead(this->dataVec, &array);
1711 for (
int i = 0;
i != local_indices.size(); ++
i)
1712 if (local_indices[
i] != -1)
1713 this->dotVector[
i] = array[local_indices[
i]];
1715 this->dotVector[
i] = 0;
1716 CHKERR VecRestoreArrayRead(this->dataVec, &array);
1721 const int nb_base_functions = data.
getN().size2();
1723 auto t_gradients_at_pts = get_gradients_at_pts();
1726 if (nb_dofs > nb_base_functions)
1728 "Number of base functions inconsistent with number of DOFs "
1730 nb_dofs, nb_base_functions);
1732 if (data.
getDiffN().size2() != nb_base_functions * Tensor_Dim)
1735 "Number of base functions inconsistent with number of derivatives "
1737 data.
getDiffN().size2(), nb_base_functions);
1739 if (data.
getDiffN().size1() != nb_gauss_pts)
1742 "Number of base functions inconsistent with number of integration "
1744 data.
getDiffN().size1(), nb_gauss_pts);
1749 for (
int gg = 0; gg < nb_gauss_pts; ++gg) {
1752 for (; bb != nb_dofs; ++bb) {
1753 t_gradients_at_pts(
I) += field_data * diff_base_function(
I);
1755 ++diff_base_function;
1758 for (; bb < nb_base_functions; ++bb)
1759 ++diff_base_function;
1760 ++t_gradients_at_pts;
1764 if (this->dataVec.use_count()) {
1777template <
int Tensor_Dim>
1781 Tensor_Dim>::OpCalculateScalarFieldGradient_General;
1788template <
int Tensor_Dim>
1793 Tensor_Dim>::OpCalculateVectorFieldValues_General;
1806template <
int Tensor_Dim>
1811 const size_t nb_gauss_pts = this->getGaussPts().size2();
1813 auto &mat = *this->dataPtr;
1814 auto get_hessian_at_gauss_pts =
1816 DL>
::size(mat, nb_gauss_pts);
1817 if (
type == this->zeroType)
1824 const int nb_base_functions = data.
getN().size2();
1826 auto &hessian_base = data.
getN(BaseDerivatives::SecondDerivative);
1828 if (hessian_base.size1() != nb_gauss_pts) {
1830 "Wrong number of integration pts (%ld != %ld)",
1831 static_cast<long>(hessian_base.size1()),
1832 static_cast<long>(nb_gauss_pts));
1834 if (hessian_base.size2() != nb_base_functions * Tensor_Dim * Tensor_Dim) {
1836 "Wrong number of base functions (%ld != %ld)",
1837 static_cast<long>(hessian_base.size2() /
1838 (Tensor_Dim * Tensor_Dim)),
1839 static_cast<long>(nb_base_functions));
1841 if (hessian_base.size2() < nb_dofs * Tensor_Dim * Tensor_Dim) {
1843 "Wrong number of base functions (%ld < %ld)",
1844 static_cast<long>(hessian_base.size2()),
1845 static_cast<long>(nb_dofs * Tensor_Dim * Tensor_Dim));
1849 auto t_diff2_base_function = getFTensor2FromPtr<Tensor_Dim, Tensor_Dim>(
1850 &*hessian_base.data().begin());
1852 auto t_hessian_at_gauss_pts = get_hessian_at_gauss_pts();
1856 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
1859 for (; bb != nb_dofs; ++bb) {
1860 t_hessian_at_gauss_pts(
I,
J) +=
1861 field_data * t_diff2_base_function(
I,
J);
1863 ++t_diff2_base_function;
1866 for (; bb < nb_base_functions; ++bb) {
1867 ++t_diff2_base_function;
1870 ++t_hessian_at_gauss_pts;
1894template <
int Tensor_Dim0,
int Tensor_Dim1,
int S,
1901 Tensor_Dim0, Tensor_Dim1,
M>::OpCalculateTensor2FieldValues_General;
1904template <
int Tensor_Dim0,
int Tensor_Dim1,
int S>
1908 Tensor_Dim0, Tensor_Dim1, MatrixDouble> {
1911 Tensor_Dim0, Tensor_Dim1,
MatrixDouble>::OpCalculateTensor2FieldValues_General;
1929template <
int Tensor_Dim0,
int Tensor_Dim1,
int S>
1936 "Data pointer not allocated");
1938 const size_t nb_gauss_pts = this->getGaussPts().size2();
1940 auto &mat = *this->dataPtr;
1941 auto get_gradients_at_pts =
1944 DL>
::size(mat, nb_gauss_pts);
1945 if (
type == this->zeroType)
1953 if (this->dataVec.use_count()) {
1954 this->dotVector.resize(nb_dofs,
false);
1955 const double *array;
1956 CHKERR VecGetArrayRead(this->dataVec, &array);
1958 for (
int i = 0;
i != local_indices.size(); ++
i)
1959 if (local_indices[
i] != -1)
1960 this->dotVector[
i] = array[local_indices[
i]];
1962 this->dotVector[
i] = 0;
1963 CHKERR VecRestoreArrayRead(this->dataVec, &array);
1967 const int nb_base_functions = data.
getN().size2();
1969 auto t_gradients_at_pts = get_gradients_at_pts();
1972 int size = nb_dofs / Tensor_Dim0;
1973 if (nb_dofs % Tensor_Dim0) {
1975 "Data inconsistency");
1977 for (
int gg = 0; gg < nb_gauss_pts; ++gg) {
1978 auto field_data = getFTensor1FromPtr<Tensor_Dim0, S>(
1982 if (field_data.l2() != field_data.l2()) {
1983 MOFEM_LOG(
"SELF", Sev::error) <<
"field data " << field_data;
1985 "Wrong number in coefficients");
1990 for (; bb <
size; ++bb) {
1993 if (diff_base_function.l2() != diff_base_function.l2()) {
1995 <<
"diff_base_function: " << diff_base_function;
1997 "Wrong number number in base functions");
2002 t_gradients_at_pts(
I,
J) += field_data(
I) * diff_base_function(
J);
2004 ++diff_base_function;
2008 for (; bb != nb_base_functions; ++bb)
2009 ++diff_base_function;
2010 ++t_gradients_at_pts;
2013 if (this->dataVec.use_count()) {
2030template <
int Tensor_Dim0,
int Tensor_Dim1,
int S = Tensor_Dim0>
2036 Tensor_Dim0, Tensor_Dim1, S>::OpCalculateVectorFieldGradient_General;
2044template <
int Tensor_Dim0,
int Tensor_Dim1>
2049 boost::shared_ptr<MatrixDouble> data_ptr,
2050 const EntityType zero_at_type = MBVERTEX)
2063 const int nb_dofs = local_indices.size();
2064 const int nb_gauss_pts = this->
getGaussPts().size2();
2068 auto get_gradients_at_pts =
2071 DL>
::size(mat, nb_gauss_pts);
2078 const double *array;
2080 for (
int i = 0;
i != local_indices.size(); ++
i)
2081 if (local_indices[
i] != -1)
2087 const int nb_base_functions = data.
getN().size2();
2089 auto t_gradients_at_pts = get_gradients_at_pts();
2092 int size = nb_dofs / Tensor_Dim0;
2093 if (nb_dofs % Tensor_Dim0) {
2097 for (
int gg = 0; gg < nb_gauss_pts; ++gg) {
2098 auto field_data = getFTensor1FromPtr<Tensor_Dim0>(&*
dotVector.begin());
2100 for (; bb <
size; ++bb) {
2101 t_gradients_at_pts(
I,
J) += field_data(
I) * diff_base_function(
J);
2103 ++diff_base_function;
2107 for (; bb != nb_base_functions; ++bb)
2108 ++diff_base_function;
2109 ++t_gradients_at_pts;
2125template <
int Tensor_Dim0,
int Tensor_Dim1,
typename M = MatrixDouble>
2131 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
2132 const EntityType zero_type = MBVERTEX)
2137template <
int Tensor_Dim0,
int Tensor_Dim1>
2142 Tensor_Dim0, Tensor_Dim1, MatrixDouble> {
2145 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
2146 const EntityType zero_type = MBVERTEX)
2167template <
int Tensor_Dim0,
int Tensor_Dim1>
2174 "Data pointer not allocated");
2176 const size_t nb_gauss_pts = this->getGaussPts().size2();
2177 constexpr size_t msize = (Tensor_Dim0 * (Tensor_Dim0 + 1)) / 2;
2178 auto &mat = *this->dataPtr;
2179 if (
type == this->zeroType) {
2180 mat.resize(msize * Tensor_Dim1, nb_gauss_pts,
false);
2189 const int nb_base_functions = data.
getN().size2();
2191 auto gradients_at_pts =
2197 int size = nb_dofs / msize;
2198 if (nb_dofs % msize) {
2200 "Data inconsistency");
2202 for (
int gg = 0; gg < nb_gauss_pts; ++gg) {
2205 for (; bb <
size; ++bb) {
2206 gradients_at_pts(
I,
J,
K) +=
2207 field_data(
I,
J) * diff_base_function(
K);
2209 ++diff_base_function;
2213 for (; bb != nb_base_functions; ++bb)
2214 ++diff_base_function;
2227template <
int Tensor_Dim0,
int Tensor_Dim1>
2230 Tensor_Dim0, Tensor_Dim1> {
2233 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
2234 const EntityType zero_type = MBVERTEX)
2236 Tensor_Dim0, Tensor_Dim1>(
field_name, data_ptr, zero_type) {}
2239template <
int Tensor_Dim0,
int Tensor_Dim1>
2245 Tensor_Dim0, Tensor_Dim1>::OpCalculateTensor2FieldValues_General;
2263template <
int Tensor_Dim0,
int Tensor_Dim1>
2269 "Data pointer not allocated");
2271 const size_t nb_gauss_pts = this->getGaussPts().size2();
2272 auto &mat = *this->dataPtr;
2276 DL>
::size(mat, nb_gauss_pts);
2277 if (
type == this->zeroType) {
2286 if (this->dataVec.use_count()) {
2287 this->dotVector.resize(nb_dofs,
false);
2288 const double *array;
2289 CHKERR VecGetArrayRead(this->dataVec, &array);
2291 for (
int i = 0;
i != local_indices.size(); ++
i)
2292 if (local_indices[
i] != -1)
2293 this->dotVector[
i] = array[local_indices[
i]];
2295 this->dotVector[
i] = 0;
2296 CHKERR VecRestoreArrayRead(this->dataVec, &array);
2300 const int nb_base_functions = data.
getN().size2();
2302 auto &hessian_base = data.
getN(BaseDerivatives::SecondDerivative);
2304 if (hessian_base.size1() != nb_gauss_pts) {
2306 "Wrong number of integration pts (%ld != %ld)",
2307 static_cast<long>(hessian_base.size1()),
2308 static_cast<long>(nb_gauss_pts));
2310 if (hessian_base.size2() !=
2311 nb_base_functions * Tensor_Dim1 * Tensor_Dim1) {
2313 "Wrong number of base functions (%ld != %ld)",
2314 static_cast<long>(hessian_base.size2() /
2315 (Tensor_Dim1 * Tensor_Dim1)),
2316 static_cast<long>(nb_base_functions));
2318 if (hessian_base.size2() <
2319 (nb_dofs / Tensor_Dim0) * Tensor_Dim1 * Tensor_Dim1) {
2321 "Wrong number of base functions (%ld < %ld)",
2322 static_cast<long>(hessian_base.size2()),
2323 static_cast<long>((nb_dofs / Tensor_Dim0) * Tensor_Dim1 *
2328 auto t_diff2_base_function = getFTensor2FromPtr<Tensor_Dim1, Tensor_Dim1>(
2329 &*hessian_base.data().begin());
2331 auto t_hessian_at_gauss_pts = get_hessian_at_gauss_pts();
2337 int size = nb_dofs / Tensor_Dim0;
2339 if (nb_dofs % Tensor_Dim0) {
2341 "Data inconsistency");
2345 for (
int gg = 0; gg < nb_gauss_pts; ++gg) {
2348 for (; bb <
size; ++bb) {
2349 t_hessian_at_gauss_pts(
I,
J,
K) +=
2350 field_data(
I) * t_diff2_base_function(
J,
K);
2352 ++t_diff2_base_function;
2356 for (; bb != nb_base_functions; ++bb)
2357 ++t_diff2_base_function;
2358 ++t_hessian_at_gauss_pts;
2361 if (this->dataVec.use_count()) {
2383template <
int DIM_01,
int DIM_23,
int S = 0>
2395 boost::shared_ptr<MatrixDouble> in_mat,
2396 boost::shared_ptr<MatrixDouble> out_mat,
2397 boost::shared_ptr<MatrixDouble> d_mat)
2410 boost::shared_ptr<MatrixDouble> out_mat,
2411 boost::shared_ptr<MatrixDouble> d_mat)
2424 const size_t nb_gauss_pts =
getGaussPts().size2();
2428 DL>::get(*
dMat, nb_gauss_pts);
2429 auto get_in_at_pts =
2431 DL>::get(*
inMat, nb_gauss_pts);
2432 auto get_out_at_pts =
2435 auto t_D_at_pts = get_D_at_pts();
2436 auto t_in_at_pts = get_in_at_pts();
2437 auto t_out_at_pts = get_out_at_pts();
2438 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
2439 t_out_at_pts(
i,
j) = t_D_at_pts(
i,
j,
k,
l) * t_in_at_pts(
k,
l);
2455 boost::shared_ptr<MatrixDouble>
dMat;
2478 boost::shared_ptr<MatrixDouble> in_mat,
2479 boost::shared_ptr<MatrixDouble> out_mat)
2496 boost::shared_ptr<MatrixDouble> out_mat)
2507 const size_t nb_gauss_pts =
getGaussPts().size2();
2509 auto get_in_at_pts =
2511 *
inMat, nb_gauss_pts);
2512 auto t_in_at_pts = get_in_at_pts();
2513 auto get_out_at_pts =
2516 auto t_out_at_pts = get_out_at_pts();
2517 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
2518 t_out_at_pts(
i,
j) = (t_in_at_pts(
i,
j) || t_in_at_pts(
j,
i)) / 2;
2549 boost::shared_ptr<MatrixDouble> in_mat,
2550 boost::shared_ptr<MatrixDouble> out_mat)
2569 boost::shared_ptr<MatrixDouble> in_mat,
2570 boost::shared_ptr<MatrixDouble> out_mat)
2584 noalias(*
outMat) = (*scalePtr) * (*inMat);
2603template <
int Base_Dim,
int Field_Dim,
typename M = MatrixDouble>
2609template <
int Field_Dim>
2614 boost::shared_ptr<MatrixDouble> data_ptr,
2616 const EntityType zero_type = MBEDGE,
2617 const int zero_side = 0)
2620 dataPtr(data_ptr), dataVec(data_vec), zeroType(zero_type),
2621 zeroSide(zero_side) {
2627 boost::shared_ptr<MatrixDouble> data_ptr,
2628 const EntityType zero_type = MBEDGE,
2629 const int zero_side = 0)
2651template <
int Field_Dim>
2656 const size_t nb_integration_points = this->getGaussPts().size2();
2657 auto &mat = *dataPtr;
2659 auto get_data_at_pts =
2661 DL>
::size(mat, nb_integration_points);
2662 if (
type == zeroType && side == zeroSide) {
2669 if (dataVec.use_count()) {
2670 dotVector.resize(nb_dofs,
false);
2671 const double *array;
2672 CHKERR VecGetArrayRead(dataVec, &array);
2674 for (
int i = 0;
i != local_indices.size(); ++
i)
2675 if (local_indices[
i] != -1)
2676 dotVector[
i] = array[local_indices[
i]];
2679 CHKERR VecRestoreArrayRead(dataVec, &array);
2683 const size_t nb_base_functions = data.
getN().size2() / 3;
2686 auto t_data_at_pts = get_data_at_pts();
2687 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
2690 for (; bb != nb_dofs; ++bb) {
2691 t_data_at_pts(
i) += t_n_hdiv(
i) * t_dof;
2695 for (; bb != nb_base_functions; ++bb)
2700 if (dataVec.use_count()) {
2710template <
int Base_Dim,
int Field_Dim = Base_Dim>
2714 Base_Dim, Field_Dim>::OpCalculateHVecVectorField_General;
2720template <
int Base_Dim,
int Field_Dim = Base_Dim>
2723template <
int Field_Dim>
2728 boost::shared_ptr<MatrixDouble> data_ptr,
2729 const EntityType zero_type = MBEDGE,
2730 const int zero_side = 0)
2733 dataPtr(data_ptr), zeroType(zero_type), zeroSide(zero_side) {
2754template <
int Field_Dim>
2759 const size_t nb_integration_points = this->getGaussPts().size2();
2760 auto &mat = *dataPtr;
2762 auto get_data_at_pts =
2764 DL>
::size(mat, nb_integration_points);
2765 if (
type == zeroType && side == zeroSide) {
2770 const size_t nb_dofs = local_indices.size();
2773 std::array<double, MAX_DOFS_ON_ENTITY> dot_dofs_vector;
2774 const double *array;
2775 CHKERR VecGetArrayRead(getFEMethod()->ts_u_t, &array);
2776 for (
size_t i = 0;
i != nb_dofs; ++
i)
2777 if (local_indices[
i] != -1)
2778 dot_dofs_vector[
i] = array[local_indices[
i]];
2780 dot_dofs_vector[
i] = 0;
2781 CHKERR VecRestoreArrayRead(getFEMethod()->ts_u_t, &array);
2783 const size_t nb_base_functions = data.
getN().size2() / 3;
2786 auto t_data_at_pts = get_data_at_pts();
2787 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
2789 for (; bb != nb_dofs; ++bb) {
2790 t_data_at_pts(
i) += t_n_hdiv(
i) * dot_dofs_vector[bb];
2793 for (; bb != nb_base_functions; ++bb)
2809template <
int BASE_DIM,
int SPACE_DIM>
2814 boost::shared_ptr<VectorDouble> data_ptr,
2815 const EntityType zero_type = MBEDGE,
2816 const int zero_side = 0)
2827 const size_t nb_integration_points =
getGaussPts().size2();
2829 dataPtr->resize(nb_integration_points,
false);
2835 const size_t nb_base_functions = data.
getN().size2() /
BASE_DIM;
2840 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
2843 for (; bb != nb_dofs; ++bb) {
2844 t_data += t_dof * t_n_diff_hdiv(
j,
j);
2848 for (; bb != nb_base_functions; ++bb)
2868template <
int BASE_DIM,
int SPACE_DIM>
2873 boost::shared_ptr<MatrixDouble> data_ptr,
2874 const EntityType zero_type = MBEDGE,
2875 const int zero_side = 0)
2886 const size_t nb_integration_points =
getGaussPts().size2();
2888 auto get_data_at_pts =
2897 const size_t nb_base_functions = data.
getN().size2() /
BASE_DIM;
2901 auto t_data_at_pts = get_data_at_pts();
2902 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
2905 for (; bb != nb_dofs; ++bb) {
2906 t_data_at_pts(
i,
j) += t_dof * t_base_diff(
i,
j);
2910 for (; bb != nb_base_functions; ++bb)
2931template <
int BASE_DIM,
int FIELD_DIM,
int SPACE_DIM>
2944 boost::shared_ptr<MatrixDouble> data_ptr,
2945 const EntityType zero_type = MBEDGE,
2946 const int zero_side = 0)
2949 dataPtr(data_ptr), zeroType(zero_type), zeroSide(zero_side) {
2958 const size_t nb_integration_points = getGaussPts().size2();
2960 auto get_data_at_pts =
2962 DL>
::size(*dataPtr, nb_integration_points);
2963 if (
type == zeroType && side == zeroSide) {
2971 "Data inconsistency, nb_dofs %% COEFF_DIM != 0, that is %ld %% %d "
2981 const size_t nb_base_functions = data.
getN().size2() / 3;
2987 auto t_data_at_pts = get_data_at_pts();
2988 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
2991 for (; bb != nb_dofs; ++bb) {
2992 t_data_at_pts(
k,
i,
j) += t_base_diff(
i,
j) * t_dof(
k);
2996 for (; bb != nb_base_functions; ++bb)
3014 boost::shared_ptr<MatrixDouble> data_ptr,
3015 const EntityType zero_type = MBEDGE,
3016 const int zero_side = 0)
3019 dataPtr(data_ptr), zeroType(zero_type), zeroSide(zero_side) {
3028 const size_t nb_integration_points = getGaussPts().size2();
3030 auto get_data_at_pts =
3032 DL>
::size(*dataPtr, nb_integration_points);
3033 if (
type == zeroType && side == zeroSide) {
3041 const size_t nb_base_functions = data.
getN().size2() / 9;
3044 if (data.
getDiffN().size1() != nb_integration_points) {
3046 "Wrong number of integration pts (%ld != %ld)",
3047 static_cast<long>(data.
getDiffN().size1()),
3048 static_cast<long>(nb_integration_points));
3050 if (data.
getDiffN().size2() != nb_base_functions * 27) {
3052 "Wrong number of base functions (%ld != %ld)",
3053 static_cast<long>(data.
getDiffN().size2() / 27),
3054 static_cast<long>(nb_base_functions));
3056 if (nb_base_functions < nb_dofs) {
3058 "Wrong number of base functions (%ld < %ld)",
3059 static_cast<long>(nb_base_functions),
3060 static_cast<long>(nb_dofs));
3069 auto t_data_at_pts = get_data_at_pts();
3070 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
3073 for (; bb != nb_dofs; ++bb) {
3074 t_data_at_pts(
k,
i,
j) += t_base_diff(
k,
i,
j) * t_dof;
3078 for (; bb != nb_base_functions; ++bb)
3099template <
int BASE_DIM,
int SPACE_DIM>
3104 boost::shared_ptr<MatrixDouble> data_ptr,
3105 const EntityType zero_type = MBEDGE,
3106 const int zero_side = 0)
3117 const size_t nb_integration_points =
getGaussPts().size2();
3129 const int nb_base_functions = data.
getN().size2() /
BASE_DIM;
3132 auto &hessian_base = data.
getN(BaseDerivatives::SecondDerivative);
3133 if (hessian_base.size1() != nb_integration_points) {
3135 "Wrong number of integration pts (%ld != %ld)",
3136 static_cast<long>(hessian_base.size1()),
3137 static_cast<long>(nb_integration_points));
3139 if (hessian_base.size2() !=
3142 "Wrong number of base functions (%ld != %ld)",
3143 static_cast<long>(hessian_base.size2() /
3145 static_cast<long>(nb_base_functions));
3149 "Wrong number of base functions (%ld < %ld)",
3150 static_cast<long>(hessian_base.size2()),
3161 auto t_data_at_pts = get_data_at_pts();
3162 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
3165 for (; bb != nb_dofs; ++bb) {
3166 t_data_at_pts(
i,
j,
k) += t_dof * t_base_diff2(
i,
j,
k);
3171 for (; bb != nb_base_functions; ++bb)
3190template <
int Tensor_Dim1,
int Tensor_Dim2>
3195 boost::shared_ptr<VectorDouble> data_ptr,
3196 const EntityType zero_type = MBEDGE,
3197 const int zero_side = 0)
3208 const size_t nb_integration_points =
getGaussPts().size2();
3210 dataPtr->resize(nb_integration_points,
false);
3215 const int nb_dofs = local_indices.size();
3218 std::array<double, MAX_DOFS_ON_ENTITY> dot_dofs_vector;
3219 const double *array;
3221 for (
size_t i = 0;
i != local_indices.size(); ++
i)
3222 if (local_indices[
i] != -1)
3223 dot_dofs_vector[
i] = array[local_indices[
i]];
3225 dot_dofs_vector[
i] = 0;
3228 const size_t nb_base_functions = data.
getN().size2() / Tensor_Dim1;
3232 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
3234 for (; bb != nb_dofs; ++bb) {
3236 for (
auto ii = 0; ii != Tensor_Dim2; ++ii)
3237 div += t_n_diff_hdiv(ii, ii);
3238 t_data += dot_dofs_vector[bb] * div;
3241 for (; bb != nb_base_functions; ++bb)
3277 boost::shared_ptr<MatrixDouble> data_ptr,
3278 const EntityType zero_type = MBEDGE,
3279 const int zero_side = 0);
3301 boost::shared_ptr<MatrixDouble> data_ptr,
3302 const EntityType zero_type = MBVERTEX,
3303 const int zero_side = 0);
3326 boost::shared_ptr<MatrixDouble> data_ptr,
3327 const EntityType zero_type = MBVERTEX,
3328 const int zero_side = 0);
3346template <
int Tensor_Dim0,
int Tensor_Dim1>
3351 boost::shared_ptr<MatrixDouble> data_ptr,
3352 boost::shared_ptr<double> scale_ptr,
3354 const EntityType zero_type = MBEDGE,
3355 const int zero_side = 0)
3365 boost::shared_ptr<MatrixDouble> data_ptr,
3366 const EntityType zero_type = MBEDGE,
3367 const int zero_side = 0)
3375 const size_t nb_integration_points =
getGaussPts().size2();
3377 auto get_data_at_pts =
3388 const double *array;
3391 for (
int i = 0;
i != local_indices.size(); ++
i)
3392 if (local_indices[
i] != -1)
3401 const size_t nb_base_functions = data.
getN().size2() / 3;
3405 auto t_data_at_pts = get_data_at_pts();
3406 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
3409 for (; bb != nb_dofs / Tensor_Dim0; ++bb) {
3410 t_data_at_pts(
i,
j) += (
scale * t_dof(
i)) * t_n_hvec(
j);
3414 for (; bb < nb_base_functions; ++bb)
3442template <
int Tensor_Dim0,
int Tensor_Dim1, PetscData::DataContext CTX>
3447 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
3448 const EntityType zero_type = MBEDGE,
const int zero_side = 0)
3460 const size_t nb_integration_points =
getGaussPts().size2();
3462 auto get_data_at_pts =
3470 const size_t nb_dofs = local_indices.size();
3474 const double *array;
3476 auto get_array = [&](
const auto ctx,
auto vec) {
3482 <<
"In this case field degrees of freedom are read from vector. "
3483 "That usually happens when time solver is used, and access to "
3484 "first or second rates is needed. You probably not set ts_u, "
3485 "ts_u_t, or ts_u_tt and associated data structure, i.e. "
3486 "data_ctx to CTX_SET_X, CTX_SET_DX, CTX_SET_X_T, or "
3487 "CTX_SET_X_TT respectively";
3491 CHKERR VecGetArrayRead(vec, &array);
3495 auto restore_array = [&](
auto vec) {
3496 return VecRestoreArrayRead(vec, &array);
3514 "That case is not implemented");
3517 dotVector.resize(local_indices.size(),
false);
3518 for (
int i = 0;
i != local_indices.size(); ++
i)
3519 if (local_indices[
i] != -1)
3539 "That case is not implemented");
3542 const size_t nb_base_functions = data.
getN().size2() / 3;
3546 auto t_data_at_pts = get_data_at_pts();
3547 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
3548 auto t_dof = getFTensor1FromArray<Tensor_Dim0, Tensor_Dim0>(
dotVector);
3550 for (; bb != nb_dofs / Tensor_Dim0; ++bb) {
3551 t_data_at_pts(
i,
j) += t_dof(
i) * t_n_hvec(
j);
3555 for (; bb < nb_base_functions; ++bb)
3571template <
int Tensor_Dim0,
int Tensor_Dim1>
3584template <
int Tensor_Dim0,
int Tensor_Dim1, PetscData::DataContext CTX>
3589 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
3590 const EntityType zero_type = MBEDGE,
const int zero_side = 0,
3591 bool throw_error =
true)
3604 const size_t nb_integration_points =
getGaussPts().size2();
3606 auto get_data_at_pts =
3614 const size_t nb_dofs = local_indices.size();
3624 const double *array;
3626 auto get_array = [&](
const auto ctx,
auto vec) {
3632 <<
"In this case field degrees of freedom are read from vector. "
3633 "That usually happens when time solver is used, and access to "
3634 "first or second rates is needed. You probably not set ts_u, "
3635 "ts_u_t, or ts_u_tt and associated data structure, i.e. "
3636 "data_ctx to CTX_SET_X, CTX_SET_DX, CTX_SET_X_T, or "
3637 "CTX_SET_X_TT respectively";
3641 CHKERR VecGetArrayRead(vec, &array);
3645 auto restore_array = [&](
auto vec) {
3646 return VecRestoreArrayRead(vec, &array);
3664 "That case is not implemented");
3667 dotVector.resize(local_indices.size(),
false);
3668 for (
int i = 0;
i != local_indices.size(); ++
i)
3669 if (local_indices[
i] != -1)
3689 "That case is not implemented");
3692 const size_t nb_base_functions =
3693 data.
getN().size2() / (Tensor_Dim0 * Tensor_Dim1);
3696 auto t_n_hten = data.
getFTensor2N<Tensor_Dim0, Tensor_Dim1>();
3697 auto t_data_at_pts = get_data_at_pts();
3698 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
3701 for (; bb != nb_dofs; ++bb) {
3702 t_data_at_pts(
i,
j) += t_dof * t_n_hten(
i,
j);
3706 for (; bb < nb_base_functions; ++bb)
3722template <
int Tensor_Dim0,
int Tensor_Dim1>
3732template <
int Tensor_Dim0,
int Tensor_Dim1>
3739 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
3741 boost::shared_ptr<Range> broken_range_ptr =
nullptr,
3742 boost::shared_ptr<double> scale_ptr =
nullptr,
3743 const EntityType zero_type = MBEDGE,
const int zero_side = 0)
3771template <
int Tensor_Dim0,
int Tensor_Dim1>
3776 const size_t nb_integration_points = OP::getGaussPts().size2();
3778 auto get_data_at_pts =
3781 DL>
::size(*dataPtr, nb_integration_points);
3782 if (
type == zeroType)
3788 if (dataVec.use_count()) {
3789 dotVector.resize(nb_dofs,
false);
3790 const double *array;
3791 CHKERR VecGetArrayRead(dataVec, &array);
3793 for (
int i = 0;
i != local_indices.size(); ++
i)
3794 if (local_indices[
i] != -1)
3795 dotVector[
i] = array[local_indices[
i]];
3798 CHKERR VecRestoreArrayRead(dataVec, &array);
3809 auto get_get_side_face_dofs = [&]() {
3810 auto fe_type = OP::getFEType();
3814 std::vector<int> side_face_dofs;
3815 side_face_dofs.reserve(data.
getIndices().size() / Tensor_Dim0);
3819 auto it = side_dof_map.get<1>().begin();
3820 it != side_dof_map.get<1>().
end(); ++
it
3823 if ((Tensor_Dim0 *
it->dof) >= data.
getIndices().size()) {
3826 if (
it->type == brokenType) {
3827 if (brokenRangePtr) {
3828 auto ent = OP::getSideEntity(
it->side, brokenType);
3829 if (brokenRangePtr->find(ent) != brokenRangePtr->end()) {
3830 side_face_dofs.push_back(
it->dof);
3833 side_face_dofs.push_back(
it->dof);
3838 return side_face_dofs;
3841 auto side_face_dofs = get_get_side_face_dofs();
3845 auto t_data_at_pts = get_data_at_pts();
3846 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
3847 for (
auto b : side_face_dofs) {
3849 auto t_dof = getFTensor1FromPtr<Tensor_Dim0>(data.
getFieldData().data() +
3851 t_data_at_pts(
i,
j) += t_dof(
i) * t_row_base(
j);
3855 *dataPtr *= (scalePtr) ? *scalePtr : 1.0;
3857 if (dataVec.use_count()) {
3871template <
int Tensor_Dim0,
int Tensor_Dim1>
3876 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
3877 boost::shared_ptr<double> scale_ptr,
3879 const EntityType zero_type = MBEDGE,
const int zero_side = 0)
3889 boost::shared_ptr<MatrixDouble> data_ptr,
3890 const EntityType zero_type = MBEDGE,
3891 const int zero_side = 0)
3899 const size_t nb_integration_points =
getGaussPts().size2();
3901 auto get_data_at_pts =
3913 const double *array;
3916 for (
int i = 0;
i != local_indices.size(); ++
i)
3917 if (local_indices[
i] != -1)
3926 const size_t nb_base_functions =
3927 data.
getN().size2() / (Tensor_Dim0 * Tensor_Dim1);
3930 auto t_n_hten = data.
getFTensor2N<Tensor_Dim0, Tensor_Dim1>();
3931 auto t_data_at_pts = get_data_at_pts();
3932 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
3935 for (; bb != nb_dofs; ++bb) {
3936 t_data_at_pts(
i,
j) += (
scale * t_dof) * t_n_hten(
i,
j);
3940 for (; bb < nb_base_functions; ++bb)
3968template <
int Tensor_Dim0,
int Tensor_Dim1,
3974 boost::shared_ptr<MatrixDouble> data_ptr,
3976 const EntityType zero_type = MBEDGE,
3977 const int zero_side = 0)
3987 boost::shared_ptr<MatrixDouble> data_ptr,
3988 const EntityType zero_type = MBEDGE,
3989 const int zero_side = 0)
3996 const size_t nb_integration_points =
getGaussPts().size2();
3999 auto get_data_at_pts =
4001 DL>
::size(mat, nb_integration_points);
4010 const double *array;
4013 for (
int i = 0;
i != local_indices.size(); ++
i)
4014 if (local_indices[
i] != -1)
4022 const size_t nb_base_functions = data.
getN().size2() / 3;
4026 auto t_data_at_pts = get_data_at_pts();
4029 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
4032 for (; bb != nb_dofs / Tensor_Dim0; ++bb) {
4033 double div = t_n_diff_hvec(
j,
j);
4034 t_data_at_pts(
i) += t_dof(
i) * div;
4036 t_data_at_pts(
i) += t_base(0) * (t_dof(
i) / t_coords(0));
4042 for (; bb < nb_base_functions; ++bb) {
4075template <
int Tensor_Dim0,
int Tensor_Dim1,
4083 const std::string
field_name, boost::shared_ptr<MatrixDouble> data_ptr,
4085 boost::shared_ptr<Range> broken_range_ptr =
nullptr,
4086 boost::shared_ptr<double> scale_ptr =
nullptr,
4087 const EntityType zero_type = MBEDGE)
4099 const size_t nb_integration_points =
getGaussPts().size2();
4102 auto get_data_at_pts =
4104 DL>
::size(mat, nb_integration_points);
4114 const double *array;
4117 for (
int i = 0;
i != local_indices.size(); ++
i)
4118 if (local_indices[
i] != -1)
4133 auto get_get_side_face_dofs = [&]() {
4138 std::vector<int> side_face_dofs;
4139 side_face_dofs.reserve(data.
getIndices().size() / Tensor_Dim0);
4143 auto it = side_dof_map.get<1>().begin();
4144 it != side_dof_map.get<1>().
end(); ++
it
4147 if ((Tensor_Dim0 *
it->dof) >= data.
getIndices().size()) {
4154 side_face_dofs.push_back(
it->dof);
4157 side_face_dofs.push_back(
it->dof);
4162 return side_face_dofs;
4165 auto side_face_dofs = get_get_side_face_dofs();
4169 auto t_data_at_pts = get_data_at_pts();
4171 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
4172 for (
auto b : side_face_dofs) {
4173 auto t_dof = getFTensor1FromPtr<Tensor_Dim0>(
4177 double div = t_diff_base(
j,
j);
4178 t_data_at_pts(
i) += t_dof(
i) * div;
4180 t_data_at_pts(
i) += t_base(0) * (t_dof(
i) / t_coords(0));
4211template <
int Tensor_Dim,
typename OpBase>
4215 boost::shared_ptr<MatrixDouble> data_ptr,
4216 boost::shared_ptr<double> scale_ptr,
4217 const EntityType zero_type = MBEDGE,
4218 const int zero_side = 0)
4226 boost::shared_ptr<MatrixDouble> data_ptr,
4227 const EntityType zero_type = MBEDGE,
4228 const int zero_side = 0)
4235 const size_t nb_integration_points = OpBase::getGaussPts().size2();
4238 auto get_data_at_pts =
4240 DL>
::size(mat, nb_integration_points);
4247 auto t_normal = OpBase::getFTensor1NormalsAtGaussPts();
4248 const size_t nb_base_functions = data.
getN().size2() / 3;
4250 auto t_data_at_pts = get_data_at_pts();
4251 for (
size_t gg = 0; gg != nb_integration_points; ++gg) {
4253 t_normalized_normal(
j) = t_normal(
j);
4257 for (; bb != nb_dofs / Tensor_Dim; ++bb) {
4259 (scale_val * t_dof(
i)) * (t_base(
j) * t_normalized_normal(
j));
4263 for (; bb < nb_base_functions; ++bb) {
4306 boost::shared_ptr<MatrixDouble> inv_jac_ptr);
4319 template <
int D1,
int D2,
int J1,
int J2>
4323 static_assert(D2 == J2,
"Dimension of jacobian and dimension of <out> "
4324 "directive does not match");
4326 size_t nb_functions = diff_n.size2() / D1;
4328 size_t nb_gauss_pts = diff_n.size1();
4333 "Wrong number of Gauss Pts");
4334 if (diff_n.size2() % D1)
4336 "Number of directives of base functions and D1 dimension does "
4340 diffNinvJac.resize(diff_n.size1(), D2 * nb_functions,
false);
4344 auto t_diff_n = getFTensor1FromPtr<D2>(&*
diffNinvJac.data().begin());
4345 auto t_diff_n_ref = getFTensor1FromPtr<D1>(&*diff_n.data().begin());
4347 auto get_inv_jac_at_pts =
4350 auto t_inv_jac_at_pts = get_inv_jac_at_pts();
4351 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg, ++t_inv_jac_at_pts) {
4352 for (
size_t dd = 0; dd != nb_functions; ++dd) {
4353 t_diff_n(
i) = t_inv_jac_at_pts(
k,
i) * t_diff_n_ref(
k);
4398template <
int DERIVARIVE = 1>
4405template <
int DERIVARIVE = 1>
4412template <
int DERIVARIVE = 1>
4416 boost::shared_ptr<MatrixDouble> inv_jac_ptr)
4420template <
int DERIVARIVE = 1>
4424 boost::shared_ptr<MatrixDouble> inv_jac_ptr)
4442 invJacPtr(inv_jac_ptr) {}
4496 boost::shared_ptr<MatrixDouble> inv_jac_ptr);
4533 boost::shared_ptr<MatrixDouble> jac_ptr)
4550 2>::OpSetContravariantPiolaTransformOnFace2DImpl;
4749 template <
typename T>
4751 boost::shared_ptr<T> det_ptr,
4752 boost::shared_ptr<MatrixDouble> out_ptr)
4762 std::variant<boost::shared_ptr<VectorDouble>, boost::shared_ptr<MatrixDouble>>
4774 "Pointer for inPtr matrix not allocated");
4776 if (!std::holds_alternative<boost::shared_ptr<VectorDouble>>(detPtrVariant) &&
4777 !std::holds_alternative<boost::shared_ptr<MatrixDouble>>(detPtrVariant)) {
4779 "detPtrVariant must hold either VectorDouble or MatrixDouble");
4782 const auto nb_integration_pts = inPtr->size1();
4785 const auto nb_rows = inPtr->size2();
4786 if (nb_rows != DIM * DIM)
4788 "Wrong number of matrix coefficients");
4793 using T = std::decay_t<
decltype(ptr)>;
4795 if constexpr (std::is_same_v<T, boost::shared_ptr<VectorDouble>>) {
4796 ptr->resize(nb_integration_pts,
false);
4797 }
else if constexpr (std::is_same_v<T, boost::shared_ptr<MatrixDouble>>) {
4798 ptr->resize(nb_integration_pts, 1,
false);
4804 auto get_in_at_pts =
4806 *inPtr, nb_integration_pts);
4810 auto t_in_at_pts = get_in_at_pts();
4811 auto det_it = std::visit(
4812 [](
auto p) -> std::vector<double>::iterator {
4813 return p->data().begin();
4816 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
4825 auto get_out_at_pts =
4827 *outPtr, nb_integration_pts);
4828 auto t_in_at_pts = get_in_at_pts();
4829 auto t_out_at_pts = get_out_at_pts();
4830 auto det_it = std::visit(
4831 [](
auto p) -> std::vector<double>::iterator {
4832 return p->data().begin();
4835 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
4870 boost::shared_ptr<VectorDouble> out_ptr)
4891 "Pointer for inPtr matrix not allocated");
4893 const auto nb_integration_pts = inPtr->size1();
4897 auto get_in_at_pts =
4899 *inPtr, nb_integration_pts);
4900 outPtr->resize(nb_integration_pts,
false);
4901 auto t_in_at_pts = get_in_at_pts();
4904 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
4905 t_out = t_in_at_pts(
i,
i);
4927 boost::shared_ptr<VectorDouble> out_ptr)
4948 "Pointer for inPtr matrix not allocated");
4950 const auto nb_integration_pts = inPtr->size1();
4953 outPtr->resize(nb_integration_pts,
false);
4955 auto get_in_at_pts =
4957 DL>::get(*inPtr, nb_integration_pts);
4958 auto t_in_at_pts = get_in_at_pts();
4961 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
4962 t_out = t_in_at_pts(
i,
i);
std::vector< std::array< double, 3 > > coordinates
#define FTENSOR_INDEXES(DIM,...)
Kronecker Delta class symmetric.
Tensor1< T, Tensor_Dim > normalize()
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
static const char *const CoordinateTypesNames[]
Coordinate system names.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FieldSpace
approximation spaces
@ L2
field with C-1 continuity
@ HCURL
field with continuous tangents
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
CoordinateTypes
Coodinate system.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
NumeredDofEntity_multiIndex::index< Unique_mi_tag >::type NumeredDofEntityByUId
Numbered DoF multi-index by UId.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< double > MatrixDouble
VecAllocator< double > DoubleAllocator
implementation of Data Operators for Forces and Sources
decltype(GetFTensor2SymmetricFromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2SymmetricFromMatType
static auto getFTensor3DgFromMat(M &data)
Get symmetric tensor rank 3 on the first two indices from form data matrix.
static MoFEMErrorCode invertTensor(FTensor::Tensor2< T1, DIM, DIM > &t, T2 &det, FTensor::Tensor2< T3, DIM, DIM > &inv_t)
static auto determinantTensor(FTensor::Tensor2< T, DIM, DIM > &t)
Calculate the determinant of a tensor of rank DIM.
OpCalculateScalarFieldValuesFromPetscVecImpl< PetscData::CTX_SET_X_T > OpCalculateScalarFieldValuesDot
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
static auto getFTensor0FromVec(V &data)
Get tensor rank 0 (scalar) form data vector.
decltype(GetFTensor3FromMatImpl< Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor3FromMatType
decltype(GetFTensor2FromMatImpl< Tensor_Dim0, Tensor_Dim1, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2FromMatType
constexpr IntegrationType I
constexpr auto field_name
multi_index_container< DofsSideMapData, indexed_by< ordered_non_unique< tag< TypeSide_mi_tag >, composite_key< DofsSideMapData, member< DofsSideMapData, EntityType, &DofsSideMapData::type >, member< DofsSideMapData, int, &DofsSideMapData::side > > >, ordered_unique< tag< EntDofIdx_mi_tag >, member< DofsSideMapData, int, &DofsSideMapData::dof > > > > DofsSideMap
Map entity stype and side to element/entity dof index.
std::array< bool, MBMAXTYPE > doEntities
If true operator is executed for entity.
virtual MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
default operator for EDGE element
Data on single entity (This is passed as argument to DataOperator::doWork)
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2DiffN(FieldApproximationBase base)
Get derivatives of base functions for Hdiv space.
auto getFTensor2SymmetricFieldData()
Return symmetric FTensor rank 2, i.e. matrix from field data coefficients.
auto getFTensor2FieldData()
Return FTensor rank 2, i.e. matrix from field data coefficients.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getDiffN(const FieldApproximationBase base)
get derivatives of base functions
const VectorFieldEntities & getFieldEntities() const
Get field entities (const version)
auto getFTensor1FieldData()
Return FTensor of rank 1, i.e. vector from field data coefficients.
auto getFTensor2N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
Get DOF values on entity.
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3Diff2N(FieldApproximationBase base)
Get second derivatives of base functions for Hvec space.
const VectorInt & getLocalIndices() const
Get local indices of degrees of freedom on entity.
auto getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0FieldData()
Return scalar files as a FTensor of rank 0.
const VectorDofs & getFieldDofs() const
Get DOF data structures (const version)
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3DiffN(FieldApproximationBase base)
Get derivatives of base functions for tonsorial Hdiv space.
default operator for TRI element
default operator for Flat Prism element
default operator for Flat Prism element
FlatPrism finite element.
EntityType getFEType() const
Get dimension of finite element.
auto getFTensor1CoordsAtGaussPts()
Get coordinates at integration points assuming linear geometry.
EntityHandle getSideEntity(const int side_number, const EntityType type)
Get the side entity.
int getOpType() const
Get operator types.
OpType
Controls loop over entities on element.
@ OPCOL
operator doWork function is executed on FE columns
@ OPROW
operator doWork function is executed on FE rows
@ OPSPACE
operator do Work is execute on space data
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
structure to get information from mofem into EntitiesFieldData
Calculate divergence of tonsorial field using vectorial base.
boost::shared_ptr< double > scalePtr
boost::shared_ptr< Range > brokenRangePtr
SmartPetscObj< Vec > dataVec
OpCalculateBrokenHVecTensorDivergence(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, EntityType broken_type, boost::shared_ptr< Range > broken_range_ptr=nullptr, boost::shared_ptr< double > scale_ptr=nullptr, const EntityType zero_type=MBEDGE)
boost::shared_ptr< MatrixDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
const EntityHandle zeroType
Get tensor field for H-div approximation.
boost::shared_ptr< MatrixDouble > dataPtr
boost::shared_ptr< Range > brokenRangePtr
boost::shared_ptr< double > scalePtr
OpCalculateBrokenHVecTensorField(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, EntityType broken_type, boost::shared_ptr< Range > broken_range_ptr=nullptr, boost::shared_ptr< double > scale_ptr=nullptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Calculate values of vector field at integration points.
const EntityHandle zeroType
SmartPetscObj< Vec > dataVec
Calculate divergence of vector field at integration points.
boost::shared_ptr< VectorDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpCalculateDivergenceVectorFieldValues(const std::string field_name, boost::shared_ptr< VectorDouble > data_ptr, const EntityType zero_type=MBVERTEX)
Constructor for vector field divergence calculation operator.
const EntityHandle zeroType
Approximate tensor field values for a given PETSc vector on a tensor basis.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpCalculateHTensorTensorFieldFromPetscVecImpl(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0, bool throw_error=true)
boost::shared_ptr< MatrixDouble > dataPtr
const EntityHandle zeroType
Calculate tenor field using tensor base, i.e. Hdiv/Hcurl.
VectorDouble dotVector
Keeps temporary values of time derivatives.
OpCalculateHTensorTensorField(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, boost::shared_ptr< double > scale_ptr, SmartPetscObj< Vec > data_vec=SmartPetscObj< Vec >(), const EntityType zero_type=MBEDGE, const int zero_side=0)
SmartPetscObj< Vec > dataVec
boost::shared_ptr< MatrixDouble > dataPtr
const EntityHandle zeroType
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpCalculateHTensorTensorField(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
boost::shared_ptr< double > scalePtr
Calculate divergence of tonsorial field using vectorial base.
boost::shared_ptr< MatrixDouble > dataPtr
SmartPetscObj< Vec > dataVec
VectorDouble dotVector
Keeps temporary values of time derivatives.
const EntityHandle zeroType
OpCalculateHVecTensorDivergence(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBEDGE, const int zero_side=0)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpCalculateHVecTensorDivergence(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
Approximate Hdiv/Hcurl tensor field values for a given PETSc vector.
boost::shared_ptr< MatrixDouble > dataPtr
OpCalculateHVecTensorFieldFromPetscVecImpl(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
const EntityHandle zeroType
Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl.
OpCalculateHVecTensorField(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, boost::shared_ptr< double > scale_ptr, SmartPetscObj< Vec > data_vec=SmartPetscObj< Vec >(), const EntityType zero_type=MBEDGE, const int zero_side=0)
const EntityHandle zeroType
boost::shared_ptr< MatrixDouble > dataPtr
OpCalculateHVecTensorField(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
SmartPetscObj< Vec > dataVec
VectorDouble dotVector
Keeps temporary values of time derivatives.
boost::shared_ptr< double > scalePtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< MatrixDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
const EntityHandle zeroType
OpCalculateHVecTensorGradient(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
const EntityHandle zeroType
OpCalculateHVecTensorGradient(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
boost::shared_ptr< MatrixDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Calculate gradient of tensor field.
Calculate trace of vector (Hdiv/Hcurl) space.
const EntityHandle zeroType
boost::shared_ptr< MatrixDouble > dataPtr
boost::shared_ptr< double > scalePtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
OpCalculateHVecTensorTrace(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
FTensor::Index< 'j', Tensor_Dim > j
FTensor::Index< 'i', Tensor_Dim > i
OpCalculateHVecTensorTrace(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, boost::shared_ptr< double > scale_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
const EntityHandle zeroType
boost::shared_ptr< MatrixDouble > dataPtr
OpCalculateHVecVectorFieldDot(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
Get vector field for H-div approximation.
OpCalculateHVecVectorField_General(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
SmartPetscObj< Vec > dataVec
OpCalculateHVecVectorField_General(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBEDGE, const int zero_side=0)
const EntityHandle zeroType
boost::shared_ptr< MatrixDouble > dataPtr
Get vector field for H-div approximation.
Get vector field for H-div approximation.
Calculate gradient of vector field.
boost::shared_ptr< MatrixDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
const EntityHandle zeroType
OpCalculateHVecVectorGradient(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
Calculate gradient of vector field.
boost::shared_ptr< MatrixDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
const EntityHandle zeroType
OpCalculateHVecVectorHessian(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
boost::shared_ptr< MatrixDouble > dataPtr
const EntityHandle zeroType
const EntityHandle zeroType
boost::shared_ptr< MatrixDouble > dataPtr
boost::shared_ptr< MatrixDouble > dataPtr
const EntityHandle zeroType
Calculate curl of vector field.
Calculate divergence of vector field dot.
boost::shared_ptr< VectorDouble > dataPtr
OpCalculateHdivVectorDivergenceDot(const std::string field_name, boost::shared_ptr< VectorDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
const EntityHandle zeroType
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Calculate divergence of vector field.
boost::shared_ptr< VectorDouble > dataPtr
OpCalculateHdivVectorDivergence(const std::string field_name, boost::shared_ptr< VectorDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
const EntityHandle zeroType
Calculate inverse of jacobian for face element.
OpCalculateInvJacForFatPrism(MatrixDouble &inv_jac)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpCalculateInvJacForFatPrism(boost::shared_ptr< MatrixDouble > inv_jac_ptr)
const boost::shared_ptr< MatrixDouble > invJacPtr
Calculate inverse of jacobian for face element.
OpCalculateInvJacForFlatPrism(MatrixDouble &inv_jac_f3)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Evaluate field gradient values for scalar field, i.e. gradient is tensor rank 1 (vector)
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Evaluate field gradient values for scalar field, i.e. gradient is tensor rank 1 (vector),...
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate gradient values of scalar field at integration points
Calculate scalar field values from PETSc vector at integration points.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< VectorDouble > dataPtr
OpCalculateScalarFieldValuesFromPetscVecImpl(const std::string field_name, boost::shared_ptr< VectorDouble > data_ptr, const EntityType zero_at_type=MBVERTEX)
Constructor for PETSc vector-based scalar field calculation.
const EntityHandle zeroAtType
Scalar field values at integration points.
OpCalculateScalarFieldValues_General(const std::string field_name, boost::shared_ptr< ublas::vector< T, A > > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBVERTEX)
OpCalculateScalarFieldValues_General(SmartPetscObj< DM > data_dm, const ForcesAndSourcesCore::UserDataOperator::OpType op_type, const std::string field_name, boost::shared_ptr< ublas::vector< T, A > > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBVERTEX)
Constructor with PETSc vector support for a different problem layout.
SmartPetscObj< DM > dataDm
boost::shared_ptr< ublas::vector< T, A > > dataPtr
OpCalculateScalarFieldValues_General(const ForcesAndSourcesCore::UserDataOperator::OpType op_type, const std::string field_name, boost::shared_ptr< ublas::vector< T, A > > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBVERTEX)
Constructor with PETSc vector support.
SmartPetscObj< Vec > dataVec
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate values of scalar field at integration points
const EntityHandle zeroType
OpCalculateScalarFieldValues_General(const std::string field_name, boost::shared_ptr< ublas::vector< T, A > > data_ptr, const EntityType zero_type=MBVERTEX)
Constructor for scalar field values calculation operator.
Specialization for double precision scalar field values calculation.
MoFEMErrorCode doWork(int, EntityType type, EntitiesFieldData::EntData &data)
calculate values of scalar field at integration points
Get time direvarive values at integration pts for tensor field rank 2, i.e. matrix field.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpCalculateTensor2FieldValuesDot(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_at_type=MBVERTEX)
EntityType zeroAtType
Zero values at Gauss point at this type.
VectorDouble dotVector
Keeps temporary values of time derivatives.
boost::shared_ptr< MatrixDouble > dataPtr
Data computed into this matrix.
const EntityHandle zeroType
OpCalculateTensor2FieldValues_General(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBVERTEX)
OpCalculateTensor2FieldValues_General(ForcesAndSourcesCore::UserDataOperator::OpType op_type, const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBVERTEX)
SmartPetscObj< Vec > dataVec
OpCalculateTensor2FieldValues_General(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBVERTEX)
boost::shared_ptr< MatrixDouble > dataPtr
Calculate field values for tenor field rank 2.
const EntityHandle zeroType
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< M > dataPtr
OpCalculateTensor2FieldValues_General(const std::string field_name, boost::shared_ptr< M > data_ptr, const EntityType zero_type=MBVERTEX)
Get values at integration pts for tensor field rank 2, i.e. matrix field.
OpCalculateTensor2SymmetricDeviatorFieldValues_General(const std::string field_name, MatrixPtr data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
OpCalculateTensor2SymmetricDeviatorFieldValues_General(SmartPetscObj< DM > data_dm, const ForcesAndSourcesCore::UserDataOperator::OpType op_type, const std::string field_name, MatrixPtr data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBEDGE, const int zero_side=0, MatrixPtr coordinates=nullptr)
OpCalculateTensor2SymmetricDeviatorFieldValues_General(const std::string field_name, MatrixPtr data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBEDGE, const int zero_side=0, MatrixPtr coordinates=nullptr)
const EntityHandle zeroType
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data) override
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< MatrixDouble > MatrixPtr
OpCalculateTensor2SymmetricFieldGradient_General(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBVERTEX)
Evaluate field gradient values for symmetric 2nd order tensor field, i.e. gradient is tensor rank 3.
OpCalculateTensor2SymmetricFieldGradient_General(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBVERTEX)
Get field gradients at integration pts for symmetric tensorial field rank 2.
OpCalculateTensor2SymmetricFieldGradient(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBVERTEX)
Calculate symmetric tensor field rates ant integratio pts.
const EntityHandle zeroType
boost::shared_ptr< MatrixDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpCalculateTensor2SymmetricFieldValuesDot(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
Calculate symmetric tensor field values at integration pts.
SmartPetscObj< DM > dataDm
OpCalculateTensor2SymmetricFieldValues(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBEDGE, const int zero_side=0)
OpCalculateTensor2SymmetricFieldValues(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
SmartPetscObj< Vec > dataVec
OpCalculateTensor2SymmetricFieldValues(SmartPetscObj< DM > data_dm, const ForcesAndSourcesCore::UserDataOperator::OpType op_type, const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBEDGE, const int zero_side=0)
boost::shared_ptr< MatrixDouble > dataPtr
const EntityHandle zeroType
Operator for calculating the trace of matrices at integration points.
boost::shared_ptr< MatrixDouble > inPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
FTensor::Index< 'i', DIM > i
boost::shared_ptr< VectorDouble > outPtr
OpCalculateTraceFromMat(boost::shared_ptr< MatrixDouble > in_ptr, boost::shared_ptr< VectorDouble > out_ptr)
Constructor for matrix trace calculation operator.
Calculates the trace of an input matrix.
FTensor::Index< 'i', DIM > i
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< VectorDouble > outPtr
boost::shared_ptr< MatrixDouble > inPtr
OpCalculateTraceFromSymmMat(boost::shared_ptr< MatrixDouble > in_ptr, boost::shared_ptr< VectorDouble > out_ptr)
Get field gradients time derivative at integration pts for scalar field rank 0, i....
boost::shared_ptr< MatrixDouble > dataPtr
Data computed into this matrix.
OpCalculateVectorFieldGradientDot(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_at_type=MBVERTEX)
EntityType zeroAtType
Zero values at Gauss point at this type.
VectorDouble dotVector
Keeps temporary values of time derivatives.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Evaluate field gradient values for vector field, i.e. gradient is tensor rank 2.
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate values of vector field at integration points
Approximate field values for given petsc vector.
boost::shared_ptr< MatrixDouble > dataPtr
OpCalculateVectorFieldValuesFromPetscVecImpl(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_at_type=MBVERTEX, bool throw_error=true)
const EntityHandle zeroAtType
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpCalculateVectorFieldValues_General(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBVERTEX, const int max_order=-1)
OpCalculateVectorFieldValues_General(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBVERTEX, const int max_order=-1)
SmartPetscObj< DM > dataDm
const EntityHandle zeroType
SmartPetscObj< Vec > dataVec
boost::shared_ptr< MatrixDouble > dataPtr
OpCalculateVectorFieldValues_General(SmartPetscObj< DM > data_dm, const ForcesAndSourcesCore::UserDataOperator::OpType op_type, const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const EntityType zero_type=MBVERTEX, const int max_order=-1)
Calculate field values for tensor field rank 1, i.e. vector field.
OpCalculateVectorFieldValues_General(const std::string field_name, boost::shared_ptr< M > data_ptr, const EntityType zero_type=MBVERTEX)
Constructor for vector field values calculation operator.
boost::shared_ptr< M > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate values of vector field at integration points
const EntityHandle zeroType
Specialization for MatrixDouble vector field values calculation.
Operator for inverting matrices at integration points.
OpInvertMatrix(boost::shared_ptr< MatrixDouble > in_ptr, boost::shared_ptr< T > det_ptr, boost::shared_ptr< MatrixDouble > out_ptr)
Constructor for matrix inversion operator.
boost::shared_ptr< MatrixDouble > outPtr
boost::shared_ptr< MatrixDouble > inPtr
std::variant< boost::shared_ptr< VectorDouble >, boost::shared_ptr< MatrixDouble > > detPtrVariant
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Make Hdiv space from Hcurl space in 2d.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Operator for fat prism element updating integration weights in the volume.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpMultiplyDeterminantOfJacobianAndWeightsForFatPrisms()
Operator for scaling matrix values by a scalar factor.
boost::shared_ptr< MatrixDouble > outMat
DEPRECATED OpScaleMatrix(const std::string field_name, const double scale, boost::shared_ptr< MatrixDouble > in_mat, boost::shared_ptr< MatrixDouble > out_mat)
boost::shared_ptr< double > scalePtr
OpScaleMatrix(boost::shared_ptr< double > scale_ptr, boost::shared_ptr< MatrixDouble > in_mat, boost::shared_ptr< MatrixDouble > out_mat)
Constructor for matrix scaling operator.
boost::shared_ptr< MatrixDouble > inMat
MoFEMErrorCode doWork(int, EntityType, EntData &)
Operator for linear form, usually to calculate values on right hand side.
OpSetInvJacH1ForFaceEmbeddedIn3DSpace(boost::shared_ptr< MatrixDouble > inv_jac_ptr)
OpSetInvJacH1ForFace(boost::shared_ptr< MatrixDouble > inv_jac_ptr)
Transform local reference derivatives of shape functions to global derivatives.
const boost::shared_ptr< MatrixDouble > invJacPtr
OpSetInvJacH1ForFatPrism(MatrixDouble &inv_jac)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpSetInvJacH1ForFatPrism(boost::shared_ptr< MatrixDouble > inv_jac_ptr)
Transform local reference derivatives of shape functions to global derivatives.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpSetInvJacH1ForFlatPrism(MatrixDouble &inv_jac_f3)
boost::shared_ptr< MatrixDouble > invJacPtr
MatrixDouble diffHcurlInvJac
OpSetInvJacHcurlFaceImpl(boost::shared_ptr< MatrixDouble > inv_jac_ptr)
Transform local reference derivatives of shape function to global derivatives for face.
OpSetInvJacL2ForFaceEmbeddedIn3DSpace(boost::shared_ptr< MatrixDouble > inv_jac_ptr)
OpSetInvJacL2ForFace(boost::shared_ptr< MatrixDouble > inv_jac_ptr)
Transform local reference derivatives of shape functions to global derivatives.
MoFEMErrorCode applyTransform(MatrixDouble &diff_n)
Apply transformation to the input matrix.
OpSetInvJacToScalarBasesBasic(FieldSpace space, boost::shared_ptr< MatrixDouble > inv_jac_ptr)
boost::shared_ptr< MatrixDouble > invJacPtr
Operator for symmetrizing tensor fields.
FTensor::Index< 'i', DIM > i
boost::shared_ptr< MatrixDouble > outMat
OpSymmetrizeTensor(boost::shared_ptr< MatrixDouble > in_mat, boost::shared_ptr< MatrixDouble > out_mat)
Constructor for tensor symmetrization operator.
MoFEMErrorCode doWork(int, EntityType, EntData &)
Operator for linear form, usually to calculate values on right hand side.
FTensor::Index< 'j', DIM > j
DEPRECATED OpSymmetrizeTensor(const std::string field_name, boost::shared_ptr< MatrixDouble > in_mat, boost::shared_ptr< MatrixDouble > out_mat)
boost::shared_ptr< MatrixDouble > inMat
FTensor::Index< 'i', DIM_01 > i
FTensor::Index< 'k', DIM_23 > k
boost::shared_ptr< MatrixDouble > dMat
OpTensorTimesSymmetricTensor(boost::shared_ptr< MatrixDouble > in_mat, boost::shared_ptr< MatrixDouble > out_mat, boost::shared_ptr< MatrixDouble > d_mat)
FTensor::Index< 'j', DIM_01 > j
boost::shared_ptr< MatrixDouble > inMat
MoFEMErrorCode doWork(int, EntityType, EntData &)
Operator for linear form, usually to calculate values on right hand side.
FTensor::Index< 'l', DIM_23 > l
DEPRECATED OpTensorTimesSymmetricTensor(const std::string field_name, boost::shared_ptr< MatrixDouble > in_mat, boost::shared_ptr< MatrixDouble > out_mat, boost::shared_ptr< MatrixDouble > d_mat)
boost::shared_ptr< MatrixDouble > outMat
static constexpr Switches CtxSetX
Solution vector switch.
static constexpr Switches CtxSetX_TT
Second time derivative switch.
std::bitset< 8 > Switches
Bitset type for context switches.
static constexpr Switches CtxSetX_T
First time derivative switch.
@ CTX_SET_X_T
Time derivative X_t is set.
@ CTX_SET_DX
Solution increment DX is set.
@ CTX_SET_X
Solution vector X is set.
@ CTX_SET_X_TT
Second time derivative X_tt is set.
keeps basic data about problem
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredRowDofsPtr
store DOFs on rows for this problem
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredColDofsPtr
store DOFs on columns for this problem
intrusive_ptr for managing petsc objects
static FTensor::Tensor2_symmetric< double, 3 > getTensor(const FTensor::Tensor1< T, Size > &t_coordinates, const double theta=0.)
Reconstruct D + theta*I/3; input may be an owning tensor or a view.
static FTensor::Tensor1< double, 5 > getCoordinates(const Tensor &t_tensor)
Project a full or symmetric tensor onto the five orthonormal columns.
static const FTensor::Dg< double, 3, 5 > & getBasis()
Basis columns (11-22)/sqrt(2), (11+22-2*33)/sqrt(6), 12, 13, 23.