FreeFem  3.5.x
Public Attributes | List of all members
fem::FEM Class Reference

this class drives the resolution of the pde using the Finite Element Method. More...

#include <femSolver.hpp>

Public Member Functions

 DECLARE_TYPE (femMesh::femPoint, femPoint)
 Typedefs.
 DECLARE_TYPE (femMesh::femTriangle, femTriangle)
 DECLARE_TYPE (creal *, cmatptr)
 DECLARE_TYPE (float *, matptr)
 FEM (femMeshPtr=0, int quadra=0)
 Constructors, destructor and methods.
 ~FEM ()
 destructor
float solvePDE (fcts *param, int how)
 solve the PDE
creal deriv (int m, creal *f, int ksolv, int i)
creal convect (creal *f, creal *u1, creal *u2, float dt, int i)
creal rhsConvect (creal *f, creal *u1, creal *u2, float dt, int i)
creal fctval (creal *f, float x, float y)
int getregion (int k)
creal gfemuser (creal what, creal *f, int i)
creal P1ctoP1 (creal *f, int i)
creal prodscalar (creal *f, creal *g)
creal ginteg (int, int, int, creal *, creal *, int)
creal binteg (int, int, int, creal *, creal *, int)
void initvarmat (int how, int flagcomplexe, int N, fcts *param)
void assemble (int how, int flagcomplexe, int N, int k, creal *a, creal *b, fcts *param)
void solvevarpde (int N, fcts *param, int how)

Public Attributes

float * normlx
float * normly
int N

Detailed Description

this class drives the resolution of the pde using the Finite Element Method.

Author
Christophe Prud'homme Chris.nosp@m.toph.nosp@m.e.Pru.nosp@m.dhom.nosp@m.me@an.nosp@m.n.ju.nosp@m.ssieu.nosp@m..fr
See Also
femMesh
Version
#$Id: femSolver.hpp,v 1.2 2001/07/12 14:11:57 prudhomm Exp $#

Constructor & Destructor Documentation

fem::FEM::FEM ( femMeshPtr  __t = 0,
int  quadra = 0 
)

Constructors, destructor and methods.

default constructor

:
__mesh( __t ),
__quadra( quadra ),
bug( 0 ),
nhow( 0 ),
nhow1( 0 ),
nhow2( 0 ),
a1c(),
rhsQuadra( 0 )
{
int i, k, baux, nquad;
ns = __mesh->getNumberOfPoints();
nt = __mesh->getNumberOfCells();
q = __mesh->rp;
me = __mesh->tr;
ng = __mesh->ng;
ngt = __mesh->ngt;
bdth = 0;
nquad = __quadra ? 3 * nt : ns;
for (k = 0; k < nt; k++)
for (i = 0; i <= 2; i++)
{
baux = abss ((me[k][i] - me[k][next[i]]));
bdth = (bdth > baux) ? bdth : baux;
}
a2.destroy();
a2.init (nhowmax);
for( int __i = 0; __i < nhowmax; __i++)
{
a1c[__i] = 0;
}
area = new float[nt];
normlx = new float[nquad];
normly = new float[nquad];
for (i = 0;i < nquad;i++)
{
normlx[i] = 0.F;
normly[i] = 0.F;
}
nhow1 = 0;
nhow2 = 0;
connectiv ();
flag.fem = 1;
doedge ();
buildarea();
}

Member Function Documentation

int fem::FEM::getregion ( int  k)
Returns
the ngt of a femTriangle to which belongs vertex k
{
return __mesh->ngt[listHead[i]];
}
float fem::FEM::solvePDE ( fcts param,
int  how 
)

solve the PDE

Parameters
paramcontain all the possible data for computation
howdefines if the P1 quadrature
{
long nsl = ((long) ns) * (2 * ((long) bdth) + 1);
int factorize = 1;
if (how > nhowmax)
erreur ("Too many linear systems");
if (how < 0)
{
factorize = 0;
how = -how;
if (((how > nhow1) && (N == 1)) || ((how > nhow2) && (N == 2)))
{
sprintf (errbuf, "solve(..,'-%d') refers to an inexistant system", how);
erreur (errbuf);
}
}
if (((how > nhow1) && (N == 1)) || ((how > nhow2) && (N == 2)))
{
switch (N)
{
case 1:
if (flag.complexe)
a1c[nhow1++] = new creal[nsl];
else
a1[nhow1++] = new float[nsl];
break;
case 2:
a2[nhow2++].init (nsl);
break;
}
}
if (flag.complexe)
{
if (N == 1)
return pdeian (a1c[how - 1], param->sol1c, param->f1c, param->g1c, param->p1c, param->b1c,
param->nuxx1c, param->nuxy1c, param->nuyx1c, param->nuyy1c, param->a11c,
param->a21c, param->c1c, factorize);
else if (N == 2)
return pdeian (a2[how - 1], param->sol2, param->f2, param->g2, param->p2, param->b2,
param->nuxx2, param->nuxy2, param->nuyx2, param->nuyy2, param->a12,
param->a22, param->c2, factorize);
else
return -1.F;
}
else
{
if (N == 1)
return pdeian (a1[how - 1], param->sol1, param->f1, param->g1, param->p1, param->b1,
param->nuxx1, param->nuxy1, param->nuyx1, param->nuyy1, param->a11,
param->a21, param->c1, factorize);
else if (N == 2)
return pdeian (a2[how - 1], param->sol2, param->f2, param->g2, param->p2, param->b2,
param->nuxx2, param->nuxy2, param->nuyx2, param->nuyy2, param->a12,
param->a22, param->c2, factorize);
else
return -1.F;
}
}

The documentation for this class was generated from the following files:
This is the FreeFEM reference manual
Provided by The KFEM project