v0.14.0
Functions
SurfacePressureComplexForLazy.cpp File Reference
#include <MoFEM.hpp>
#include <MethodForForceScaling.hpp>
#include <SurfacePressure.hpp>
#include <SurfacePressureComplexForLazy.hpp>

Go to the source code of this file.

Functions

MoFEMErrorCode Traction_hierarchical (int order, int *order_edge, double *N, double *N_face, double *N_edge[], double *t, double *t_edge[], double *t_face, double *traction, int gg)
 
MoFEMErrorCode Fext_h_hierarchical (int order, int *order_edge, double *N, double *N_face, double *N_edge[], double *diffN, double *diffN_face, double *diffN_edge[], double *t, double *t_edge[], double *t_face, double *dofs_x, double *dofs_x_edge[], double *dofs_x_face, double *idofs_x, double *idofs_x_edge[], double *idofs_x_face, double *Fext, double *Fext_egde[], double *Fext_face, double *iFext, double *iFext_egde[], double *iFext_face, int g_dim, const double *g_w)
 
MoFEMErrorCode KExt_hh_hierarchical (double eps, int order, int *order_edge, double *N, double *N_face, double *N_edge[], double *diffN, double *diffN_face, double *diffN_edge[], double *t, double *t_edge[], double *t_face, double *dofs_x, double *dofs_x_edge[], double *dofs_x_face, double *KExt_hh, double *KExt_egdeh[3], double *KExt_faceh, int g_dim, const double *g_w)
 
MoFEMErrorCode KExt_hh_hierarchical_edge (double eps, int order, int *order_edge, double *N, double *N_face, double *N_edge[], double *diffN, double *diffN_face, double *diffN_edge[], double *t, double *t_edge[], double *t_face, double *dofs_x, double *dofs_x_edge[], double *dofs_x_face, double *Khext_edge[3], double *KExt_edgeegde[3][3], double *KExt_faceedge[3], int g_dim, const double *g_w)
 
MoFEMErrorCode KExt_hh_hierarchical_face (double eps, int order, int *order_edge, double *N, double *N_face, double *N_edge[], double *diffN, double *diffN_face, double *diffN_edge[], double *t, double *t_edge[], double *t_face, double *dofs_x, double *dofs_x_edge[], double *dofs_x_face, double *KExt_hface, double *KExt_egdeface[3], double *KExt_faceface, int g_dim, const double *g_w)
 
void tetcircumcenter_tp (double a[3], double b[3], double c[3], double d[3], double circumcenter[3], double *xi, double *eta, double *zeta)
 
void tricircumcenter3d_tp (double a[3], double b[3], double c[3], double circumcenter[3], double *xi, double *eta)
 
MoFEMErrorCode KExt_hh_hierarchical (double eps, int order, int *order_edge, double *N, double *N_face, double *N_edge[], double *diffN, double *diffN_face, double *diffN_edge[], double *t, double *t_edge[], double *t_face, double *dofs_x, double *dofs_x_edge[], double *dofs_x_face, double *KExt_hh, double *KExt_edgeh[], double *KExt_faceh, int g_dim, const double *g_w)
 

Function Documentation

◆ Fext_h_hierarchical()

MoFEMErrorCode Fext_h_hierarchical ( int  order,
int *  order_edge,
double N,
double N_face,
double N_edge[],
double diffN,
double diffN_face,
double diffN_edge[],
double t,
double t_edge[],
double t_face,
double dofs_x,
double dofs_x_edge[],
double dofs_x_face,
double idofs_x,
double idofs_x_edge[],
double idofs_x_face,
double Fext,
double Fext_egde[],
double Fext_face,
double iFext,
double iFext_egde[],
double iFext_face,
int  g_dim,
const double g_w 
)

Definition at line 620 of file SurfacePressureComplexForLazy.cpp.

