27 #include <lifev/core/fem/CurrentFEManifold.hpp> 98 M_phi[iDof][0][iterQuad] *= invArea;
103 M_phiGeo[iGeoNode][iterQuad] = geoMap.phi (iGeoNode, M_quadRule->quadPointCoor (iterQuad) );
110 M_cellNodes[iNode][iCoor] = refCoor[nDimensions * iNode + iCoor];
147 setQuadRule (*bdFE.M_quadRule);
157 CurrentFE::coorMap (x, y, z, xi, eta, 0.);
162 ASSERT (M_wRootDetMetricUpdated,
"Weighted root of metric determinant is not updated!");
167 meas += M_wRootDetMetric[quadNode];
174 CurrentFE::update (pts, upFlag);
219 ASSERT (M_cellNodesUpdated,
"Missing update: cellNodes\n");
220 ASSERT (M_dphiGeometricMapUpdated,
"Missing update: dphiGeometricMap");
226 M_tangents[iTangent][iCoor][iq] = 0.0;
229 M_tangents[iTangent][iCoor][iq] += M_cellNodes[iNode][iCoor] * M_dphiGeometricMap[iNode][iTangent][iq];
238 ASSERT (M_tangentsUpdated,
"Missing update: tangents\n");
248 n1 = M_tangents[0][1][iq];
249 n2 = - M_tangents[0][0][iq];
251 norm = sqrt (n1 * n1 + n2 * n2);
252 ASSERT (norm > 0,
"Error! Something went wrong while computing normals.\n");
254 M_normal[0][iq] = n1 / norm;
255 M_normal[1][iq] = n2 / norm;
262 n1 = M_tangents[0][1][iq] * M_tangents[1][2][iq] - M_tangents[0][2][iq] * M_tangents[1][1][iq];
263 n2 = M_tangents[0][2][iq] * M_tangents[1][0][iq] - M_tangents[0][0][iq] * M_tangents[1][2][iq];
264 n3 = M_tangents[0][0][iq] * M_tangents[1][1][iq] - M_tangents[0][1][iq] * M_tangents[1][0][iq];
266 norm = sqrt (n1 * n1 + n2 * n2 + n3 * n3);
267 ASSERT (norm > 0,
"Error! Something went wrong while computing normals.\n");
269 M_normal[0][iq] = n1 / norm;
270 M_normal[1][iq] = n2 / norm;
271 M_normal[2][iq] = n3 / norm;
275 ASSERT (0,
"No rule to compute normal vector for this dimension.");
283 ASSERT (M_tangentsUpdated,
"Missing update: tangents\n");
289 M_metric[iTangent][iTangent][iq] = 0.0;
292 M_metric[iTangent][iTangent][iq] += M_tangents[iTangent][iCoor][iq] * M_tangents[iTangent][iCoor][iq];
296 for (
UInt jTangent (0); jTangent < iTangent; ++jTangent)
298 M_metric[iTangent][jTangent][iq] = 0.0;
301 M_metric[iTangent][jTangent][iq] += M_tangents[iTangent][iCoor][iq] * M_tangents[jTangent][iCoor][iq];
303 M_metric[jTangent][iTangent][iq] = M_metric[iTangent][jTangent][iq];
312 ASSERT (M_metricUpdated,
"Missing update: metric\n");
319 M_detMetric[iq] = M_metric[0][0][iq];
322 M_detMetric[iq] = M_metric[0][0][iq] * M_metric[1][1][iq] - M_metric[0][1][iq] * M_metric[1][0][iq];
325 ASSERT (0,
"No rule to compute determinant of the metric for this dimension.\n");
333 ASSERT (M_metricUpdated,
"Missing update: metric\n");
334 ASSERT (M_detMetricUpdated,
"Missing update: detMetric\n");
341 M_inverseMetric[0][0][iq] = 1. / M_metric[0][0][iq];
345 M_inverseMetric[0][0][iq] = M_metric[1][1][iq] / M_detMetric[iq];
346 M_inverseMetric[1][1][iq] = M_metric[0][0][iq] / M_detMetric[iq];
349 M_inverseMetric[0][1][iq] = M_inverseMetric[1][0][iq] = - M_metric[0][1][iq] / M_detMetric[iq];
352 ASSERT (0,
"No rule to compute the inverse of the metric for this dimension.\n");
361 ASSERT (M_metricUpdated,
"Missing update: metric\n");
362 ASSERT (M_detMetricUpdated,
"Missing update: detMetric\n");
366 M_wRootDetMetric[iq] = std::sqrt (M_detMetric[iq]) * M_quadRule->weight (iq);
GeometricMap - Structure for the geometrical mapping.
void computeNormal()
Computes the normal vectors in the quadrature nodes.
uint32_type flag_Type
bit-flag with up to 32 different flags
QuadratureRule * M_quadRule
Real measure() const
Compute the measure of the current element.
A class for a finite element on a manifold.
CurrentFEManifold(const ReferenceFE &refFE, const GeometricMap &geoMap)
Constructor without quadrature specification.
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
const flag_Type UPDATE_ONLY_W_ROOT_DET_METRIC(262144)
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_ONLY_TANGENTS(16384)
double Real
Generic real data.
CurrentFE - A primordial class for the assembly of the local matrices/vectors retaining the values on...
CurrentFEManifold(const ReferenceFE &refFE, const GeometricMap &geoMap, const QuadratureRule &qr)
Full constructor with default quadrature.
The class for a reference Lagrangian finite element.
const UInt nDimensions(NDIM)
const flag_Type UPDATE_ONLY_DET_METRIC(131072)
CurrentFEManifold(const CurrentFEManifold &feManifold)
Copy constructor.
CurrentFE(const ReferenceFE &refFE, const GeometricMap &geoMap)
Constructor without quadrature specification.
CurrentFE(const ReferenceFE &refFE, const GeometricMap &geoMap, const QuadratureRule &qr)
Full constructor with default quadrature.
void computeTangents()
Computes the tangent vectors in the quadrature nodes.
QuadratureRule - The basis class for storing and accessing quadrature rules.
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)