857 int gg,
dd, ii, nn, ee, EE;
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));
869 if (KExt_faceedge != NULL) {
870 bzero(KExt_faceedge[EE],
871 3 * nb_dofs_edge_EE * 3 * nb_dofs_face *
sizeof(
double));
874 for (gg = 0; gg < g_dim; gg++) {
875 double traction[3] = {0, 0, 0};
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;
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,
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;
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];
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] *
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] *
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] *
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] *
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] *