627  {
629  int dd, nn, ee, gg;
630  if (Fext != NULL)
631  bzero(Fext, 9 * sizeof(double));
632  if (iFext != NULL)
633  bzero(iFext, 9 * sizeof(double));
634  ee = 0;
635  for (; ee < 3; ee++) {
636  int nb_dofs_edge = NBEDGE_H1(order_edge[ee]);
637  if (nb_dofs_edge == 0)
638  continue;
639  if (Fext_edge != NULL)
640  bzero(Fext_edge[ee], 3 * nb_dofs_edge * sizeof(double));
641  if (iFext_edge != NULL)
642  bzero(iFext_edge[ee], 3 * nb_dofs_edge * sizeof(double));
643  }
644  int nb_dofs_face = NBFACETRI_H1(order);
645  if (nb_dofs_face != 0) {
646  if (Fext_face != NULL)
647  bzero(Fext_face, 3 * nb_dofs_face * sizeof(double));
648  if (iFext_face != NULL)
649  bzero(iFext_face, 3 * nb_dofs_face * sizeof(double));
650  }
651  gg = 0;
652  for (; gg < g_dim; gg++) {
653  double traction[3] = {0, 0, 0};
654  CHKERR Traction_hierarchical(order, order_edge, N, N_face, N_edge, t,
655  t_edge, t_face, traction, gg);
656  __CLPK_doublecomplex xnormal[3], xs1[3], xs2[3];
658  // FIXME: order of tractions approximation could be different for field
659  // approx.
660  order, order_edge, order, order_edge, diffN, diffN_face, diffN_edge,
661  dofs_x, dofs_x_edge, dofs_x_face, idofs_x, idofs_x_edge, idofs_x_face,
662  xnormal, xs1, xs2, gg);
663  CHKERR Base_scale(xnormal, xs1, xs2);
664  double normal_real[3], s1_real[3], s2_real[3];
665  double normal_imag[3], s1_imag[3], s2_imag[3];
666  for (dd = 0; dd < 3; dd++) {
667  normal_real[dd] = 0.5 * xnormal[dd].r;
668  normal_imag[dd] = 0.5 * xnormal[dd].i;
669  s1_real[dd] = 0.5 * xs1[dd].r;
670  s1_imag[dd] = 0.5 * xs1[dd].i;
671  s2_real[dd] = 0.5 * xs2[dd].r;
672  s2_imag[dd] = 0.5 * xs2[dd].i;
673  }
674  nn = 0;
675  for (; nn < 3; nn++) {
676  if (Fext != NULL)
677  for (dd = 0; dd < 3; dd++) {
678  // fprintf(stderr,"%d %f %f %f %f %f %f\n",
679  // gg,g_w[gg],N[3*gg+nn],normal_real[dd],
680  // traction[0],traction[1],traction[2]);
681  Fext[3 * nn + dd] +=
682  g_w[gg] * N[3 * gg + nn] * normal_real[dd] * traction[2];
683  Fext[3 * nn + dd] +=
684  g_w[gg] * N[3 * gg + nn] * s1_real[dd] * traction[0];
685  Fext[3 * nn + dd] +=
686  g_w[gg] * N[3 * gg + nn] * s2_real[dd] * traction[1];
687  }
688  if (iFext != NULL)
689  for (dd = 0; dd < 3; dd++) {
690  iFext[3 * nn + dd] +=
691  g_w[gg] * N[3 * gg + nn] * normal_imag[dd] * traction[2];
692  iFext[3 * nn + dd] +=
693  g_w[gg] * N[3 * gg + nn] * s1_imag[dd] * traction[0];
694  iFext[3 * nn + dd] +=
695  g_w[gg] * N[3 * gg + nn] * s2_imag[dd] * traction[1];
696  }
697  }
698  ee = 0;
699  for (; ee < 3; ee++) {
700  int nb_dofs_edge = NBEDGE_H1(order_edge[ee]);
701  if (nb_dofs_edge == 0)
702  continue;
703  int nn = 0;
704  for (; nn < nb_dofs_edge; nn++) {
705  if (Fext_edge != NULL)
706  for (dd = 0; dd < 3; dd++) {
707  Fext_edge[ee][3 * nn + dd] += g_w[gg] *
708  N_edge[ee][gg * nb_dofs_edge + nn] *
709  normal_real[dd] * traction[2];
710  Fext_edge[ee][3 * nn + dd] += g_w[gg] *
711  N_edge[ee][gg * nb_dofs_edge + nn] *
712  s1_real[dd] * traction[0];
713  Fext_edge[ee][3 * nn + dd] += g_w[gg] *
714  N_edge[ee][gg * nb_dofs_edge + nn] *
715  s2_real[dd] * traction[1];
716  }
717  if (iFext_edge != NULL) {
718  for (dd = 0; dd < 3; dd++) {
719  iFext_edge[ee][3 * nn + dd] += g_w[gg] *
720  N_edge[ee][gg * nb_dofs_edge + nn] *
721  normal_imag[dd] * traction[2];
722  iFext_edge[ee][3 * nn + dd] += g_w[gg] *
723  N_edge[ee][gg * nb_dofs_edge + nn] *
724  s1_imag[dd] * traction[0];
725  iFext_edge[ee][3 * nn + dd] += g_w[gg] *
726  N_edge[ee][gg * nb_dofs_edge + nn] *
727  s2_imag[dd] * traction[1];
728  }
729  }
730  }
731  }
732  if (nb_dofs_face != 0) {
733  nn = 0;
734  for (; nn < nb_dofs_face; nn++) {
735  if (Fext_face != NULL)
736  for (dd = 0; dd < 3; dd++) {
737  Fext_face[3 * nn + dd] += g_w[gg] * N_face[gg * nb_dofs_face + nn] *
738  normal_real[dd] * traction[2];
739  Fext_face[3 * nn + dd] += g_w[gg] * N_face[gg * nb_dofs_face + nn] *
740  s1_real[dd] * traction[0];
741  Fext_face[3 * nn + dd] += g_w[gg] * N_face[gg * nb_dofs_face + nn] *
742  s2_real[dd] * traction[1];
743  }
744  if (iFext_face != NULL)
745  for (dd = 0; dd < 3; dd++) {
746  iFext_face[3 * nn + dd] += g_w[gg] *
747  N_face[gg * nb_dofs_face + nn] *
748  normal_imag[dd] * traction[2];
749  iFext_face[3 * nn + dd] += g_w[gg] *
750  N_face[gg * nb_dofs_face + nn] *
751  s1_imag[dd] * traction[0];
752  iFext_face[3 * nn + dd] += g_w[gg] *
753  N_face[gg * nb_dofs_face + nn] *
754  s2_imag[dd] * traction[1];
755  }
756  }
757  }
758  }
760 }

