44 #include <lifev/core/LifeV.hpp> 46 #include <lifev/core/fem/GeometricMap.hpp> 48 #include <lifev/core/fem/ReferenceFEScalar.hpp> 49 #include <lifev/core/fem/ReferenceFEHdiv.hpp> 51 #include <lifev/core/fem/QuadratureRule.hpp> 53 #include <boost/multi_array.hpp> 288 template<
typename MeshElementMarkedType>
292 virtual void update (
const std::vector<std::vector<Real> >& pts,
flag_Type upFlag);
439 ASSERT (M_cellNodesUpdated,
"Cell nodes are not updated!");
440 return M_cellNodes[node][coordinate];
446 ASSERT (M_quadNodesUpdated,
"Quad nodes are not updated!");
447 return M_quadNodes[node][coordinate];
453 ASSERT (M_detJacobianUpdated,
"Jacobian determinant is not updated!");
454 return M_detJacobian[quadNode];
460 ASSERT (M_wDetJacobianUpdated,
"Weighted jacobian determinant is not updated!");
461 return M_wDetJacobian[quadNode];
467 ASSERT (M_tInverseJacobianUpdated,
"Inverse jacobian is not updated!");
468 return M_tInverseJacobian[element1][element2][quadNode];
474 ASSERT (M_phiUpdated,
"Function values are not updated!");
475 return M_phi[node][0][quadNode];
481 ASSERT (M_phiVectUpdated,
"Function values are not updated!");
482 return M_phiVect[node][component][quadNode];
488 ASSERT (M_dphiUpdated,
"Basis derivatives are not updated!");
489 return M_dphi[node][derivative][quadNode];
495 ASSERT (M_d2phiUpdated,
"Basis second derivatives are not updated!");
496 return M_d2phi[node][derivative1][derivative2][quadNode];
502 ASSERT (M_divPhiRefUpdated,
"Basis divergence are not updated!");
503 return M_divPhiRef[node][quadNode];
515 ASSERT (M_cellNodesUpdated,
"Cell nodes are not updated!");
516 return M_cellNodes[node][coordinate];
522 ASSERT (M_quadNodesUpdated,
"Quad nodes are not updated!");
523 return M_quadNodes[node][coordinate];
529 ASSERT (M_wDetJacobianUpdated,
"Weighted jacobian determinant is not updated!");
530 return M_wDetJacobian[quadNode];
536 ASSERT (M_detJacobianUpdated,
"Jacobian determinant is not updated!");
537 return M_detJacobian[quadNode];
543 ASSERT (M_tInverseJacobianUpdated,
"Inverse jacobian is not updated!");
544 return M_tInverseJacobian[element1][element2][quadNode];
550 ASSERT (M_dphiUpdated,
"Basis derivatives are not updated!");
551 return M_dphi[node][derivative][quadNode];
557 ASSERT (M_d2phiUpdated,
"Basis second derivatives are not updated!");
558 return M_d2phi[node][derivative1][derivative2][quadNode];
571 template<
typename MeshElementMarkedType>
689 int compx,
int compzeta)
const;
696 int compx,
int compzeta)
const;
718 return M_refFE->patternFirst ( i );
723 return M_refFE->patternSecond ( i );
733 template <
class MeshElementMarkedType>
734 void update (
const MeshElementMarkedType& geoele );
739 template <
class MeshElementMarkedType>
740 void updateJac (
const MeshElementMarkedType& geoele );
745 template <
class MeshElementMarkedType>
751 template <
class MeshElementMarkedType>
757 template <
class MeshElementMarkedType>
763 template <
class MeshElementMarkedType>
769 template <
class MeshElementMarkedType>
775 template <
class MeshElementMarkedType>
781 template <
class MeshElementMarkedType>
790 template<
typename MeshElementMarked>
796 std::vector< std::vector <Real> > pts (M_nbGeoNode, std::vector<Real> (nDimensions) );
802 pts[i][icoor] = geoele.point (i).coordinate (icoor);
805 update (pts, upFlag);
808 template<
typename MeshElementMarked>
811 std::vector< std::vector <Real> > pts (M_nbGeoNode, std::vector<Real> (nDimensions) );
817 pts[i][icoor] = geoele.point (i).coordinate (icoor);
821 computeCellNodes (pts);
831 template <
class MeshElementMarkedType>
842 template <
class MeshElementMarkedType>
845 ASSERT (M_nbQuadPt != 0,
" No quadrature rule defined, cannot update!");
849 computeCellNodes (geoele);
860 template <
class MeshElementMarkedType>
863 ASSERT (M_nbQuadPt != 0,
" No quadrature rule defined, cannot update!");
867 computeCellNodes (geoele);
880 template <
class MeshElementMarkedType>
883 ASSERT (M_nbQuadPt != 0,
" No quadrature rule defined, cannot update!");
887 computeCellNodes (geoele);
902 template <
class MeshElementMarkedType>
905 ASSERT (M_nbQuadPt != 0,
" No quadrature rule defined, cannot update!");
909 computeCellNodes (geoele);
927 template <
class MeshElementMarkedType>
930 ASSERT (M_nbQuadPt != 0,
" No quadrature rule defined, cannot update!");
934 computeCellNodes (geoele);
949 template <
class MeshElementMarkedType>
952 ASSERT (M_nbQuadPt != 0,
" No quadrature rule defined, cannot update!");
956 computeCellNodes (geoele);
972 template <
class MeshElementMarkedType>
975 ASSERT (M_nbQuadPt != 0,
" No quadrature rule defined, cannot update!");
979 computeCellNodes (geoele);
995 template <
class MeshElementMarkedType>
998 ASSERT (M_nbQuadPt != 0,
" No quadrature rule defined, cannot update!");
1002 computeCellNodes (geoele);
boost::multi_array< Real, 3 > M_dphiGeometricMap
void computeDphiRef()
Compute the value of the derivatives in the reference frame.
GeometricMap - Structure for the geometrical mapping.
Real point(UInt node, UInt coordinate) const
Old accessor, use cellNode instead.
Real d2phi(UInt node, UInt derivative1, UInt derivative2, UInt quadNode) const
Getter for the second derivatives of the basis functions.
void computeDetJacobian()
Compute the determinant of the jacobian.
UInt nbGeoNode() const
Getter for the number of geometrical nodes.
void computeWDetJacobian()
Compute the determinant of the jacobian in the quadrature nodes.
int patternFirst(int i) const
patternFirst(i): row index in the element matrix of the i-th term of the pattern
Real pointInverseJacobian(Real hat_x, Real hat_y, Real hat_z, int compx, int compzeta) const
UInt currentId() const
Getter for the ID of the current cell.
const flag_Type UPDATE_ONLY_PHI_VECT(1024)
const flag_Type UPDATE_ONLY_W_DET_JACOBIAN(32)
uint32_type flag_Type
bit-flag with up to 32 different flags
QuadratureRule * M_quadRule
boost::multi_array< Real, 3 > M_jacobian
bool M_wDetJacobianUpdated
const flag_Type UPDATE_ONLY_JACOBIAN(8)
const flag_Type UPDATE_ONLY_DPHI(128)
void update(const MeshElementMarkedType &geoele)
DECLARATION of the update methods.
const flag_Type UPDATE_DPHI(UPDATE_ONLY_CELL_NODES|UPDATE_ONLY_DPHI_GEO_MAP|UPDATE_ONLY_JACOBIAN|UPDATE_ONLY_T_INVERSE_JACOBIAN|UPDATE_ONLY_DPHI_REF|UPDATE_ONLY_DPHI|UPDATE_ONLY_DET_JACOBIAN)
Real diameter2() const
return the diameter of the element in the 2-norm
void computePhiVect()
Compute the value of the vectorial FE using Piola transform.
void coorBackMap(Real x, Real y, Real z, Real &xi, Real &eta, Real &zeta) const
void computeCellNodes(const std::vector< std::vector< Real > > &pts)
Update only the nodes of the cells to the current one.
Real detJac(UInt quadNode) const
Getter for the determinant of the jacobian in a given quadrature node.
Real phi(UInt node, UInt component, UInt quadNode) const
Getter for basis function values (vectorial FE case)
const ReferenceFE * M_refFE
CurrentFE(const CurrentFE &)
void computeDphiGeometricMap()
Compute the values of the derivatives of the mapping in the quadrature nodes.
void updateSecondDeriv(const MeshElementMarkedType &geoele)
const flag_Type UPDATE_ONLY_DPHI_REF(64)
boost::multi_array< Real, 2 > M_quadNodes
void computeQuadNodes()
Update the location of the quadrature in the current cell.
boost::numeric::ublas::vector< Real > GeoVector
UInt nbUpper() const
Getter for the number of entries in the pattern.
const GeometricMap * M_geoMap
GeoVector coorMap(const GeoVector &P) const
UInt nbDiag() const
Getter for the diagonal entries in the pattern.
Real phiDer2(UInt node, UInt derivative1, UInt derivative2, UInt quadNode) const
Old accessor, use d2phi instead.
Real cellNode(UInt node, UInt coordinate) const
Getter for the nodes of the cell.
void updateInverseJacobian(const UInt &iQuadPt)
const flag_Type UPDATE_WDET(UPDATE_ONLY_CELL_NODES|UPDATE_ONLY_DPHI_GEO_MAP|UPDATE_ONLY_JACOBIAN|UPDATE_ONLY_DET_JACOBIAN|UPDATE_ONLY_W_DET_JACOBIAN)
void update(const std::vector< GeoVector > &pts, flag_Type upFlag)
Update method using only point coordinates. It used the flags, as defined in this page...
const flag_Type UPDATE_ONLY_DPHI_GEO_MAP(4)
void computeD2phiRef()
Compute the value of the second derivatives in the reference frame.
virtual ~CurrentFE()
Destructor.
void updateFirstSecondDerivQuadPt(const MeshElementMarkedType &geoele)
void computeD2phi()
Compute the value of the derivatives in the current element.
boost::multi_array< Real, 2 > M_divPhiRef
const flag_Type UPDATE_DIV_PHI(UPDATE_ONLY_DIV_PHI_REF)
void update(const MeshElementMarked &geoele, flag_Type upFlag)
UInt nbLocalCoor() const
Getter for the number of local coordinates.
Real phiDer(UInt node, UInt derivative, UInt quadNode) const
Old accessor, use dphi instead.
const flag_Type UPDATE_ONLY_DET_JACOBIAN(4096)
const flag_Type UPDATE_ONLY_QUAD_NODES(2)
Real dphi(UInt node, UInt derivative, UInt quadNode) const
Getter for the derivatives of the basis functions.
void updateJacQuadPt(const MeshElementMarkedType &geoele)
const ReferenceFE & refFE() const
Getter for the reference FE.
void updateSecondDerivQuadPt(const MeshElementMarkedType &geoele)
Real tInverseJacobian(UInt element1, UInt element2, UInt quadNode) const
Getter for the inverse of the jacobian.
void coorQuadPt(Real &x, Real &y, Real &z, int ig) const
boost::multi_array< Real, 4 > M_d2phi
void updateFirstDerivQuadPt(const MeshElementMarkedType &geoele)
void updateFirstSecondDeriv(const MeshElementMarkedType &geoele)
bool M_detJacobianUpdated
bool M_tInverseJacobianUpdated
const QuadratureRule & quadRule() const
Getter for the quadrature rule.
void computeTInverseJacobian()
Compute the transposed inverse of the jacobian in the quadrature nodes.
virtual Real measure() const
Return the measure of the current element.
Real tInvJac(UInt element1, UInt element2, UInt quadNode) const
Old accessor, use iInverseJacobian instead.
Real diameter() const
return the diameter of the element in the 1-norm
void computeDphi()
Compute the value of the derivatives in the current element.
Real quadNode(UInt node, UInt coordinate) const
Getter for the quadrature nodes.
const flag_Type UPDATE_ONLY_D2PHI(512)
boost::multi_array< Real, 3 > M_tInverseJacobian
double Real
Generic real data.
boost::multi_array< Real, 3 > M_phi
boost::multi_array< Real, 1 > M_detJacobian
CurrentFE - A primordial class for the assembly of the local matrices/vectors retaining the values on...
UInt nbPattern() const
Getter for the number of entries in the pattern.
boost::multi_array< Real, 2 > M_cellNodes
boost::multi_array< Real, 4 > M_d2phiRef
void computeJacobian()
Compute the jacobian in the quadrature nodes.
UInt nbFEDof() const
Getter for the number of nodes.
const flag_Type UPDATE_ONLY_T_INVERSE_JACOBIAN(16)
const flag_Type UPDATE_ONLY_DIV_PHI_REF(2048)
The class for a reference Lagrangian finite element.
void barycenter(Real &x, Real &y, Real &z) const
return the barycenter of the element
boost::multi_array< Real, 3 > M_dphi
const flag_Type UPDATE_QUAD_NODES(UPDATE_ONLY_CELL_NODES|UPDATE_ONLY_QUAD_NODES)
Real wDetJacobian(UInt quadNode) const
Getter for the weighted jacobian determinant.
Real detJacobian(UInt quadNode) const
Getter for the determinant of the jacobian in a given quadrature node.
const UInt nDimensions(NDIM)
Real phi(UInt node, UInt quadNode) const
Getter for basis function values (scalar FE case)
boost::multi_array< Real, 3 > M_phiVect
void updateJac(const MeshElementMarkedType &geoele)
void updateFirstDeriv(const MeshElementMarkedType &geoele)
#define LIFEV_DEPRECATED(func)
CurrentFE(const ReferenceFE &refFE, const GeometricMap &geoMap)
Constructor without quadrature specification.
int patternSecond(int i) const
patternSecond(i): column index in the element matrix of the i-th term of the pattern ...
Real pointJacobian(Real hat_x, Real hat_y, Real hat_z, int compx, int compzeta) const
CurrentFE(const ReferenceFE &refFE, const GeometricMap &geoMap, const QuadratureRule &qr)
Full constructor with default quadrature.
const flag_Type UPDATE_D2PHI(UPDATE_ONLY_CELL_NODES|UPDATE_ONLY_DPHI_GEO_MAP|UPDATE_ONLY_JACOBIAN|UPDATE_ONLY_T_INVERSE_JACOBIAN|UPDATE_ONLY_D2PHI_REF|UPDATE_ONLY_D2PHI|UPDATE_ONLY_DET_JACOBIAN)
UInt currentLocalId() const
Getter for the local ID of the current cell.
const GeometricMap & geoMap() const
Getter for the GeometricMap reference.
void setQuadRule(const QuadratureRule &newQuadRule)
Setter for the quadrature rule.
Real weightDet(UInt quadNode) const
Old accessor, use wDetJacobian instead.
QuadratureRule - The basis class for storing and accessing quadrature rules.
const flag_Type UPDATE_PHI_VECT(UPDATE_ONLY_CELL_NODES|UPDATE_ONLY_DPHI_GEO_MAP|UPDATE_ONLY_JACOBIAN|UPDATE_ONLY_DET_JACOBIAN|UPDATE_ONLY_PHI_VECT)
boost::multi_array< Real, 1 > M_wDetJacobian
Real divPhiRef(UInt node, UInt quadNode) const
Getter for the divergence of a vectorial FE in the reference frame.
void computeCellNodes(const MeshElementMarked &geoele)
const flag_Type UPDATE_ONLY_D2PHI_REF(256)
bool M_dphiGeometricMapUpdated
Real pointDetJacobian(Real hat_x, Real hat_y, Real hat_z) const
UInt nbQuadPt() const
Getter for the number of quadrature nodes.
void quadRuleVTKexport(const std::string &filename) const
Export the quadrature rule on the current FE.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
boost::multi_array< Real, 3 > M_dphiRef
const Real & quadPointCoor(const UInt &ig, const UInt &icoor) const
quadPointCoor(ig,icoor) is the coordinate icoor of the quadrature point ig
void coorMap(Real &x, Real &y, Real &z, Real xi, Real eta, Real zeta) const
Real quadPt(UInt node, UInt coordinate) const
Old accessor, use quadNode instead.
const flag_Type UPDATE_ONLY_CELL_NODES(1)