Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90873259
manual-feengine.tex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Nov 5, 13:27
Size
2 KB
Mime Type
text/x-tex
Expires
Thu, Nov 7, 13:27 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19645592
Attached To
rAKA akantu
manual-feengine.tex
View Options
\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
Log In to Comment