◆ KExt_hh_hierarchical() [1/2]

MoFEMErrorCode KExt_hh_hierarchical ( double  eps,
int  order,
int *  order_edge,
double N,
double N_face,
double N_edge[],
double diffN,
double diffN_face,
double diffN_edge[],
double t,
double t_edge[],
double t_face,
double dofs_x,
double dofs_x_edge[],
double dofs_x_face,
double KExt_hh,
double KExt_edgeh[],
double KExt_faceh,
int  g_dim,
const double g_w 
)

Definition at line 761 of file SurfacePressureComplexForLazy.cpp.

766  {
768  int gg, dd, ii, nn, ee;
769  bzero(KExt_hh, 9 * 9 * sizeof(double));
770  if (KExt_edgeh != NULL) {
771  for (ee = 0; ee < 3; ee++) {
772  int nb_dofs_edge = NBEDGE_H1(order_edge[ee]);
773  bzero(KExt_edgeh[ee], 9 * 3 * nb_dofs_edge * sizeof(double));
774  }
775  }
776  int nb_dofs_face = NBFACETRI_H1(order);
777  if (KExt_faceh != NULL) {
778  bzero(KExt_faceh, 9 * 3 * nb_dofs_face * sizeof(double));
779  }
780  for (gg = 0; gg < g_dim; gg++) {
781  double traction[3] = {0, 0, 0};
782  CHKERR Traction_hierarchical(order, order_edge, N, N_face, N_edge, t,
783  t_edge, t_face, traction, gg);
784  //
785  __CLPK_doublecomplex xnormal[3], xs1[3], xs2[3];
786  double idofs_x[9];
787  for (ii = 0; ii < 9; ii++) {
788  bzero(idofs_x, 9 * sizeof(double));
789  idofs_x[ii] = eps;
790  CHKERR Normal_hierarchical(order, order_edge, // FIXME
791  order, order_edge, diffN, diffN_face,
792  diffN_edge, dofs_x, dofs_x_edge, dofs_x_face,
793  idofs_x, NULL, NULL, xnormal, xs1, xs2, gg);
794  CHKERR Base_scale(xnormal, xs1, xs2);
795  double normal_imag[3], s1_imag[3], s2_imag[3];
796  for (dd = 0; dd < 3; dd++) {
797  normal_imag[dd] = 0.5 * xnormal[dd].i / eps;
798  s1_imag[dd] = 0.5 * xs1[dd].i / eps;
799  s2_imag[dd] = 0.5 * xs2[dd].i / eps;
800  }
801  nn = 0;
802  for (; nn < 3; nn++) {
803  for (dd = 0; dd < 3; dd++) {
804  KExt_hh[ii + 9 * 3 * nn + 9 * dd] +=
805  g_w[gg] * N[3 * gg + nn] * normal_imag[dd] * traction[2];
806  KExt_hh[ii + 9 * 3 * nn + 9 * dd] +=
807  g_w[gg] * N[3 * gg + nn] * s1_imag[dd] * traction[0];
808  KExt_hh[ii + 9 * 3 * nn + 9 * dd] +=
809  g_w[gg] * N[3 * gg + nn] * s2_imag[dd] * traction[1];
810  }
811  }
812  if (KExt_edgeh != NULL) {
813  for (ee = 0; ee < 3; ee++) {
814  int nb_dofs_edge = NBEDGE_H1(order_edge[ee]);
815  for (nn = 0; nn < nb_dofs_edge; nn++) {
816  for (dd = 0; dd < 3; dd++) {
817  KExt_edgeh[ee][ii + 9 * 3 * nn + 9 * dd] +=
818  g_w[gg] * N_edge[ee][nb_dofs_edge * gg + nn] *
819  normal_imag[dd] * traction[2];
820  KExt_edgeh[ee][ii + 9 * 3 * nn + 9 * dd] +=
821  g_w[gg] * N_edge[ee][nb_dofs_edge * gg + nn] * s1_imag[dd] *
822  traction[0];
823  KExt_edgeh[ee][ii + 9 * 3 * nn + 9 * dd] +=
824  g_w[gg] * N_edge[ee][nb_dofs_edge * gg + nn] * s2_imag[dd] *
825  traction[1];
826  }
827  }
828  }
829  }
830  if (KExt_faceh != NULL) {
831  for (nn = 0; nn < nb_dofs_face; nn++) {
832  for (dd = 0; dd < 3; dd++) {
833  KExt_faceh[ii + 3 * 9 * nn + 9 * dd] +=
834  g_w[gg] * N_face[nb_dofs_face * gg + nn] * normal_imag[dd] *
835  traction[2];
836  KExt_faceh[ii + 3 * 9 * nn + 9 * dd] +=
837  g_w[gg] * N_face[nb_dofs_face * gg + nn] * s1_imag[dd] *
838  traction[0];
839  KExt_faceh[ii + 3 * 9 * nn + 9 * dd] +=
840  g_w[gg] * N_face[nb_dofs_face * gg + nn] * s2_imag[dd] *
841  traction[1];
842  }
843  }
844  }
845  }
846  }
848 }

