"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Functions/BF_Node_3.cpp" between
getdp-3.4.0-source.tgz and getdp-3.5.0-source.tgz

About: GetDP is a general finite element solver using mixed elements to discretize de Rham-type complexes in one, two and three dimensions.

BF_Node_3.cpp  (getdp-3.4.0-source.tgz):BF_Node_3.cpp  (getdp-3.5.0-source.tgz)
// GetDP - Copyright (C) 1997-2021 P. Dular and C. Geuzaine, University of Liege // GetDP - Copyright (C) 1997-2022 P. Dular and C. Geuzaine, University of Liege
// //
// See the LICENSE.txt file for license information. Please report all // See the LICENSE.txt file for license information. Please report all
// issues on https://gitlab.onelab.info/getdp/getdp/issues. // issues on https://gitlab.onelab.info/getdp/getdp/issues.
#include "ProData.h" #include "ProData.h"
#include "Message.h" #include "Message.h"
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* B F _ N o d e _ 3 */ /* B F _ N o d e _ 3 */
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* ------- */ /* ------- */
/* Edges */ /* Edges */
/* ------- */ /* ------- */
#define WrongNumEntity Message::Error("Wrong Edge number in 'BF_Node_3E'") #define WrongNumEntity Message::Error("Wrong Edge number in 'BF_Node_3E'")
void BF_Node_3E(struct Element * Element, int NumEntity, void BF_Node_3E(struct Element *Element, int NumEntity, double u, double v,
double u, double v, double w, double *s) double w, double *s)
{ {
switch (Element->Type) { switch(Element->Type) {
case LINE : case LINE_2 : case LINE:
case LINE_3 : case LINE_4 : case LINE_2:
case LINE_3:
case LINE_4:
switch(NumEntity) { switch(NumEntity) {
case 1 : *s = 0.25 * (1.-u) * (1.+u) * (-u) ; break ; case 1: *s = 0.25 * (1. - u) * (1. + u) * (-u); break;
default : WrongNumEntity ; default: WrongNumEntity;
} }
break ; break;
case TRIANGLE : case TRIANGLE_2 : case TRIANGLE:
case TRIANGLE_3 : case TRIANGLE_4 : case TRIANGLE_2:
switch(NumEntity) { case TRIANGLE_3:
case 1 : *s = (1.-u-v) * u * (1.-2*u-v) ; break ; case TRIANGLE_4:
case 2 : *s = (1.-u-v) * v * (1.-u-2*v) ; break ; switch(NumEntity) {
case 3 : *s = u * v * (u-v) ; break ; case 1: *s = (1. - u - v) * u * (1. - 2 * u - v); break;
default : WrongNumEntity ; case 2: *s = (1. - u - v) * v * (1. - u - 2 * v); break;
case 3: *s = u * v * (u - v); break;
default: WrongNumEntity;
} }
break ; break;
case QUADRANGLE : case QUADRANGLE_2 : case QUADRANGLE_2_8N : case QUADRANGLE:
case QUADRANGLE_3 : case QUADRANGLE_4 : case QUADRANGLE_2:
case QUADRANGLE_2_8N:
case QUADRANGLE_3:
case QUADRANGLE_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_Node_3E not ready for QUADRANGLE"); default: Message::Error("BF_Node_3E not ready for QUADRANGLE");
} }
break ; break;
case TETRAHEDRON : case TETRAHEDRON_2 : case TETRAHEDRON:
case TETRAHEDRON_3 : case TETRAHEDRON_4 : case TETRAHEDRON_2:
switch(NumEntity) { case TETRAHEDRON_3:
case 1 : *s = (1.-u-v-w) * u * (1.-2*u-v-w) ; break ; case TETRAHEDRON_4:
case 2 : *s = (1.-u-v-w) * v * (1.-u-2*v-w) ; break ; switch(NumEntity) {
case 3 : *s = (1.-u-v-w) * w * (1.-u-v-2*w) ; break ; case 1: *s = (1. - u - v - w) * u * (1. - 2 * u - v - w); break;
case 4 : *s = u * v * (u-v) ; break ; case 2: *s = (1. - u - v - w) * v * (1. - u - 2 * v - w); break;
case 5 : *s = u * w * (u-w) ; break ; case 3: *s = (1. - u - v - w) * w * (1. - u - v - 2 * w); break;
case 6 : *s = v * w * (v-w) ; break ; case 4: *s = u * v * (u - v); break;
default : WrongNumEntity ; case 5: *s = u * w * (u - w); break;
case 6: *s = v * w * (v - w); break;
default: WrongNumEntity;
} }
break ; break;
case HEXAHEDRON : case HEXAHEDRON_2 : case HEXAHEDRON_2_20N : case HEXAHEDRON:
case HEXAHEDRON_3 : case HEXAHEDRON_4 : case HEXAHEDRON_2:
case HEXAHEDRON_2_20N:
case HEXAHEDRON_3:
case HEXAHEDRON_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_Node_3E not ready for HEXAHEDRON"); default: Message::Error("BF_Node_3E not ready for HEXAHEDRON");
} }
break ; break;
case PRISM : case PRISM_2 : case PRISM_2_15N : case PRISM:
case PRISM_3 : case PRISM_4 : case PRISM_2:
case PRISM_2_15N:
case PRISM_3:
case PRISM_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_Node_3E not ready for PRISM"); default: Message::Error("BF_Node_3E not ready for PRISM");
} }
break ; break;
case PYRAMID : case PYRAMID_2 : case PYRAMID_2_13N : case PYRAMID:
case PYRAMID_3 : // case PYRAMID_4 case PYRAMID_2:
case PYRAMID_2_13N:
case PYRAMID_3: // case PYRAMID_4
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_Node_3E not ready for PYRAMID"); default: Message::Error("BF_Node_3E not ready for PYRAMID");
} }
break ; break;
default : default: Message::Error("Unknown type of Element in BF_Node_3E"); break;
Message::Error("Unknown type of Element in BF_Node_3E");
break ;
} }
if (Element->GeoElement->NumEdges[NumEntity-1] < 0) if(Element->GeoElement->NumEdges[NumEntity - 1] < 0) *s = -*s;
*s = -*s ;
} }
#undef WrongNumEntity #undef WrongNumEntity
/* -------- */ /* -------- */
/* Facets */ /* Facets */
/* -------- */ /* -------- */
#define WrongNumEntity Message::Error("Wrong Face number in 'BF_Node_3F'") #define WrongNumEntity Message::Error("Wrong Face number in 'BF_Node_3F'")
void BF_Node_3F(struct Element * Element, int NumEntity, void BF_Node_3F(struct Element *Element, int NumEntity, double u, double v,
double u, double v, double w, double *s) double w, double *s)
{ {
switch (Element->Type) { switch(Element->Type) {
case LINE:
case LINE : case LINE_2 : case LINE_2:
case LINE_3 : case LINE_4 : case LINE_3:
case LINE_4:
Message::Error("BF_Node_3F cannot be associated with this type of element"); Message::Error("BF_Node_3F cannot be associated with this type of element");
break; break;
case TRIANGLE : case TRIANGLE_2 : case TRIANGLE:
case TRIANGLE_3 : case TRIANGLE_4 : case TRIANGLE_2:
case TRIANGLE_3:
case TRIANGLE_4:
switch(NumEntity) { switch(NumEntity) {
case 1 : *s = (1.-u-v) * u * v ; break ; case 1: *s = (1. - u - v) * u * v; break;
default : WrongNumEntity ; default: WrongNumEntity;
} }
break ; break;
case QUADRANGLE : case QUADRANGLE_2 : case QUADRANGLE_2_8N : case QUADRANGLE:
case QUADRANGLE_3 : case QUADRANGLE_4 : case QUADRANGLE_2:
case QUADRANGLE_2_8N:
case QUADRANGLE_3:
case QUADRANGLE_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_Node_3F not ready for QUADRANGLE"); default: Message::Error("BF_Node_3F not ready for QUADRANGLE");
} }
break ; break;
case TETRAHEDRON : case TETRAHEDRON_2 : case TETRAHEDRON:
case TETRAHEDRON_3 : case TETRAHEDRON_4 : case TETRAHEDRON_2:
switch(NumEntity) { case TETRAHEDRON_3:
case 1 : *s = (1.-u-v-w) * u * w ; break ; case TETRAHEDRON_4:
case 2 : *s = (1.-u-v-w) * v * u ; break ; switch(NumEntity) {
case 3 : *s = (1.-u-v-w) * w * v ; break ; case 1: *s = (1. - u - v - w) * u * w; break;
case 4 : *s = u * v * w ; break ; case 2: *s = (1. - u - v - w) * v * u; break;
default : WrongNumEntity ; case 3: *s = (1. - u - v - w) * w * v; break;
case 4: *s = u * v * w; break;
default: WrongNumEntity;
} }
break ; break;
case HEXAHEDRON : case HEXAHEDRON_2 : case HEXAHEDRON_2_20N : case HEXAHEDRON:
case HEXAHEDRON_3 : case HEXAHEDRON_4 : case HEXAHEDRON_2:
case HEXAHEDRON_2_20N:
case HEXAHEDRON_3:
case HEXAHEDRON_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_Node_3F not ready for HEXAHEDRON"); default: Message::Error("BF_Node_3F not ready for HEXAHEDRON");
} }
break ; break;
case PRISM : case PRISM_2 : case PRISM_2_15N : case PRISM:
case PRISM_3 : case PRISM_4 : case PRISM_2:
case PRISM_2_15N:
case PRISM_3:
case PRISM_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_Node_3F not ready for PRISM"); default: Message::Error("BF_Node_3F not ready for PRISM");
} }
break ; break;
default : default: Message::Error("Unknown Element Type in BF_Node_3F"); break;
Message::Error("Unknown Element Type in BF_Node_3F");
break ;
} }
} }
#undef WrongNumEntity #undef WrongNumEntity
/* -------- */ /* -------- */
/* Volume */ /* Volume */
/* -------- */ /* -------- */
void BF_Node_3V(struct Element * Element, int NumEntity, void BF_Node_3V(struct Element *Element, int NumEntity, double u, double v,
double u, double v, double w, double *s) double w, double *s)
{ {
switch (Element->Type) { switch(Element->Type) {
case LINE:
case LINE : case LINE_2 : case LINE_2:
case LINE_3 : case LINE_4 : case LINE_3:
case TRIANGLE : case TRIANGLE_2 : case LINE_4:
case TRIANGLE_3 : case TRIANGLE_4 : case TRIANGLE:
case QUADRANGLE : case QUADRANGLE_2 : case QUADRANGLE_2_8N : case TRIANGLE_2:
case QUADRANGLE_3 : case QUADRANGLE_4 : case TRIANGLE_3:
case TETRAHEDRON : case TETRAHEDRON_2 : case TRIANGLE_4:
case TETRAHEDRON_3 : case TETRAHEDRON_4 : case QUADRANGLE:
case QUADRANGLE_2:
case QUADRANGLE_2_8N:
case QUADRANGLE_3:
case QUADRANGLE_4:
case TETRAHEDRON:
case TETRAHEDRON_2:
case TETRAHEDRON_3:
case TETRAHEDRON_4:
Message::Error("BF_Node_3V cannot be associated with this type of element"); Message::Error("BF_Node_3V cannot be associated with this type of element");
break; break;
case HEXAHEDRON : case HEXAHEDRON_2 : case HEXAHEDRON_2_20N : case HEXAHEDRON:
case HEXAHEDRON_3 : case HEXAHEDRON_4 : case HEXAHEDRON_2:
case HEXAHEDRON_2_20N:
case HEXAHEDRON_3:
case HEXAHEDRON_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_Node_3V not ready for HEXAHEDRON"); default: Message::Error("BF_Node_3V not ready for HEXAHEDRON");
} }
break ; break;
case PRISM : case PRISM_2 : case PRISM_2_15N : case PRISM:
case PRISM_3 : case PRISM_4 : case PRISM_2:
case PRISM_2_15N:
case PRISM_3:
case PRISM_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_Node_3V not ready for PRISM"); default: Message::Error("BF_Node_3V not ready for PRISM");
} }
break ; break;
default : default: Message::Error("Unknown type of Element in BF_Node_3V"); break;
Message::Error("Unknown type of Element in BF_Node_3V");
break ;
} }
} }
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* B F _ G r a d N o d e _ 3 */ /* B F _ G r a d N o d e _ 3 */
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* ------- */ /* ------- */
/* Edges */ /* Edges */
/* ------- */ /* ------- */
#define WrongNumEntity Message::Error("Wrong Edge number in 'BF_GradNode_3E'") #define WrongNumEntity Message::Error("Wrong Edge number in 'BF_GradNode_3E'")
void BF_GradNode_3E(struct Element * Element, int NumEntity, void BF_GradNode_3E(struct Element *Element, int NumEntity, double u, double v,
double u, double v, double w, double s[]) double w, double s[])
{ {
switch (Element->Type) { switch(Element->Type) {
case LINE : case LINE_2 : case LINE:
case LINE_3 : case LINE_4 : case LINE_2:
switch(NumEntity) { case LINE_3:
case 1 : s[0] = -0.25 + 0.75 * u * u ; s[1] = 0. ; s[2] = 0. ; break ; case LINE_4:
default : WrongNumEntity ; switch(NumEntity) {
} case 1:
break ; s[0] = -0.25 + 0.75 * u * u;
s[1] = 0.;
case TRIANGLE : case TRIANGLE_2 : s[2] = 0.;
case TRIANGLE_3 : case TRIANGLE_4 : break;
switch(NumEntity) { default: WrongNumEntity;
case 1 : s[0] = 1.0-6.0*u-2.0*v+6.0*u*u+6.0*u*v+v*v ; }
s[1] = -2.0*u+3.0*u*u+2.0*u*v ; break;
s[2] = 0. ;
break ;
case 2 : s[0] = -2.0*v+2.0*u*v+3.0*v*v ;
s[1] = 1.0-2.0*u-6.0*v+u*u+6.0*u*v+6.0*v*v ;
s[2] = 0. ;
break ;
case 3 : s[0] = 2.0*u*v-v*v ;
s[1] = u*u-2.0*u*v ;
s[2] = 0. ;
break ;
default : WrongNumEntity ;
}
break ;
case QUADRANGLE : case QUADRANGLE_2 : case QUADRANGLE_2_8N :
case QUADRANGLE_3 : case QUADRANGLE_4 :
switch(NumEntity) {
default : Message::Error("BF_GradNode_3E not ready for QUADRANGLE");
}
break ;
case TETRAHEDRON : case TETRAHEDRON_2 :
case TETRAHEDRON_3 : case TETRAHEDRON_4 :
switch(NumEntity) {
case 1 : s[0] = 1.0-6.0*u-2.0*v-2.0*w+6.0*u*u+6.0*u*v+6.0*u*w+v*v+2.0*v*w+w
*w ;
s[1] = -2.0*u+3.0*u*u+2.0*u*v+2.0*u*w ;
s[2] = -2.0*u+3.0*u*u+2.0*u*v+2.0*u*w ;
break ;
case 2 : s[0] = -2.0*v+2.0*u*v+3.0*v*v+2.0*v*w ;
s[1] = 1.0-2.0*u-6.0*v-2.0*w+u*u+6.0*u*v+2.0*u*w+6.0*v*v+6.0*v*w+
w*w ;
s[2] = -2.0*v+2.0*u*v+3.0*v*v+2.0*v*w ;
break ;
case 3 : s[0] = -2.0*w+2.0*u*w+2.0*v*w+3.0*w*w ;
s[1] = -2.0*w+2.0*u*w+2.0*v*w+3.0*w*w ;
s[2] = 1.0-2.0*u-2.0*v-6.0*w+u*u+2.0*u*v+6.0*u*w+v*v+6.0*v*w+6.0*w
*w ;
break ;
case 4 : s[0] = 2.0*u*v-v*v ;
s[1] = u*u-2.0*u*v ;
s[2] = 0.0 ;
break ;
case 5 : s[0] = 2.0*u*w-w*w ;
s[1] = 0.0 ;
s[2] = u*u-2.0*u*w ;
break ;
case 6 : s[0] = 0.0 ;
s[1] = 2.0*v*w-w*w ;
s[2] = v*v-2.0*v*w ;
break ;
default : WrongNumEntity ;
}
break ;
case HEXAHEDRON : case HEXAHEDRON_2 : case HEXAHEDRON_2_20N :
case HEXAHEDRON_3 : case HEXAHEDRON_4 :
switch(NumEntity) {
default : Message::Error("BF_GradNode_3E not ready for HEXAHEDRON");
}
break ;
case PRISM : case PRISM_2 : case PRISM_2_15N :
case PRISM_3 : case PRISM_4 :
switch(NumEntity) {
default : Message::Error("BF_GradNode_3E not ready for PRISM");
}
break ;
default :
Message::Error("Unknown type of Element in BF_GradNode_3E");
break ;
}
if (Element->GeoElement->NumEdges[NumEntity-1] < 0) { case TRIANGLE:
s[0] = - s[0] ; s[1] = - s[1] ; s[2] = - s[2] ; case TRIANGLE_2:
case TRIANGLE_3:
case TRIANGLE_4:
switch(NumEntity) {
case 1:
s[0] = 1.0 - 6.0 * u - 2.0 * v + 6.0 * u * u + 6.0 * u * v + v * v;
s[1] = -2.0 * u + 3.0 * u * u + 2.0 * u * v;
s[2] = 0.;
break;
case 2:
s[0] = -2.0 * v + 2.0 * u * v + 3.0 * v * v;
s[1] = 1.0 - 2.0 * u - 6.0 * v + u * u + 6.0 * u * v + 6.0 * v * v;
s[2] = 0.;
break;
case 3:
s[0] = 2.0 * u * v - v * v;
s[1] = u * u - 2.0 * u * v;
s[2] = 0.;
break;
default: WrongNumEntity;
}
break;
case QUADRANGLE:
case QUADRANGLE_2:
case QUADRANGLE_2_8N:
case QUADRANGLE_3:
case QUADRANGLE_4:
switch(NumEntity) {
default: Message::Error("BF_GradNode_3E not ready for QUADRANGLE");
}
break;
case TETRAHEDRON:
case TETRAHEDRON_2:
case TETRAHEDRON_3:
case TETRAHEDRON_4:
switch(NumEntity) {
case 1:
s[0] = 1.0 - 6.0 * u - 2.0 * v - 2.0 * w + 6.0 * u * u + 6.0 * u * v +
6.0 * u * w + v * v + 2.0 * v * w + w * w;
s[1] = -2.0 * u + 3.0 * u * u + 2.0 * u * v + 2.0 * u * w;
s[2] = -2.0 * u + 3.0 * u * u + 2.0 * u * v + 2.0 * u * w;
break;
case 2:
s[0] = -2.0 * v + 2.0 * u * v + 3.0 * v * v + 2.0 * v * w;
s[1] = 1.0 - 2.0 * u - 6.0 * v - 2.0 * w + u * u + 6.0 * u * v +
2.0 * u * w + 6.0 * v * v + 6.0 * v * w + w * w;
s[2] = -2.0 * v + 2.0 * u * v + 3.0 * v * v + 2.0 * v * w;
break;
case 3:
s[0] = -2.0 * w + 2.0 * u * w + 2.0 * v * w + 3.0 * w * w;
s[1] = -2.0 * w + 2.0 * u * w + 2.0 * v * w + 3.0 * w * w;
s[2] = 1.0 - 2.0 * u - 2.0 * v - 6.0 * w + u * u + 2.0 * u * v +
6.0 * u * w + v * v + 6.0 * v * w + 6.0 * w * w;
break;
case 4:
s[0] = 2.0 * u * v - v * v;
s[1] = u * u - 2.0 * u * v;
s[2] = 0.0;
break;
case 5:
s[0] = 2.0 * u * w - w * w;
s[1] = 0.0;
s[2] = u * u - 2.0 * u * w;
break;
case 6:
s[0] = 0.0;
s[1] = 2.0 * v * w - w * w;
s[2] = v * v - 2.0 * v * w;
break;
default: WrongNumEntity;
}
break;
case HEXAHEDRON:
case HEXAHEDRON_2:
case HEXAHEDRON_2_20N:
case HEXAHEDRON_3:
case HEXAHEDRON_4:
switch(NumEntity) {
default: Message::Error("BF_GradNode_3E not ready for HEXAHEDRON");
}
break;
case PRISM:
case PRISM_2:
case PRISM_2_15N:
case PRISM_3:
case PRISM_4:
switch(NumEntity) {
default: Message::Error("BF_GradNode_3E not ready for PRISM");
}
break;
default: Message::Error("Unknown type of Element in BF_GradNode_3E"); break;
} }
if(Element->GeoElement->NumEdges[NumEntity - 1] < 0) {
s[0] = -s[0];
s[1] = -s[1];
s[2] = -s[2];
}
} }
#undef WrongNumEntity #undef WrongNumEntity
/* -------- */ /* -------- */
/* Facets */ /* Facets */
/* -------- */ /* -------- */
#define WrongNumEntity Message::Error("Wrong Face number in 'BF_GradNode_3F'") #define WrongNumEntity Message::Error("Wrong Face number in 'BF_GradNode_3F'")
void BF_GradNode_3F(struct Element * Element, int NumEntity, void BF_GradNode_3F(struct Element *Element, int NumEntity, double u, double v,
double u, double v, double w, double s[]) double w, double s[])
{ {
switch (Element->Type) { switch(Element->Type) {
case LINE:
case LINE : case LINE_2 : case LINE_2:
case LINE_3 : case LINE_4 : case LINE_3:
Message::Error("BF_GradNode_3F cannot be associated with this type of elemen case LINE_4:
t"); Message::Error(
break ; "BF_GradNode_3F cannot be associated with this type of element");
break;
case TRIANGLE : case TRIANGLE_2 : case TRIANGLE:
case TRIANGLE_3 : case TRIANGLE_4 : case TRIANGLE_2:
switch(NumEntity) { case TRIANGLE_3:
case 1 : s[0] = v-2.0*u*v-v*v ; s[1] = u-u*u-2.0*u*v ; s[2] = 0. ; break ; case TRIANGLE_4:
default : WrongNumEntity ; switch(NumEntity) {
case 1:
s[0] = v - 2.0 * u * v - v * v;
s[1] = u - u * u - 2.0 * u * v;
s[2] = 0.;
break;
default: WrongNumEntity;
} }
break ; break;
case QUADRANGLE : case QUADRANGLE_2 : case QUADRANGLE_2_8N : case QUADRANGLE:
case QUADRANGLE_3 : case QUADRANGLE_4 : case QUADRANGLE_2:
case QUADRANGLE_2_8N:
case QUADRANGLE_3:
case QUADRANGLE_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_GradNode_3F not ready for QUADRANGLE"); default: Message::Error("BF_GradNode_3F not ready for QUADRANGLE");
} }
break ; break;
case TETRAHEDRON : case TETRAHEDRON_2 : case TETRAHEDRON:
case TETRAHEDRON_3 : case TETRAHEDRON_4 : case TETRAHEDRON_2:
switch(NumEntity) { case TETRAHEDRON_3:
case 1 : s[0] = w-2.0*u*w-v*w-w*w ; s[1] = -u*w ; s[2] = u-u*u-u*v-2.0*u*w case TETRAHEDRON_4:
; break ; switch(NumEntity) {
case 2 : s[0] = v-2.0*u*v-v*v-v*w ; s[1] = u-u*u-2.0*u*v-u*w ; s[2] = -u*v case 1:
; break ; s[0] = w - 2.0 * u * w - v * w - w * w;
case 3 : s[0] = -v*w ; s[1] = w-u*w-2.0*v*w-w*w ; s[2] = v-u*v-v*v-2.0*v*w s[1] = -u * w;
; break ; s[2] = u - u * u - u * v - 2.0 * u * w;
case 4 : s[0] = v*w ; s[1] = u*w ; s[2] = u*v ; break ; break;
default : WrongNumEntity ; case 2:
s[0] = v - 2.0 * u * v - v * v - v * w;
s[1] = u - u * u - 2.0 * u * v - u * w;
s[2] = -u * v;
break;
case 3:
s[0] = -v * w;
s[1] = w - u * w - 2.0 * v * w - w * w;
s[2] = v - u * v - v * v - 2.0 * v * w;
break;
case 4:
s[0] = v * w;
s[1] = u * w;
s[2] = u * v;
break;
default: WrongNumEntity;
} }
break ; break;
case HEXAHEDRON : case HEXAHEDRON_2 : case HEXAHEDRON_2_20N : case HEXAHEDRON:
case HEXAHEDRON_3 : case HEXAHEDRON_4 : case HEXAHEDRON_2:
case HEXAHEDRON_2_20N:
case HEXAHEDRON_3:
case HEXAHEDRON_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_GradNode_3F not ready for HEXAHEDRON"); default: Message::Error("BF_GradNode_3F not ready for HEXAHEDRON");
} }
break ; break;
case PRISM : case PRISM_2 : case PRISM_2_15N : case PRISM:
case PRISM_3 : case PRISM_4 : case PRISM_2:
case PRISM_2_15N:
case PRISM_3:
case PRISM_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_GradNode_3F not ready for PRISM"); default: Message::Error("BF_GradNode_3F not ready for PRISM");
} }
break ; break;
default : default: Message::Error("Unknown type of Element in BF_GradNode_3F"); break;
Message::Error("Unknown type of Element in BF_GradNode_3F");
break ;
} }
} }
#undef WrongNumEntity #undef WrongNumEntity
/* -------- */ /* -------- */
/* Volume */ /* Volume */
/* -------- */ /* -------- */
void BF_GradNode_3V(struct Element * Element, int NumEntity, void BF_GradNode_3V(struct Element *Element, int NumEntity, double u, double v,
double u, double v, double w, double s[]) double w, double s[])
{ {
switch (Element->Type) { switch(Element->Type) {
case LINE:
case LINE : case LINE_2 : case LINE_2:
case LINE_3 : case LINE_4 : case LINE_3:
case TRIANGLE : case TRIANGLE_2 : case LINE_4:
case TRIANGLE_3 : case TRIANGLE_4 : case TRIANGLE:
case QUADRANGLE : case QUADRANGLE_2 : case QUADRANGLE_2_8N : case TRIANGLE_2:
case QUADRANGLE_3 : case QUADRANGLE_4 : case TRIANGLE_3:
case TETRAHEDRON : case TETRAHEDRON_2 : case TRIANGLE_4:
case TETRAHEDRON_3 : case TETRAHEDRON_4 : case QUADRANGLE:
Message::Error("BF_GradNode_3V cannot be associated with this type of elemen case QUADRANGLE_2:
t"); case QUADRANGLE_2_8N:
case QUADRANGLE_3:
case QUADRANGLE_4:
case TETRAHEDRON:
case TETRAHEDRON_2:
case TETRAHEDRON_3:
case TETRAHEDRON_4:
Message::Error(
"BF_GradNode_3V cannot be associated with this type of element");
break; break;
case HEXAHEDRON : case HEXAHEDRON_2 : case HEXAHEDRON_2_20N : case HEXAHEDRON:
case HEXAHEDRON_3 : case HEXAHEDRON_4 : case HEXAHEDRON_2:
case HEXAHEDRON_2_20N:
case HEXAHEDRON_3:
case HEXAHEDRON_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_GradNode_3V not ready for HEXAHEDRON"); default: Message::Error("BF_GradNode_3V not ready for HEXAHEDRON");
} }
break ; break;
case PRISM : case PRISM_2 : case PRISM_2_15N : case PRISM:
case PRISM_3 : case PRISM_4 : case PRISM_2:
case PRISM_2_15N:
case PRISM_3:
case PRISM_4:
switch(NumEntity) { switch(NumEntity) {
default : Message::Error("BF_GradNode_3V not ready for PRISM"); default: Message::Error("BF_GradNode_3V not ready for PRISM");
} }
break ; break;
default : default: Message::Error("Unknown type of Element in BF_GradNode_3V"); break;
Message::Error("Unknown type of Element in BF_GradNode_3V");
break ;
} }
} }
 End of changes. 85 change blocks. 
273 lines changed or deleted 375 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)