43 #ifndef CURRENT_FE_MANIFOLD_HPP 44 #define CURRENT_FE_MANIFOLD_HPP 1
46 #include <boost/multi_array.hpp> 47 #include <lifev/core/fem/CurrentFE.hpp> 113 const Real* refCoor,
UInt currentId,
Real invArea = 1. );
135 virtual void update (
const std::vector<std::vector<Real> >& pts,
flag_Type upFlag);
157 template <
typename FunctorType>
169 template <
typename FunctorType>
180 return M_phiGeo[iGeoNode][quadNode];
186 ASSERT (M_tangentsUpdated,
"Tangents are not updated!\n");
187 return M_tangents[tangent][coordinate][quadNode];
193 ASSERT (M_normalUpdated,
"Normals are not updated!\n");
194 return M_normal[coordinate][quadNode];
200 ASSERT (M_metricUpdated,
"Metric is not updated!\n");
201 return M_metric[iCoor][jCoor][quadNode];
207 ASSERT (M_detMetricUpdated,
"Determinant of the metric is not updated!\n");
208 return M_detMetric[quadNode];
214 ASSERT (M_inverseMetricUpdated,
"Inverse metric is not updated!\n");
215 return M_inverseMetric[iCoor][jCoor][quadNode];
221 ASSERT (M_wRootDetMetricUpdated,
"Weighted metric determinant is not updated!\n");
222 return M_wRootDetMetric[quadNode];
265 template <
typename FunctorType>
268 ASSERT (M_quadNodesUpdated && M_wRootDetMetricUpdated,
"Error! Quadrature nodes and Jacobian Determinant have not been updated yet.\n");
272 result += f (M_quadNodes[iq][0], M_quadNodes[iq][1], M_quadNodes[iq][2]) * M_wRootDetMetric[iq];
278 template <
typename FunctorType>
281 ASSERT (M_quadNodesUpdated && M_normalUpdated && M_wRootDetMetricUpdated,
"Error! Normal and Jacobian Determinant have not been updated yet.\n");
289 f (M_quadNodes[iq][0], M_quadNodes[iq][1], M_quadNodes[iq][2], returnValues);
292 tmp += returnValues[iCoor] * M_normal[iCoor][iq];
294 result += tmp * M_wRootDetMetric[iq];
296 delete[] returnValues;
const flag_Type UPDATE_NORMALS(UPDATE_ONLY_NORMALS|UPDATE_ONLY_TANGENTS|UPDATE_ONLY_CELL_NODES)
GeometricMap - Structure for the geometrical mapping.
void computeNormal()
Computes the normal vectors in the quadrature nodes.
Real metric(UInt iCoor, UInt jCoor, UInt quadNode) const
Metric tensor on the quadrature points.
uint32_type flag_Type
bit-flag with up to 32 different flags
Real measure() const
Compute the measure of the current element.
Real tangent(UInt tangent, UInt coordinate, UInt quadNode) const
Values of the tangents on the quadrature points.
virtual ~CurrentFEManifold()
A class for a finite element on a manifold.
CurrentFEManifold(const ReferenceFE &refFE, const GeometricMap &geoMap)
Constructor without quadrature specification.
Real inverseMetric(UInt iCoor, UInt jCoor, UInt quadNode) const
Inverse of the metric tensor on the quadrature points.
void computeDetMetric()
Computes the determinant of the metric tensor in the quadrature nodes.
const flag_Type UPDATE_ONLY_METRIC(65536)
bool M_wRootDetMetricUpdated
const flag_Type UPDATE_ONLY_NORMALS(32768)
void updateInverseJacobian(const UInt &iQuadPt)
void computeWRootDetMetric()
Computes the square root of the determinant of the metric times the weight in the quadrature nodes...
CurrentFEManifold(const ReferenceFE &refFE, const GeometricMap &geoMap, const QuadratureRule &qr, const Real *refCoor, UInt currentId, Real invArea=1.)
Constructor used to create a static reference FE for hybrid elements.
void computeInverseMetric()
Computes the inverse of the metric tensor in the quadrature nodes.
const flag_Type UPDATE_ONLY_INV_METRIC(524288)
bool M_inverseMetricUpdated
boost::multi_array< Real, 1 > M_wRootDetMetric
boost::multi_array< Real, 3 > M_metric
boost::multi_array< Real, 3 > M_tangents
Normal and tangent vectors, metric tensor and weighted measure in the quadrature nodes.
const flag_Type UPDATE_ONLY_W_ROOT_DET_METRIC(262144)
Real normal(UInt coordinate, UInt quadNode) const
Values of the normal on the quadrature points.
virtual void update(const std::vector< std::vector< Real > > &pts, flag_Type upFlag)
Update method using only point coordinates.
void computeMetric()
Computes the metric in the quadrature nodes.
const flag_Type UPDATE_INV_METRIC(UPDATE_ONLY_INV_METRIC|UPDATE_METRIC|UPDATE_ONLY_DET_METRIC)
boost::multi_array< Real, 2 > M_normal
const flag_Type UPDATE_ONLY_TANGENTS(16384)
Real detMetric(UInt quadNode)
Determinant of the metric tensor on the quadrature points.
Real phiGeo(UInt iGeoNode, UInt quadNode) const
Values of the geometric basis functions on quadrature points (different from M_phi(iGeoNode,quadNode) only for Hybrid elements)
Real wRootDetMetric(UInt quadNode) const
Square root of the determinant of the metric times the weight on the quadrature points.
double Real
Generic real data.
CurrentFE - A primordial class for the assembly of the local matrices/vectors retaining the values on...
const flag_Type UPDATE_METRIC(UPDATE_ONLY_METRIC|UPDATE_ONLY_TANGENTS|UPDATE_ONLY_CELL_NODES)
CurrentFEManifold(const ReferenceFE &refFE, const GeometricMap &geoMap, const QuadratureRule &qr)
Full constructor with default quadrature.
The class for a reference Lagrangian finite element.
const flag_Type UPDATE_W_ROOT_DET_METRIC(UPDATE_ONLY_W_ROOT_DET_METRIC|UPDATE_METRIC|UPDATE_ONLY_DET_METRIC)
boost::multi_array< Real, 2 > M_phiGeo
Geometric map in the geometric nodes (different from M_phi only for Hybrid elements) ...
const flag_Type UPDATE_ONLY_DET_METRIC(131072)
CurrentFEManifold(const CurrentFEManifold &feManifold)
Copy constructor.
void computeTangents()
Computes the tangent vectors in the quadrature nodes.
boost::multi_array< Real, 3 > M_inverseMetric
QuadratureRule - The basis class for storing and accessing quadrature rules.
const flag_Type UPDATE_TANGENTS(UPDATE_ONLY_TANGENTS|UPDATE_ONLY_CELL_NODES)
bool M_tangentsUpdated
Check variables.
void coorMap(Real &x, Real &y, Real &z, Real xi, Real eta) const
Maps a point from the reference element to the current element.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Real normalIntegral(const FunctorType &f) const
Compute the integral of the normal component of a vector function f over the current element...
Real integral(const FunctorType &f) const
Compute the integral of a function f over the current element.
boost::multi_array< Real, 1 > M_detMetric
const flag_Type UPDATE_ONLY_CELL_NODES(1)