◆ KExt_hh_hierarchical() [2/2]

MoFEMErrorCode KExt_hh_hierarchical ( double  eps,
int  order,
int *  order_edge,
double N,
double N_face,
double N_edge[],
double diffN,
double diffN_face,
double diffN_edge[],
double t,
double t_edge[],
double t_face,
double dofs_x,
double dofs_x_edge[],
double dofs_x_face,
double KExt_hh,
double KExt_egdeh[3],
double KExt_faceh,
int  g_dim,
const double g_w 
)

◆ KExt_hh_hierarchical_edge()

MoFEMErrorCode KExt_hh_hierarchical_edge ( double  eps,
int  order,
int *  order_edge,
double N,
double N_face,
double N_edge[],
double diffN,
double diffN_face,
double diffN_edge[],
double t,
double t_edge[],
double t_face,
double dofs_x,
double dofs_x_edge[],
double dofs_x_face,
double Khext_edge[3],
double KExt_edgeegde[3][3],
double KExt_faceedge[3],
int  g_dim,
const double g_w 
)

Definition at line 849 of file SurfacePressureComplexForLazy.cpp.

855  {
857  int gg, dd, ii, nn, ee, EE;
858  int nb_dofs_face = NBFACETRI_H1(order);
859  for (EE = 0; EE < 3; EE++) {
860  int nb_dofs_edge_EE = NBEDGE_H1(order_edge[EE]);
861  bzero(KExt_hedge[EE], 9 * 3 * nb_dofs_edge_EE * sizeof(double));
862  if (KExt_edgeedge != NULL) {
863  for (ee = 0; ee < 3; ee++) {
864  int nb_dofs_edge = NBEDGE_H1(order_edge[ee]);
865  bzero(KExt_edgeedge[EE][ee],
866  3 * nb_dofs_edge_EE * 3 * nb_dofs_edge * sizeof(double));
867  }
868  }
869  if (KExt_faceedge != NULL) {
870  bzero(KExt_faceedge[EE],
871  3 * nb_dofs_edge_EE * 3 * nb_dofs_face * sizeof(double));
872  }
873  }
874  for (gg = 0; gg < g_dim; gg++) {
875  double traction[3] = {0, 0, 0};
876  CHKERR Traction_hierarchical(order, order_edge, N, N_face, N_edge, t,
877  t_edge, t_face, traction, gg);
878  for (EE = 0; EE < 3; EE++) {
879  int nb_dofs_edge_EE = NBEDGE_H1(order_edge[EE]);
880  double *idofs_x_edge[3] = {NULL, NULL, NULL};
881  double idofs_x_edge_EE[3 * nb_dofs_edge_EE];
882  idofs_x_edge[EE] = idofs_x_edge_EE;
883  for (ii = 0; ii < 3 * nb_dofs_edge_EE; ii++) {
884  bzero(idofs_x_edge_EE, 3 * nb_dofs_edge_EE * sizeof(double));
885  idofs_x_edge_EE[ii] = eps;
886  __CLPK_doublecomplex xnormal[3], xs1[3], xs2[3];
887  CHKERR Normal_hierarchical(order, order_edge, // FIXME
888  order, order_edge, diffN, diffN_face,
889  diffN_edge, dofs_x, dofs_x_edge, dofs_x_face,
890  NULL, idofs_x_edge, NULL, xnormal, xs1, xs2,
891  gg);
892  CHKERR Base_scale(xnormal, xs1, xs2);
893  double normal_imag[3], s1_imag[3], s2_imag[3];
894  for (dd = 0; dd < 3; dd++) {
895  normal_imag[dd] = 0.5 * xnormal[dd].i / eps;
896  s1_imag[dd] = 0.5 * xs1[dd].i / eps;
897  s2_imag[dd] = 0.5 * xs2[dd].i / eps;
898  }
899  for (nn = 0; nn < 3; nn++) {
900  for (dd = 0; dd < 3; dd++) {
901  KExt_hedge[EE][ii + 3 * nb_dofs_edge_EE * 3 * nn +
902  3 * nb_dofs_edge_EE * dd] +=
903  g_w[gg] * N[3 * gg + nn] * normal_imag[dd] * traction[2];
904  KExt_hedge[EE][ii + 3 * nb_dofs_edge_EE * 3 * nn +
905  3 * nb_dofs_edge_EE * dd] +=
906  g_w[gg] * N[3 * gg + nn] * s1_imag[dd] * traction[0];
907  KExt_hedge[EE][ii + 3 * nb_dofs_edge_EE * 3 * nn +
908  3 * nb_dofs_edge_EE * dd] +=
909  g_w[gg] * N[3 * gg + nn] * s2_imag[dd] * traction[1];
910  }
911  }
912  if (KExt_edgeedge != NULL) {
913  for (ee = 0; ee < 3; ee++) {
914  int nb_dofs_edge = NBEDGE_H1(order_edge[ee]);
915  for (nn = 0; nn < nb_dofs_edge; nn++) {
916  for (dd = 0; dd < 3; dd++) {
917  KExt_edgeedge[EE][ee][ii + 3 * nb_dofs_edge_EE * 3 * nn +
918  3 * nb_dofs_edge_EE * dd] +=
919  g_w[gg] * N_edge[ee][nb_dofs_edge * gg + nn] *
920  normal_imag[dd] * traction[2];
921  KExt_edgeedge[EE][ee][ii + 3 * nb_dofs_edge_EE * 3 * nn +
922  3 * nb_dofs_edge_EE * dd] +=
923  g_w[gg] * N_edge[ee][nb_dofs_edge * gg + nn] * s1_imag[dd] *
924  traction[0];
925  KExt_edgeedge[EE][ee][ii + 3 * nb_dofs_edge_EE * 3 * nn +
926  3 * nb_dofs_edge_EE * dd] +=
927  g_w[gg] * N_edge[ee][nb_dofs_edge * gg + nn] * s2_imag[dd] *
928  traction[1];
929  }
930  }
931  }
932  }
933  if (KExt_faceedge != NULL) {
934  for (nn = 0; nn < nb_dofs_face; nn++) {
935  for (dd = 0; dd < 3; dd++) {
936  KExt_faceedge[EE][ii + 3 * nb_dofs_edge_EE * 3 * nn +
937  3 * nb_dofs_edge_EE * dd] +=
938  g_w[gg] * N_face[nb_dofs_face * gg + nn] * normal_imag[dd] *
939  traction[2];
940  KExt_faceedge[EE][ii + 3 * nb_dofs_edge_EE * 3 * nn +
941  3 * nb_dofs_edge_EE * dd] +=
942  g_w[gg] * N_face[nb_dofs_face * gg + nn] * s1_imag[dd] *
943  traction[0];
944  KExt_faceedge[EE][ii + 3 * nb_dofs_edge_EE * 3 * nn +
945  3 * nb_dofs_edge_EE * dd] +=
946  g_w[gg] * N_face[nb_dofs_face * gg + nn] * s2_imag[dd] *
947  traction[1];
948  }
949  }
950  }
951  }
952  }
953  }
955 }

