/*--------------------------------------------------------------------------*/
/* ALBERTA: an Adaptive multi Level finite element toolbox using */
/* Bisectioning refinement and Error control by Residual */
/* Techniques for scientific Applications */
/* */
/* file: lagrange_4_3d.c */
/* */
/* description: piecewise quartic Lagrange elements in 3d */
/* */
/*--------------------------------------------------------------------------*/
/* */
/* authors: Alfred Schmidt */
/* Zentrum fuer Technomathematik */
/* Fachbereich 3 Mathematik/Informatik */
/* Universitaet Bremen */
/* Bibliothekstr. 2 */
/* D-28359 Bremen, Germany */
/* */
/* Kunibert G. Siebert */
/* Institut fuer Mathematik */
/* Universitaet Augsburg */
/* Universitaetsstr. 14 */
/* D-86159 Augsburg, Germany */
/* */
/* http://www.mathematik.uni-freiburg.de/IAM/ALBERTA */
/* */
/* (c) by A. Schmidt and K.G. Siebert (1996-2003) */
/* */
/*--------------------------------------------------------------------------*/
#define N_BAS4_3D 35
static const REAL bary4_3d[N_BAS4_3D][N_LAMBDA] = {
{ 1.0, 0.0, 0.0, 0.0},
{ 0.0, 1.0, 0.0, 0.0},
{ 0.0, 0.0, 1.0, 0.0},
{ 0.0, 0.0, 0.0, 1.0},
{3.0/4.0, 1.0/4.0, 0.0, 0.0},
{ 0.5, 0.5, 0.0, 0.0},
{1.0/4.0, 3.0/4.0, 0.0, 0.0},
{3.0/4.0, 0.0, 1.0/4.0, 0.0},
{ 0.5, 0.0, 0.5, 0.0},
{1.0/4.0, 0.0, 3.0/4.0, 0.0},
{3.0/4.0, 0.0, 0.0, 1.0/4.0},
{ 0.5, 0.0, 0.0, 0.5},
{1.0/4.0, 0.0, 0.0, 3.0/4.0},
{ 0.0, 3.0/4.0, 1.0/4.0, 0.0},
{ 0.0, 0.5, 0.5, 0.0},
{ 0.0, 1.0/4.0, 3.0/4.0, 0.0},
{ 0.0, 3.0/4.0, 0.0, 1.0/4.0},
{ 0.0, 0.5, 0.0, 0.5},
{ 0.0, 1.0/4.0, 0.0, 3.0/4.0},
{ 0.0, 0.0, 3.0/4.0, 1.0/4.0},
{ 0.0, 0.0, 0.5, 0.5},
{ 0.0, 0.0, 1.0/4.0, 3.0/4.0},
{ 0.0, 1.0/2.0, 1.0/4.0, 1.0/4.0},
{ 0.0, 1.0/4.0, 1.0/2.0, 1.0/4.0},
{ 0.0, 1.0/4.0, 1.0/4.0, 1.0/2.0},
{1.0/2.0, 0.0, 1.0/4.0, 1.0/4.0},
{1.0/4.0, 0.0, 1.0/2.0, 1.0/4.0},
{1.0/4.0, 0.0, 1.0/4.0, 1.0/2.0},
{1.0/2.0, 1.0/4.0, 0.0, 1.0/4.0},
{1.0/4.0, 1.0/2.0, 0.0, 1.0/4.0},
{1.0/4.0, 1.0/4.0, 0.0, 1.0/2.0},
{1.0/2.0, 1.0/4.0, 1.0/4.0, 0.0},
{1.0/4.0, 1.0/2.0, 1.0/4.0, 0.0},
{1.0/4.0, 1.0/4.0, 1.0/2.0, 0.0},
{1.0/4.0, 1.0/4.0, 1.0/4.0, 1.0/4.0}};
/*--------------------------------------------------------------------------*/
/* basisfunction at vertex 0 */
/*--------------------------------------------------------------------------*/
static REAL phi4v0_3d(const REAL l[N_LAMBDA])
{
return((((32.0*l[0] - 48.0)*l[0] + 22.0)*l[0] - 3.0)*l[0]/3.0);
}
static const REAL *grd_phi4v0_3d(const REAL l[N_LAMBDA])
{
static REAL grd[N_LAMBDA];
grd[0] = ((128.0*l[0] - 144.0)*l[0] + 44.0)*l[0]/3.0 - 1.0;
return((const REAL *) grd);
}
static const REAL (*D2_phi4v0_3d(const REAL l[N_LAMBDA]))[N_LAMBDA]
{
static REAL D2[N_LAMBDA][N_LAMBDA] = {{0.0}};
D2[0][0] = (128.0*l[0] - 96.0)*l[0] + 44.0/3.0;
return((const REAL (*)[N_LAMBDA]) D2);
}
/*--------------------------------------------------------------------------*/
/* basisfunction at vertex 1 */
/*--------------------------------------------------------------------------*/
static REAL phi4v1_3d(const REAL l[N_LAMBDA])
{
return((((32.0*l[1] - 48.0)*l[1] + 22.0)*l[1] - 3.0)*l[1]/3.0);
}
static const REAL *grd_phi4v1_3d(const REAL l[N_LAMBDA])
{
static REAL grd[N_LAMBDA];
grd[1] = ((128.0*l[1] - 144.0)*l[1] + 44.0)*l[1]/3.0 - 1.0;
return((const REAL *) grd);
}
static const REAL (*D2_phi4v1_3d(const REAL l[N_LAMBDA]))[N_LAMBDA]
{
static REAL D2[N_LAMBDA][N_LAMBDA];
D2[1][1] = (128.0*l[1] - 96.0)*l[1] + 44.0/3.0;
return((const REAL (*)[N_LAMBDA]) D2);
}
/*--------------------------------------------------------------------------*/
/* basisfunction at vertex 2 */
/*--------------------------------------------------------------------------*/
static REAL phi4v2_3d(const REAL l[N_LAMBDA])
{
return((((32.0*l[2] - 48.0)*l[2] + 22.0)*l[2] - 3.0)*l[2]/3.0);
}
static const REAL *grd_phi4v2_3d(const REAL l[N_LAMBDA])
{
static REAL grd[N_LAMBDA];
grd[2] = ((128.0*l[2] - 144.0)*l[2] + 44.0)*l[2]/3.0 - 1.0;
return((const REAL *) grd);
}
static const REAL (*D2_phi4v2_3d(const REAL l[N_LAMBDA]))[N_LAMBDA]
{
static REAL D2[N_LAMBDA][N_LAMBDA];
D2[2][2] = (128.0*l[2] - 96.0)*l[2] + 44.0/3.0;
return((const REAL (*)[N_LAMBDA]) D2);
}
/*--------------------------------------------------------------------------*/
/* basisfunction at vertex 3 */
/*--------------------------------------------------------------------------*/
static REAL phi4v3_3d(const REAL l[N_LAMBDA])
{
return((((32.0*l[3] - 48.0)*l[3] + 22.0)*l[3] - 3.0)*l[3]/3.0);
}
static const REAL *grd_phi4v3_3d(const REAL l[N_LAMBDA])
{
static REAL grd[N_LAMBDA];
grd[3] = ((128.0*l[3] - 144.0)*l[3] + 44.0)*l[3]/3.0 - 1.0;
return((const REAL *) grd);
}
static const REAL (*D2_phi4v3_3d(const REAL l[N_LAMBDA]))[N_LAMBDA]
{
static REAL D2[N_LAMBDA][N_LAMBDA];
D2[3][3] = (128.0*l[3] - 96.0)*l[3] + 44.0/3.0;
return((const REAL (*)[N_LAMBDA]) D2);
}
/*--------------------------------------------------------------------------*/
/* basisfunction 0 at edge 0 */
/*--------------------------------------------------------------------------*/
static REAL phi4e00_3d(const REAL l[N_LAMBDA])
{
return(((128.0*l[0] - 96.0)*l[0] + 16.0)*l[0]*l[1]/3.0);
}
static const REAL *grd_phi4e00_3d(const REAL l[N_LAMBDA])
{
static REAL grd[N_LAMBDA];
grd[0] = ((128*l[0] - 64.0)*l[0] + 16.0/3.0)*l[1];
grd[1] = ((128*l[0] - 96.0)*l[0] + 16.0)*l[0]/3.0;
return((const REAL *) grd);
}
static const REAL (*D2_phi4e00_3d(const REAL l[N_LAMBDA]))[N_LAMBDA]
{
static REAL D2[N_LAMBDA][N_LAMBDA];
D2[0][0] = (256.0*l[0] - 64.0)*l[1];
D2[0][1] = D2[1][0] = (128.0*l[0] - 64.0)*l[0] + 16.0/3.0;
return((const REAL (*)[N_LAMBDA]) D2);
}
/*--------------------------------------------------------------------------*/
/* basisfunction 1 at edge 0 */
/*--------------------------------------------------------------------------*/
static REAL phi4e01_3d(const REAL l[N_LAMBDA])
{
return((4.0*l[0] - 1.0)*l[0]*(4.0*l[1] - 1.0)*l[1]*4.0);
}
static const REAL *grd_phi4e01_3d(const REAL l[N_LAMBDA])
{
static REAL grd[