37 #ifndef ETCURRENTBDFE_H 38 #define ETCURRENTBDFE_H 1
40 #include <lifev/core/LifeV.hpp> 41 #include <lifev/eta/fem/ETCurrentFE.hpp> 42 #include <lifev/core/array/MatrixSmall.hpp> 43 #include <lifev/core/array/VectorSmall.hpp> 50 template<
UInt spaceDim>
153 M_refTangents = tangents;
156 template<
typename ElementType>
165 for (
UInt j (0); j < spaceDim; ++j)
167 M_cellNode[i][j] = cell.point (i).coordinate (j);
173 for (
UInt iDim (0); iDim < spaceDim; ++iDim)
175 M_quadNode[iq][iDim] = 0.0;
179 M_quadNode[iq][iDim] += M_cellNode[iDof][iDim] * M_phiMap[iq][iDof];
185 Real partialSum (0.0);
188 for (
UInt iDim (0); iDim < spaceDim; ++iDim)
190 for (
UInt jDim (0); jDim < spaceDim; ++jDim)
195 partialSum += M_cellNode[iMap][iDim] * M_dphiGeometricMap[iq][iMap][jDim];
197 M_jacobian[iq][iDim][jDim] = partialSum;
205 for (
UInt iDim (0); iDim < spaceDim - 1; ++iDim)
207 for (
UInt jDim (0); jDim < spaceDim; ++jDim)
210 for (
UInt kDim (0); kDim < spaceDim; ++kDim)
212 partialSum += M_jacobian[iq][jDim][kDim] * M_refTangents[iDim][kDim];
214 M_tangents[iq][iDim][jDim] = partialSum;
221 for (
UInt iDim (0); iDim < spaceDim - 1; ++iDim)
223 for (
UInt jDim (0); jDim < spaceDim - 1; ++jDim)
226 for (
UInt kDim (0); kDim < spaceDim; ++kDim)
228 partialSum += M_tangents[iq][iDim][kDim] * M_tangents[iq][jDim][kDim];
230 M_metricTensor[iq][iDim][jDim] = partialSum;
238 M_measure[iq] = std::sqrt ( M_metricTensor[iq][0][0] * M_metricTensor[iq][1][1]
239 - M_metricTensor[iq][0][1] * M_metricTensor[iq][1][0]);
244 M_wMeas[iq] = M_measure[iq] * M_quadrature->weight (iq);
254 n0 = M_tangents[iq][0][1] * M_tangents[iq][1][2]
255 - M_tangents[iq][0][2] * M_tangents[iq][1][1];
256 n1 = M_tangents[iq][0][2] * M_tangents[iq][1][0]
257 - M_tangents[iq][0][0] * M_tangents[iq][1][2];
258 n2 = M_tangents[iq][0][0] * M_tangents[iq][1][1]
259 - M_tangents[iq][0][1] * M_tangents[iq][1][0];
260 nnorm = std::sqrt (n0 * n0 + n1 * n1 + n2 * n2);
262 M_normal[iq][0] = -n0 / nnorm;
263 M_normal[iq][1] = -n1 / nnorm;
264 M_normal[iq][2] = -n2 / nnorm;
272 M_phiMap.resize (M_nbQuadPt);
275 M_phiMap[q].resize (M_nbMapDof);
278 M_phiMap[q][i] = M_geometricMap->phi (i, M_quadrature->quadPointCoor (q) );
283 M_dphiGeometricMap.resize (M_nbQuadPt);
286 M_dphiGeometricMap[q].resize (M_nbMapDof);
289 M_dphiGeometricMap[q][i].resize (spaceDim);
290 for (
UInt j (0); j < spaceDim; ++j)
292 M_dphiGeometricMap[q][i][j] = M_geometricMap->dPhi (i, j, M_quadrature->quadPointCoor (q) );
297 M_cellNode.resize (M_nbMapDof);
300 M_cellNode[i].resize (spaceDim);
303 M_quadNode.resize (M_nbQuadPt);
305 M_jacobian.resize (M_nbQuadPt);
308 M_jacobian[iq].resize (spaceDim);
309 for (
UInt iDim (0); iDim < spaceDim; ++iDim)
311 M_jacobian[iq][iDim].resize (spaceDim);
315 M_refTangents.resize (spaceDim - 1);
317 M_tangents.resize (M_nbQuadPt);
320 M_tangents[i].resize (spaceDim - 1);
323 M_metricTensor.resize (M_nbQuadPt);
326 M_metricTensor[i].resize (spaceDim - 1);
327 for (
UInt j (0); j < spaceDim - 1; ++j)
329 M_metricTensor[i][j].resize (spaceDim - 1);
333 M_measure.resize (M_nbQuadPt);
335 M_wMeas.resize (M_nbQuadPt);
337 M_normal.resize (M_nbQuadPt);
friend class ExpressionAssembly::EvaluationHK
Friend to allow direct access to the raw data.
GeometricMap - Structure for the geometrical mapping.
std::vector< Real > M_measure
ETCurrentBDFE(const ETCurrentBDFE< spaceDim > &otherFE)
Copy constructor.
ETCurrentBDFE - Short description of the class.
const QuadratureRule * M_quadrature
friend class ExpressionAssembly::EvaluationPosition
Friend to allow direct access to the raw data.
std::vector< std::vector< std::vector< Real > > > M_metricTensor
void setRefTangents(std::vector< VectorSmall< spaceDim > > tangents)
QuadratureRule(const QuadratureRule &qr)
Copy constructor.
void updateInverseJacobian(const UInt &iQuadPt)
std::vector< std::vector< std::vector< Real > > > M_dphiGeometricMap
void setQuadratureRule(const QuadratureRule &qr)
virtual ~ETCurrentBDFE()
Destructor.
std::vector< VectorSmall< spaceDim > > M_quadNode
std::vector< Real > M_wMeas
const UInt & nbDof() const
Return the number of degrees of freedom for this reference element.
const GeometricMap * M_geometricMap
ETCurrentBDFE(const GeometricMap &geoMap)
Constructor without quadrature rule.
std::vector< std::vector< VectorSmall< spaceDim > > > M_tangents
double Real
Generic real data.
std::vector< VectorSmall< spaceDim > > M_normal
void setupInternalConstants()
std::vector< std::vector< Real > > M_phiMap
std::vector< VectorSmall< spaceDim > > M_refTangents
ETCurrentBDFE(const GeometricMap &geoMap, const QuadratureRule &qr)
Full constructor.
std::vector< std::vector< Real > > M_cellNode
QuadratureRule - The basis class for storing and accessing quadrature rules.
std::vector< std::vector< std::vector< Real > > > M_jacobian
void update(const ElementType &cell)
const UInt & nbQuadPt() const
Getter for the number of quadrature points.
uint32_type UInt
generic unsigned integer (used mainly for addressing)