806 {
808
809 const double vol = getMeasure();
810 auto t_w = getFTensor0IntegrationWeight();
811 auto t_coords = getFTensor1CoordsAtGaussPts();
812 auto t_base = data.getFTensor0N();
813 auto t_diff_base = data.getFTensor1DiffN<
SPACE_DIM>();
814
815#ifndef NDEBUG
816 if (data.getDiffN().size1() != data.getN().size1())
818 if (data.getDiffN().size2() != data.getN().size2() *
SPACE_DIM) {
820 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
821 MOFEM_LOG(
"SELF", Sev::error) << data.getN();
822 MOFEM_LOG(
"SELF", Sev::error) << data.getDiffN();
824 }
825#endif
826
828
829 auto t_h = getFTensor0FromVec(*
hPtr);
830 auto t_grad_g = getFTensor1FromMat<SPACE_DIM>(*
gradGPtr);
831
832 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
833
834 const double r = t_coords(0);
836
837 const double set_h =
init_h(t_coords(0), t_coords(1), t_coords(2));
838 const double m =
get_M(set_h) * alpha;
839
840 int bb = 0;
841 for (; bb != nbRows; ++bb) {
842 locF[bb] += (t_base * alpha) * (t_h - set_h);
843 locF[bb] += (t_diff_base(
i) *
m) * t_grad_g(
i);
844 ++t_base;
845 ++t_diff_base;
846 }
847
848 for (; bb < nbRowBaseFunctions; ++bb) {
849 ++t_base;
850 ++t_diff_base;
851 }
852
853 ++t_h;
854 ++t_grad_g;
855
856 ++t_coords;
857 ++t_w;
858 }
859
860 } else {
861
862 auto t_dot_h = getFTensor0FromVec(*
dotHPtr);
863 auto t_h = getFTensor0FromVec(*
hPtr);
864 auto t_u = getFTensor1FromMat<U_FIELD_DIM>(*
uPtr);
865 auto t_grad_h = getFTensor1FromMat<SPACE_DIM>(*
gradHPtr);
866 auto t_grad_g = getFTensor1FromMat<SPACE_DIM>(*
gradGPtr);
867
868 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
869
870 const double r = t_coords(0);
872
873 const double m =
get_M(t_h) * alpha;
874
875 int bb = 0;
876 for (; bb != nbRows; ++bb) {
877 locF[bb] += (t_base * alpha) * (t_dot_h);
878 locF[bb] += (t_base * alpha) * (t_grad_h(
i) * t_u(
i));
879 locF[bb] += (t_diff_base(
i) * t_grad_g(
i)) *
m;
880 ++t_base;
881 ++t_diff_base;
882 }
883
884 for (; bb < nbRowBaseFunctions; ++bb) {
885 ++t_base;
886 ++t_diff_base;
887 }
888
889 ++t_dot_h;
890 ++t_h;
891 ++t_grad_g;
892 ++t_u;
893 ++t_grad_h;
894
895 ++t_coords;
896 ++t_w;
897 }
898 }
899
901 }
#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 init_h
Initialisation function.
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
constexpr IntegrationType I
FTensor::Index< 'm', 3 > m