◆ KExt_hh_hierarchical_face()

MoFEMErrorCode KExt_hh_hierarchical_face ( double  eps,
int  order,
int *  order_edge,
double N,
double N_face,
double N_edge[],
double diffN,
double diffN_face,
double diffN_edge[],
double t,
double t_edge[],
double t_face,
double dofs_x,
double dofs_x_edge[],
double dofs_x_face,
double KExt_hface,
double KExt_egdeface[3],
double KExt_faceface,
int  g_dim,
const double g_w 
)

Definition at line 957 of file SurfacePressureComplexForLazy.cpp.

963  {
965  int gg, dd, ii, nn, ee;
966  int nb_dofs_face = NBFACETRI_H1(order);
967  bzero(KExt_hface, 9 * 3 * nb_dofs_face * sizeof(double));
968  if (KExt_edgeface != NULL) {
969  for (ee = 0; ee < 3; ee++) {
970  int nb_dofs_edge = NBEDGE_H1(order_edge[ee]);
971  bzero(KExt_edgeface[ee],
972  3 * nb_dofs_face * 3 * nb_dofs_edge * sizeof(double));
973  }
974  }
975  if (KExt_faceface != NULL) {
976  bzero(KExt_faceface, 3 * nb_dofs_face * 3 * nb_dofs_face * sizeof(double));
977  }
978  for (gg = 0; gg < g_dim; gg++) {
979  double traction[3] = {0, 0, 0};
980  CHKERR Traction_hierarchical(order, order_edge, N, N_face, N_edge, t,
981  t_edge, t_face, traction, gg);
982  double idofs_x_face[3 * nb_dofs_face];
983  for (ii = 0; ii < 3 * nb_dofs_face; ii++) {
984  bzero(idofs_x_face, 3 * nb_dofs_face * sizeof(double));
985  idofs_x_face[ii] = eps;
986  __CLPK_doublecomplex xnormal[3], xs1[3], xs2[3];
988  order, order_edge, // FIXME
989  order, order_edge, diffN, diffN_face, diffN_edge, dofs_x, dofs_x_edge,
990  dofs_x_face, NULL, NULL, idofs_x_face, xnormal, xs1, xs2, gg);
991  CHKERR Base_scale(xnormal, xs1, xs2);
992  double normal_imag[3], s1_imag[3], s2_imag[3];
993  for (dd = 0; dd < 3; dd++) {
994  normal_imag[dd] = 0.5 * xnormal[dd].i / eps;
995  s1_imag[dd] = 0.5 * xs1[dd].i / eps;
996  s2_imag[dd] = 0.5 * xs2[dd].i / eps;
997  }
998  for (nn = 0; nn < 3; nn++) {
999  for (dd = 0; dd < 3; dd++) {
1000  KExt_hface[ii + 3 * nb_dofs_face * 3 * nn + 3 * nb_dofs_face * dd] +=
1001  g_w[gg] * N[3 * gg + nn] * normal_imag[dd] * traction[2];
1002  KExt_hface[ii + 3 * nb_dofs_face * 3 * nn + 3 * nb_dofs_face * dd] +=
1003  g_w[gg] * N[3 * gg + nn] * s1_imag[dd] * traction[0];
1004  KExt_hface[ii + 3 * nb_dofs_face * 3 * nn + 3 * nb_dofs_face * dd] +=
1005  g_w[gg] * N[3 * gg + nn] * s2_imag[dd] * traction[1];
1006  }
1007  }
1008  if (KExt_edgeface != NULL) {
1009  for (ee = 0; ee < 3; ee++) {
1010  int nb_dofs_edge = NBEDGE_H1(order_edge[ee]);
1011  for (nn = 0; nn < nb_dofs_edge; nn++) {
1012  for (dd = 0; dd < 3; dd++) {
1013  KExt_edgeface[ee][ii + 3 * nb_dofs_face * 3 * nn +
1014  3 * nb_dofs_face * dd] +=
1015  g_w[gg] * N_edge[ee][nb_dofs_edge * gg + nn] *
1016  normal_imag[dd] * traction[2];
1017  KExt_edgeface[ee][ii + 3 * nb_dofs_face * 3 * nn +
1018  3 * nb_dofs_face * dd] +=
1019  g_w[gg] * N_edge[ee][nb_dofs_edge * gg + nn] * s1_imag[dd] *
1020  traction[0];
1021  KExt_edgeface[ee][ii + 3 * nb_dofs_face * 3 * nn +
1022  3 * nb_dofs_face * dd] +=
1023  g_w[gg] * N_edge[ee][nb_dofs_edge * gg + nn] * s2_imag[dd] *
1024  traction[1];
1025  }
1026  }
1027  }
1028  }
1029  if (KExt_faceface != NULL) {
1030  for (nn = 0; nn < nb_dofs_face; nn++) {
1031  for (dd = 0; dd < 3; dd++) {
1032  KExt_faceface[ii + 3 * nb_dofs_face * 3 * nn +
1033  3 * nb_dofs_face * dd] +=
1034  g_w[gg] * N_face[nb_dofs_face * gg + nn] * normal_imag[dd] *
1035  traction[2];
1036  KExt_faceface[ii + 3 * nb_dofs_face * 3 * nn +
1037  3 * nb_dofs_face * dd] +=
1038  g_w[gg] * N_face[nb_dofs_face * gg + nn] * s1_imag[dd] *
1039  traction[0];
1040  KExt_faceface[ii + 3 * nb_dofs_face * 3 * nn +
1041  3 * nb_dofs_face * dd] +=
1042  g_w[gg] * N_face[nb_dofs_face * gg + nn] * s2_imag[dd] *
1043  traction[1];
1044  }
1045  }
1046  }
1047  }
1048  }
1050 }

