Page MenuHomec4science

manual-feengine.tex
No OneTemporary

File Metadata

Created
Tue, Nov 5, 12:09

manual-feengine.tex

\chapter{FEEngine\index{FEEngine}}
\label{chap:feengine}
The \code{FEEngine} interface is dedicated to handle the
finite-element approximations and the numerical integration of the
weak form. As we will see in Chapter \ref{sect:smm}, \code{Model}
creates its own \code{FEEngine} object so the explicit creation of the
object is not required.
\section{Mathematical Operations\label{sect:fe:mathop}}
Using the \code{FEEngine} object, one can compute a interpolation, an
integration or a gradient. A simple example is given below.
\begin{cpp}
// having a FEEngine object
FEEngine *fem = new FEEngineTemplate<IntegratorGauss,ShapeLagrange>(my_mesh,
dim,
"my_fem");
// instead of this, a FEEngine object can be get using the model:
// model.getFEEngine()
//compute the gradient
Array<Real> u; //append the values you want
Array<Real> nablauq; //gradient array to be computed
// compute the gradient
fem->gradientOnIntegrationPoints(const Array<Real> &u,
Array<Real> &nablauq,
const UInt nb_degree_of_freedom,
ElementType type);
// interpolate
Array<Real> uq; //interpolated array to be computed
// compute the interpolation
fem->interpolateOnIntegrationPoints(const Array<Real> &u,
Array<Real> &uq,
UInt nb_degree_of_freedom,
ElementType type);
// interpolated function can be integrated over the elements
Array<Real> int_val_on_elem;
// integrate
fem->integrate(const Array<Real> &uq,
Array<Real> &int_uq,
UInt nb_degree_of_freedom,
ElementType type);
\end{cpp}
Another example below shows how to integrate stress and strain fields
over elements assigned to a particular material.
\begin{cpp}
UInt sp_dim = 3; //spatial dimension
UInt m = 1; //material index of interest
const ElementType type = _tetrahedron_4; //element type
// get the stress and strain arrays associated to the material index m
const Array<Real> & strain_vec = model.getMaterial(m).getGradU(type);
const Array<Real> & stress_vec = model.getMaterial(m).getStress(type);
// get the element filter for the material index
const Array<UInt> & elem_filter = model.getMaterial(m).getElementFilter(type);
// initialize the integrated stress and strain arrays
Array<Real> int_strain_vec(elem_filter.getSize(),
sp_dim*sp_dim, "int_of_strain");
Array<Real> int_stress_vec(elem_filter.getSize(),
sp_dim*sp_dim, "int_of_stress");
// integrate the fields
model.getFEEngine().integrate(strain_vec, int_strain_vec,
sp_dim*sp_dim, type, _not_ghost, elem_filter);
model.getFEEngine().integrate(stress_vec, int_stress_vec,
sp_dim*sp_dim, type, _not_ghost, elem_filter);
\end{cpp}
\input{manual-elements}

Event Timeline