Package sfc :: Package geometry :: Module affine_map
[hide private]
[frames] | no frames]

Module affine_map

source code

This module contains prewritten code for the computation of the geometry mapping to the reference cell.

Functions [hide private]
 
gen_geometry_code(nsd, detG=True, GinvT=False) source code
 
GinvT_string(nsd) source code
Variables [hide private]
  geometry_string1d = "...
  detG_string1d = "...
  GinvT_string1d = "...
  geometry_string2d = "...
  detG_string2d = "...
  GinvT_string2d = "...
  geometry_string3d = "...
  detG_string3d = "...
  GinvT_string3d = "...
Variables Details [hide private]

geometry_string1d

Value:
"""\
// coordinates
double x0 = c.coordinates[0][0];
double x1 = c.coordinates[1][0];

// affine map
double G00 = x1 - x0;
"""

detG_string1d

Value:
"""\
double detG_tmp = G00;
double detG = fabs(detG_tmp);
"""

GinvT_string1d

Value:
"""\
double GinvT00 =  1.0 / G00;
"""

geometry_string2d

Value:
"""\
// coordinates
double x0 = c.coordinates[0][0]; double y0 = c.coordinates[0][1];
double x1 = c.coordinates[1][0]; double y1 = c.coordinates[1][1];
double x2 = c.coordinates[2][0]; double y2 = c.coordinates[2][1];

// affine map
double G00 = x1 - x0;
...

detG_string2d

Value:
"""\
double detG_tmp = G00*G11-G01*G10;
double detG = fabs(detG_tmp);
"""

GinvT_string2d

Value:
"""\
double GinvT00 =  G11 / detG_tmp;
double GinvT01 = -G10 / detG_tmp;
double GinvT10 = -G01 / detG_tmp;
double GinvT11 =  G00 / detG_tmp;
"""

geometry_string3d

Value:
"""\
// coordinates
double x0 = c.coordinates[0][0]; double y0 = c.coordinates[0][1]; doub\
le z0 = c.coordinates[0][2];
double x1 = c.coordinates[1][0]; double y1 = c.coordinates[1][1]; doub\
le z1 = c.coordinates[1][2];
double x2 = c.coordinates[2][0]; double y2 = c.coordinates[2][1]; doub\
le z2 = c.coordinates[2][2];
...

detG_string3d

Value:
"""\
double detG_tmp =    G00*(G11*G22-G21*G12)
                   - G01*(G10*G22-G20*G12)
                   + G02*(G10*G21-G20*G11);
double detG = fabs(detG_tmp);
"""

GinvT_string3d

Value:
"""\
double GinvT00 = ( G11*G22-G12*G21) / detG_tmp;
double GinvT01 = (-G22*G10+G12*G20) / detG_tmp;
double GinvT02 = (-G11*G20+G10*G21) / detG_tmp;
double GinvT10 = ( G02*G21-G22*G01) / detG_tmp;
double GinvT11 = ( G22*G00-G02*G20) / detG_tmp;
double GinvT12 = (-G21*G00+G20*G01) / detG_tmp;
double GinvT20 = ( G12*G01-G11*G02) / detG_tmp;
...