◆ tetcircumcenter_tp()

void tetcircumcenter_tp ( double  a[3],
double  b[3],
double  c[3],
double  d[3],
double  circumcenter[3],
double xi,
double eta,
double zeta 
)

◆ Traction_hierarchical()

MoFEMErrorCode Traction_hierarchical ( int  order,
int *  order_edge,
double N,
double N_face,
double N_edge[],
double t,
double t_edge[],
double t_face,
double traction,
int  gg 
)

Definition at line 587 of file SurfacePressureComplexForLazy.cpp.

590  {
592  int dd, ee;
593  for (dd = 0; dd < 3; dd++)
594  traction[dd] = cblas_ddot(3, &N[gg * 3], 1, &t[dd], 3);
595  if (t_face != NULL) {
596  int nb_dofs_face = NBFACETRI_H1(order);
597  if (nb_dofs_face > 0) {
598  for (dd = 0; dd < 3; dd++)
599  traction[dd] += cblas_ddot(nb_dofs_face, &N_face[gg * nb_dofs_face], 1,
600  &t_face[dd], 3);
601  }
602  }
603  if (t_edge != NULL) {
604  ee = 0;
605  for (; ee < 3; ee++) {
606  if (t_edge[ee] == NULL)
607  continue;
608  int nb_dofs_edge = NBEDGE_H1(order_edge[ee]);
609  if (nb_dofs_edge > 0) {
610  for (dd = 0; dd < 3; dd++) {
611  traction[dd] +=
612  cblas_ddot(nb_dofs_edge, &(N_edge[ee][gg * nb_dofs_edge]), 1,
613  &(t_edge[ee][dd]), 3);
614  }
615  }
616  }
617  }
619 }

