971 {
973
974 const double vol = getMeasure();
975 auto t_w = getFTensor0IntegrationWeight();
976 auto t_coords = getFTensor1CoordsAtGaussPts();
977 auto t_base = data.getFTensor0N();
978 auto t_diff_base = data.getFTensor1DiffN<
SPACE_DIM>();
979
980#ifndef NDEBUG
981 if (data.getDiffN().size1() != data.getN().size1())
983 if (data.getDiffN().size2() != data.getN().size2() *
SPACE_DIM) {
985 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
986 MOFEM_LOG(
"SELF", Sev::error) << data.getN();
987 MOFEM_LOG(
"SELF", Sev::error) << data.getDiffN();
989 }
990#endif
991
993
994
995 auto t_h = getFTensor0FromVec(*
hPtr);
996 auto t_grad_g = getFTensor1FromMat<SPACE_DIM>(*
gradGPtr);
997
998 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
999
1000 const double r = t_coords(0);
1002
1003 const double set_h =
init_h(t_coords(0), t_coords(1), t_coords(2));
1004 const double m =
get_M(set_h) * alpha;
1005
1006 int bb = 0;
1007 for (; bb != nbRows; ++bb) {
1008 locF[bb] += (t_base * alpha) * (t_h - set_h);
1009 locF[bb] += (t_diff_base(
i) *
m) * t_grad_g(
i);
1010 ++t_base;
1011 ++t_diff_base;
1012 }
1013
1014 for (; bb < nbRowBaseFunctions; ++bb) {
1015 ++t_base;
1016 ++t_diff_base;
1017 }
1018
1019 ++t_h;
1020 ++t_grad_g;
1021
1022 ++t_coords;
1023 ++t_w;
1024 }
1025
1026 } else {
1027
1028 auto t_dot_h = getFTensor0FromVec(*
dotHPtr);
1029 auto t_h = getFTensor0FromVec(*
hPtr);
1030 auto t_u = getFTensor1FromMat<U_FIELD_DIM>(*
uPtr);
1031 auto t_grad_h = getFTensor1FromMat<SPACE_DIM>(*
gradHPtr);
1032 auto t_grad_g = getFTensor1FromMat<SPACE_DIM>(*
gradGPtr);
1033
1034 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
1035
1036 const double r = t_coords(0);
1038
1039 const double m =
get_M(t_h) * alpha;
1040
1041 int bb = 0;
1042 for (; bb != nbRows; ++bb) {
1043 locF[bb] += (t_base * alpha) * (t_dot_h);
1044 locF[bb] += (t_base * alpha) * (t_grad_h(
i) * t_u(
i));
1045 locF[bb] += (t_diff_base(
i) * t_grad_g(
i)) *
m;
1046 ++t_base;
1047 ++t_diff_base;
1048 }
1049
1050 for (; bb < nbRowBaseFunctions; ++bb) {
1051 ++t_base;
1052 ++t_diff_base;
1053 }
1054
1055 ++t_dot_h;
1056 ++t_h;
1057 ++t_grad_g;
1058 ++t_u;
1059 ++t_grad_h;
1060
1061 ++t_coords;
1062 ++t_w;
1063 }
1064 }
1065
1067 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
auto cylindrical
[cylindrical]
auto init_h
Initialisation function.
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
constexpr IntegrationType I
FTensor::Index< 'm', 3 > m