◆ tricircumcenter3d_tp()

void tricircumcenter3d_tp ( double  a[3],
double  b[3],
double  c[3],
double  circumcenter[3],
double xi,
double eta 
)
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
NBEDGE_H1
#define NBEDGE_H1(P)
Number of base function on edge for H1 space.
Definition: h1_hdiv_hcurl_l2.h:55
Base_scale
PetscErrorCode Base_scale(__CLPK_doublecomplex *xnormal, __CLPK_doublecomplex *xs1, __CLPK_doublecomplex *xs2)
Definition: fem_tools.c:741
__CLPK_doublecomplex::r
__CLPK_doublereal r
Definition: lapack_wrap.h:35
order
constexpr int order
Definition: dg_projection.cpp:18
Traction_hierarchical
MoFEMErrorCode Traction_hierarchical(int order, int *order_edge, double *N, double *N_face, double *N_edge[], double *t, double *t_edge[], double *t_face, double *traction, int gg)
Definition: SurfacePressureComplexForLazy.cpp:587
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
t
constexpr double t
plate stiffness
Definition: plate.cpp:58
N
const int N
Definition: speed_test.cpp:3
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
NBFACETRI_H1
#define NBFACETRI_H1(P)
Number of base function on triangle for H1 space.
Definition: h1_hdiv_hcurl_l2.h:60
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
Normal_hierarchical
PetscErrorCode Normal_hierarchical(int order_approx, int *order_edge_approx, int order, int *order_edge, double *diffN, double *diffN_face, double *diffN_edge[], double *dofs, double *dofs_edge[], double *dofs_face, double *idofs, double *idofs_edge[], double *idofs_face, __CLPK_doublecomplex *xnormal, __CLPK_doublecomplex *s1, __CLPK_doublecomplex *s2, int gg)
Complex normal.
Definition: fem_tools.c:569
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
__CLPK_doublecomplex::i
__CLPK_doublereal i
Definition: lapack_wrap.h:35
__CLPK_doublecomplex
Definition: lapack_wrap.h:34