LifeV
ETCurrentFE.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory UNiversity
7 
8  This file is part of the LifeV library
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation; either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, see <http://www.gnu.org/licenses/>
22 
23 
24 *******************************************************************************
25 */
26 //@HEADER
27 
28 /*!
29  * @file
30  @brief This file contains the definition of the ETCurrentFE.
31 
32  @date 06/2011
33  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
34  */
35 
36 #ifndef ETCURRENTFE_HPP
37 #define ETCURRENTFE_HPP
38 
39 
40 #include <lifev/core/LifeV.hpp>
41 
42 #include <lifev/core/array/VectorSmall.hpp>
43 #include <lifev/core/array/MatrixSmall.hpp>
44 
45 #include <lifev/eta/fem/ETCurrentFlag.hpp>
46 
47 #include <lifev/core/fem/GeometricMap.hpp>
48 
49 #include <lifev/core/fem/ReferenceFEScalar.hpp>
50 #include <lifev/core/fem/ReferenceFEHdiv.hpp>
51 #include <lifev/core/fem/ReferenceFEHybrid.hpp>
52 
53 #include <lifev/core/fem/QuadratureRule.hpp>
54 
55 
56 #include <vector>
57 
58 namespace LifeV
59 {
60 
61 namespace ExpressionAssembly
62 {
63 /*
64  Predeclaration of the classes that are friend to this class.
65  This is not mandatory with the newest standards (C++03 and later?)
66  but is required for some earlier standards. So, better to
67  have them.
68 */
69 
70 template <UInt dim>
72 
73 template <UInt dim>
75 
76 template <UInt dim, UInt FSpaceDim>
78 
79 template <UInt dim, UInt FSpaceDim>
81 
82 template <UInt dim, UInt FSpaceDim>
83 class EvaluationDivI;
84 
85 template <UInt dim, UInt FSpaceDim>
86 class EvaluationDivJ;
87 
88 template <UInt dim, UInt FSpaceDim>
90 
91 template <UInt dim, UInt FSpaceDim>
93 
94 template <UInt dim>
96 
97 template <UInt dim>
99 
100 template <UInt dim>
102 
103 template <UInt dim>
105 
106 template <UInt dim>
108 
109 template <UInt dim>
111 
112 } // Namespace Expression Assembly
113 
114 /*!
115  ETCurrenteFE is a template class. If fieldDim the general
116  case is treated as representing a vectorial FE (only the case
117  where fieldDim represents a scalar FE, but this is a partial
118  specialization of this class).
119 
120 */
121 // This header contains the non-specialized version of the class
122 #include "ETCurrentFE_FD3.hpp"
123 
124 /*!
125  The ETCurrentFE is the class to be used to compute quantities related
126  to the quadrature and the basis functions in a real element (current element).
127 
128  These quantities are computed using the update method.
129  The update is managed through a system of flags that have to be passed to that method
130  to require some of the quantities to be computed.
131 
132  The access to the data, getters have to be used (excepted for some specific classes
133  which have a direct access to the stored data through friendship).
134 
135  This is the partial specialization of the generic ETCurrentFE for scalar finite element spaces.
136 
137 */
138 template <UInt spaceDim>
139 class ETCurrentFE<spaceDim, 1>
140 {
141 
142  //! @name Friends
143  //@{
144 
145  //!Friend to allow direct access to the raw data
146  template <UInt dim>
147  friend class ExpressionAssembly::EvaluationPhiI;
148 
149  //!Friend to allow direct access to the raw data
150  template <UInt dim>
151  friend class ExpressionAssembly::EvaluationPhiJ;
152 
153  //!Friend to allow direct access to the raw data
154  template <UInt dim, UInt FSpaceDim>
155  friend class ExpressionAssembly::EvaluationDphiI;
156 
157  //!Friend to allow direct access to the raw data
158  template <UInt dim, UInt FSpaceDim>
159  friend class ExpressionAssembly::EvaluationDphiJ;
160 
161  //!Friend to allow direct access to the raw data
162  template <UInt dim, UInt FSpaceDim>
163  friend class ExpressionAssembly::EvaluationLaplacianI;
164 
165  //!Friend to allow direct access to the raw data
166  template <UInt dim, UInt FSpaceDim>
167  friend class ExpressionAssembly::EvaluationLaplacianJ;
168 
169  //!Friend to allow direct access to the raw data
170  template <UInt dim>
171  friend class ExpressionAssembly::EvaluationHK;
172 
173  //!Friend to allow direct access to the raw data
174  template <UInt dim>
175  friend class ExpressionAssembly::EvaluationDetJacobian;
177  //!Friend to allow direct access to the raw data
178  template <UInt dim>
179  friend class ExpressionAssembly::EvaluationMetricTensor;
180 
181  //!Friend to allow direct access to the raw data
182  template <UInt dim>
183  friend class ExpressionAssembly::EvaluationMetricVector;
184 
185  //!Friend to allow direct access to the raw data
186  template <UInt dim>
187  friend class ExpressionAssembly::EvaluationPosition;
188 
189  //!Friend to allow direct access to the raw data
190  template <UInt dim>
191  friend class ExpressionAssembly::EvaluationMeas;
192 
193 
194  //@}
195 
196 private:
197 
198  // Vector return type for phi
199  typedef VectorSmall< spaceDim > array1D_Return_Type;
200 
201 public:
202 
203  //! @name Static constants
204  //@{
205 
206  //! Static value for the space dimension
207  static const UInt S_spaceDimension; // = spaceDim;
208 
209  //! Static value for the dimension of the field (1 here as it is a scalar FE)
210  static const UInt S_fieldDimension; // = 1;
211 
212  //@}
213 
214 
215  //! @name Constructors, destructor
216  //@{
217 
218  //! Full constructor
219  /*!
220  @param refFE The reference element for the FE
221  @param geoMap The geometric map from the reference element to the current element
222  @param qr The quadrature rule
223  */
224  ETCurrentFE (const ReferenceFE& refFE, const GeometricMap& geoMap, const QuadratureRule& qr);
225 
226  //! Constructor without quadrature rule
227  /*!
228  @param refFE The reference element for the FE
229  @param geoMap The geometric map from the reference element to the current element
230  */
231  ETCurrentFE (const ReferenceFE& refFE, const GeometricMap& geoMap);
232 
233  //! Copy constructor
234  /*!
235  @param otherFE The currentFE to be copied
236  */
237  ETCurrentFE (const ETCurrentFE<spaceDim, 1>& otherFE);
238 
239  //! Destructor
240  virtual ~ETCurrentFE();
241 
242  //@}
243 
244 
245  //! @name Methods
246  //@{
247 
248  //! Update method
249  /*!
250  The update method computes the required quantities (indicated by the flag,
251  see in \ref Update_flag) on the element.
252 
253  @param element The current element were to compute the values
254  @param flag The flag indicating the quantities to update
255 
256  <b>Template parameters</b>
257 
258  <i>elementType</i>: The type of the element
259 
260  <b>Template requirements</b>
261 
262  <i>elementType</i>: has a id() method returning the identifier (global); has a localId() method returning
263  the identifier (local); has a method point(UInt i) that returns the ith point.
264  */
265  template<typename elementType>
266  void update (const elementType& element, const flag_Type& flag);
267 
268  //! ShowMe method
269  /*!
270  @param out Output stream were to print the informations
271  */
272  void showMe (std::ostream& out = std::cout) const;
273 
274  //@}
275 
276 
277  //! @name Set Methods
278  //@{
279 
280  //! Setter for the quadrature rule
281  /*!
282  Beware that when this setter is called, all the internal
283  structures have to be reshaped (according to the number
284  of quadrature nodes).
285 
286  @param qr The new quadrature to use.
287  */
288  void setQuadratureRule (const QuadratureRule& qr);
290  //@}
291 
293  //! @name Get Methods
294  //@{
296  //! Getter for the number of degrees of freedom of this element
297  /*!
298  @return The number of number of degrees of freedom of this element
299  */
300  UInt nbFEDof() const
301  {
302  return M_nbFEDof;
303  }
304 
305  //! Getter for the values of the basis functions in the quadrature nodes in the current element
306  /*!
307  @param i The index of the basis function
308  @param q The index of the quadrature node
309  @return The value of the ith basis function in the qth quadrature node
310  */
311  Real phi (const UInt& i, const UInt& q) const
312  {
313  ASSERT ( i < M_nbFEDof, "No basis function with this index");
314  ASSERT ( q < M_nbQuadPt, "No quadrature point with this index");
315  return M_phi[q][i];
316  }
317 
318  //! Getter for the coordinates of the quadrature nodes in the current element
319  /*!
320  @param q The index of the quadrature node
321  @param coord The coordinate required
322  @return The coordth component of the coordinate of the qth quadrature point
323  */
324  Real quadNode (const UInt& q, const UInt& coord) const
325  {
326  ASSERT ( M_isQuadNodeUpdated, "Quadrature nodes have not been updated");
327  ASSERT ( q < M_nbQuadPt, "No quadrature point with this index");
328  ASSERT ( coord < spaceDim, "No such coordinate index");
329  return M_quadNode[q][coord];
330  }
331 
332  //! Getter for the weighted jacobian determinant (current element)
333  /*!
334  @param q The index of the quadrature point
335  @return The weighted determinant of the jacobian transform in the qth quadrature node
336  */
337  Real wDet (const UInt& q) const
338  {
339  ASSERT ( M_isWDetUpdated, "Weighted determinant has not been updated");
340  ASSERT ( q < M_nbQuadPt, "No quadrature point with this index");
341  return M_wDet[q];
342  }
343 
344  //! Getter for the derivatives of the basis function in the quadrature nodes (current element)
345  /*!
346  @param i The index of the basis function
347  @param dxi The direction of the derivative required (0 for d/dx, 1 for d/dy...)
348  @param q The index of the quadrature node
349  @return The value of the ith basis function derived w.r. to dxi, in the qth quadrature node.
350  */
351  Real dphi (const UInt& i, const UInt& dxi, const UInt& q) const
352  {
353  ASSERT ( M_isDphiUpdated, "Derivative of the basis functions have not been updated");
354  ASSERT ( i < M_nbFEDof, "No basis function with this index");
355  ASSERT ( dxi < spaceDim, "No such coordinate index");
356  ASSERT ( q < M_nbQuadPt, "No quadrature point with this index");
357  return M_dphi[q][i][dxi];
358  }
359 
360  //! Getter for the derivatives of the basis function in the quadrature nodes (current element)
361  /*!
362  @param i The index of the basis function
363  @param q The index of the quadrature node
364  @return The local vector of the basis functions derived w.r. to dxi, in the qth quadrature node.
365  */
366  VectorSmall<spaceDim> const& dphi (const UInt& i, const UInt& q) const
367  {
368  ASSERT ( M_isDphiUpdated, "Derivative of the basis functions have not been updated");
369  ASSERT ( i < M_nbFEDof, "No basis function with this index");
370  ASSERT ( q < M_nbQuadPt, "No quadrature point with this index");
371  return M_dphi[q][i];
372  }
374  //! Getter for the derivatives of the basis function in the quadrature nodes (current element)
375  /*!
376  @param i The index of the basis function
377  @param q The index of the quadrature node
378  @return The local vector of the basis functions derived w.r. to dxi, in the qth quadrature node.
379  */
380  Real const& laplacian (const UInt& i, const UInt& q) const
381  {
382  ASSERT ( M_isLaplacianUpdated, "Laplacian of the basis functions have not been updated");
383  ASSERT ( i < M_nbFEDof, "No basis function with this index");
384  ASSERT ( q < M_nbQuadPt, "No quadrature point with this index");
385  return M_laplacian[q][i];
386  }
387 
388  //! Getter for the identifier of the current element
389  /*!
390  @return The (global) identifier of the current element.
391  */
392  UInt currentId() const
393  {
394  ASSERT (M_isCellNodeUpdated, "Cell has not been updated");
395  return M_currentId;
396  }
397 
398  //! Getter for the diameter of the current element
399  /*!
400  @return The diameter of the current element
401  */
402  Real diameter() const
403  {
404  ASSERT (M_isDiameterUpdated, "Diameter has not been updated");
405  return M_diameter;
406  }
407 
408  //! Getter for the eterminant of the jacobian of the current element
409  /*!
410  @return The diameter of the current element
411  */
412  Real detJac() const
413  {
414  ASSERT (M_isWDetUpdated, "Determinant has not been updated");
415  return M_detJacobian[0];
416  }
417 
418  //! Getter for the metricTensor of the current element
419  /*!
420  @return The metric of the current element
421  */
422  MatrixSmall<3,3> metricTensor() const
423  {
424  ASSERT (M_isMetricUpdated, "Metric has not been updated");
425  return M_metricTensor;
426  }
427 
428  //! Getter for the metricTensor of the current element
429  /*!
430  @return The metric of the current element
431  */
433  {
434  ASSERT (M_isMetricUpdated, "Metric has not been updated");
435  return M_metricVector;
436  }
437 
438  //! Getter for the measure of the current element
439  /*!
440  @return The measure of the current element
441  */
442  Real measure() const
443  {
444  //ASSERT(M_isMeasure, "Measure has not been updated");
445 
446  return M_measure;
447  }
448 
449 
450  //@}
451 
452 private:
453 
454  //Private typedefs for the 1D array
456 
457  //Private typedefs for the 2D array (array of 1D array)
459 
460  //Private typedefs for the 3D array (array of 2D array)
462 
463  //Private typedefs for the 4D array (array of 3D array)
465 
466  //Private typedefs for the 1D array of vector
468 
469  //Private typedefs for the 2D array of vector
471 
472  //To contain the second derivatives
474 
475  //! @name Private Methods
476  //@{
477 
478  //! No default constructor
479  ETCurrentFE();
480 
481  //! No assignement
482  void operator= (const ETCurrentFE<spaceDim, 1>&);
483 
484  //! Resize all the internal containers w.r. to the stored data and compute the constant values
485  void setupInternalConstants();
486 
487  //! Update the cell nodes
488  template< typename ElementType >
489  void updateCellNode (const ElementType& element);
490 
491  //! Update the cell nodes with a std::vector of points
492  /*!
493  Note here that this method is NOT a template specialization (which
494  is impossible in this case, full specialization being forbidden in
495  non specialized template classes), but an overload of the template
496  method (which represents a better match in case the right arguments
497  are passed).
498  */
499  void updateCellNode (const std::vector<VectorSmall<spaceDim> >& ptsCoordinates);
500 
501  //! Update the diameter of the cell
502  void updateDiameter();
503 
504  //! Update the metric of the cell
505  void updateMetric();
506 
507  //! Update the measure of the cell
508  void updateMeasure();
509 
510  //! Update the quadrature nodes
511  void updateQuadNode (const UInt& iQuadPt);
512 
513  //! Update Jacobian
514  void updateJacobian (const UInt& iQuadPt);
515 
516  //! Update DetJacobian
517  void updateDetJacobian (const UInt& iQuadPt);
518 
519  //! Update InverseJacobian
520  void updateInverseJacobian (const UInt& iQuadPt);
521 
522  //! Update WeightedJacobian
523  void updateWDet (const UInt& iQuadPt);
524 
525  //! Update Dphi
526  void updateDphi (const UInt& iQuadPt);
527 
528  //! Update D2phi
529  void updateD2phi (const UInt& iQuadPt);
530 
531  //! Update Laplacian
532  void updateLaplacian (const UInt& iQuadPt);
533 
534  //@}
535 
536 
537  // Pointer on the reference FE
539 
540  // Pointer on the geometric map
543  // Pointer on the quadrature rule
545 
546  // Number of FE dof (current element)
548 
549  // Number of dof for the geometric map
551 
552  // Number of quadrature point
554 
555  // Global identifier
557 
558  // Local identifier
560 
561  // Diameter of the element
563 
564  // Measure of the element
566 
567  // Storage for the values of the basis functions
569 
570  // Storage for the values of the geometric map
572 
573  // Storage for the derivatives of the basis functions
575 
576  // Storage for the second derivatives of the basis functions
578 
579  // Storage for the derivatives of the geometric map
581 
582  // Storage for the coordinates of the nodes of the current element
584 
585  // Storage for the position the quadrature nodes (current element)
587 
588  // Storage for the jacobian of the transformation
590 
591  // Storage for the determinant of the jacobian of the transformation
593 
594  // Storage for the weighted determinant
596 
597  // Storage for the inverse of the jacobian
599 
600  // Storage for the derivative of the basis functions
602 
603  // Storage for the second derivative of the basis functions
605 
606  // Storage for the laplacian
608 
609  // Storage metric tensor (works only for 3D)
610  MatrixSmall<3,3> M_metricTensor;
611 
612  // Storage metric vector (works only for 3D)
614 
615 #ifdef HAVE_LIFEV_DEBUG
616  // Debug informations, defined only if the code
617  // is compiled in debug mode. These booleans store the
618  // information about what the last call to "update"
619  // has actually computed (names are self explanatory)
620 
621  bool M_isCellNodeUpdated;
622  bool M_isDiameterUpdated;
623  bool M_isMetricUpdated;
624  bool M_isMeasureUpdated;
625  bool M_isQuadNodeUpdated;
626  bool M_isJacobianUpdated;
627  bool M_isDetJacobianUpdated;
628  bool M_isInverseJacobianUpdated;
629  bool M_isWDetUpdated;
630  bool M_isPhiUpdated;
631  bool M_isDphiUpdated;
632  bool M_isD2phiUpdated;
633  bool M_isLaplacianUpdated;
634 #endif
635 
636 };
637 
638 
639 // ===================================================
640 // IMPLEMENTATION
641 // ===================================================
642 
643 
644 template <UInt spaceDim>
645 const UInt ETCurrentFE<spaceDim, 1>::
646 S_spaceDimension = spaceDim;
647 
648 template <UInt spaceDim>
649 const UInt ETCurrentFE<spaceDim, 1>::
650 S_fieldDimension = 1;
651 
652 
653 // ===================================================
654 // Constructors & Destructor
655 // ===================================================
656 
657 
658 template< UInt spaceDim>
659 ETCurrentFE<spaceDim, 1>::
660 ETCurrentFE (const ReferenceFE& refFE, const GeometricMap& geoMap, const QuadratureRule& qr)
661  :
662  M_referenceFE (&refFE),
663  M_geometricMap (&geoMap),
665 
669 
670  M_currentId(),
672 
673  M_diameter(),
674  M_metricTensor(),
676  M_measure(),
677  M_phi(),
678  M_phiMap(),
682 
683  M_cellNode(),
684  M_quadNode(),
685  M_jacobian(),
686  M_detJacobian(),
687  M_wDet(),
689  M_dphi(),
690 
691  M_d2phi()
692 
693 #ifdef HAVE_LIFEV_DEBUG
694  , M_isCellNodeUpdated (false),
695  M_isDiameterUpdated (false),
696  M_isMetricUpdated (false),
697  M_isMeasureUpdated (false),
698  M_isQuadNodeUpdated (false),
699  M_isJacobianUpdated (false),
700  M_isDetJacobianUpdated (false),
702  M_isWDetUpdated (false),
703  M_isPhiUpdated (false),
704  M_isDphiUpdated (false),
705  M_isD2phiUpdated (false),
706  M_isLaplacianUpdated (false)
707 #endif
708 
709 
710 {
711  // Everything's there, so reshape the arrays
713 }
714 
715 
716 template< UInt spaceDim>
717 ETCurrentFE<spaceDim, 1>::
718 ETCurrentFE (const ReferenceFE& refFE, const GeometricMap& geoMap)
719  :
720  M_referenceFE (&refFE),
721  M_geometricMap (&geoMap),
722  M_quadratureRule (0),
723 
726  M_nbQuadPt (0),
727 
728  M_currentId(),
730 
731  M_diameter(),
732  M_metricTensor(),
734  M_measure(),
735  M_phi(),
736  M_phiMap(),
740 
741  M_cellNode(),
742  M_quadNode(),
743  M_jacobian(),
744  M_detJacobian(),
745  M_wDet(),
747  M_dphi(),
748 
749  M_d2phi()
750 
751 #ifdef HAVE_LIFEV_DEBUG
752  , M_isCellNodeUpdated (false),
753  M_isDiameterUpdated (false),
754  M_isMetricUpdated (false),
755  M_isMeasureUpdated (false),
756  M_isQuadNodeUpdated (false),
757  M_isJacobianUpdated (false),
758  M_isDetJacobianUpdated (false),
760  M_isWDetUpdated (false),
761  M_isPhiUpdated (false),
762  M_isDphiUpdated (false),
763  M_isD2phiUpdated (false),
765 
766 #endif
767 
768 {
769  // Miss the QR, so no reshape
770 }
771 
772 template< UInt spaceDim>
773 ETCurrentFE<spaceDim, 1>::
774 ETCurrentFE (const ETCurrentFE<spaceDim, 1>& otherFE)
775  :
776  M_referenceFE (otherFE.M_referenceFE),
777  M_geometricMap (otherFE.M_geometricMap),
778  M_quadratureRule (new QuadratureRule (*otherFE.M_quadratureRule) ),
779 
780  M_nbFEDof (otherFE.M_nbFEDof),
781  M_nbMapDof (otherFE.M_nbMapDof),
782  M_nbQuadPt (otherFE.M_nbQuadPt),
783 
784  M_currentId (otherFE.M_currentId),
785  M_currentLocalId (otherFE.M_currentLocalId),
786 
787  M_diameter (otherFE.M_diameter),
789  M_metricVector (otherFE.M_metricVector),
790  M_measure (otherFE.M_measure),
791  M_phi (otherFE.M_phi),
792  M_phiMap (otherFE.M_phiMap),
793  M_dphiReferenceFE (otherFE.M_dphiReferenceFE),
794  M_d2phiReferenceFE (otherFE.M_d2phiReferenceFE),
795  M_dphiGeometricMap (otherFE.M_dphiGeometricMap),
796 
797  M_cellNode (otherFE.M_cellNode),
798  M_quadNode (otherFE.M_quadNode),
799  M_jacobian (otherFE.M_jacobian),
800  M_detJacobian (otherFE.M_detJacobian),
801  M_wDet (otherFE.M_wDet),
802  M_tInverseJacobian (otherFE.M_tInverseJacobian),
803  M_dphi (otherFE.M_dphi),
804 
805  M_d2phi (otherFE.M_d2phi)
806 
807 #ifdef HAVE_LIFEV_DEBUG
808  //Beware for the comma at the begining of this line!
822 #endif
823 
824 {}
825 
826 
827 template< UInt spaceDim>
828 ETCurrentFE<spaceDim, 1>::
830 {
831  if (M_quadratureRule != 0)
832  {
833  delete M_quadratureRule;
834  }
835 }
836 
837 
838 // ===================================================
839 // Methods
840 // ===================================================
841 
842 
843 template< UInt spaceDim>
844 template<typename elementType>
845 void
846 ETCurrentFE<spaceDim, 1>::
847 update (const elementType& element, const flag_Type& flag)
848 {
849  ASSERT (M_referenceFE != 0, "No reference FE for the update");
850  ASSERT (M_geometricMap != 0, "No geometric mapping for the update");
851  ASSERT (M_quadratureRule != 0, "No quadrature rule for the update");
852 
853 #ifdef HAVE_LIFEV_DEBUG
854  // Reset all the flags to false
855  M_isCellNodeUpdated = false;
856  M_isDiameterUpdated = false;
857  M_isMetricUpdated = false;
858  M_isMeasureUpdated = false;
859  M_isQuadNodeUpdated = false;
860  M_isJacobianUpdated = false;
861  M_isDetJacobianUpdated = false;
862  M_isInverseJacobianUpdated = false;
863  M_isWDetUpdated = false;
864  M_isDphiUpdated = false;
865  M_isD2phiUpdated = false;
866  M_isLaplacianUpdated = false;
867 #endif
868 
869  // update the cell informations if required
870  if ( flag & ET_UPDATE_ONLY_CELL_NODE )
871  {
872  updateCellNode (element);
873  }
874  if ( flag & ET_UPDATE_ONLY_DIAMETER )
875  {
877  }
878  if ( flag & ET_UPDATE_ONLY_METRIC )
879  {
881  }
882 
883  // Loop over the quadrature nodes
884  for (UInt i (0); i < M_nbQuadPt; ++i)
885  {
886  // and update the required quantities
887  if ( flag & ET_UPDATE_ONLY_QUAD_NODE )
888  {
890  }
891  if ( flag & ET_UPDATE_ONLY_JACOBIAN )
892  {
894  }
895  if ( flag & ET_UPDATE_ONLY_DET_JACOBIAN )
896  {
898  }
899  if ( flag & ET_UPDATE_ONLY_T_INVERSE_JACOBIAN )
900  {
902  }
903  if ( flag & ET_UPDATE_ONLY_W_DET_JACOBIAN )
904  {
905  updateWDet (i);
906  }
907  if ( flag & ET_UPDATE_ONLY_DPHI )
908  {
909  updateDphi (i);
910  }
911  if ( flag & ET_UPDATE_ONLY_D2PHI )
912  {
913  updateD2phi (i);
914  }
915  if ( flag & ET_UPDATE_ONLY_LAPLACIAN )
916  {
918  }
919  }
920 
921  if ( flag & ET_UPDATE_ONLY_MEASURE )
922  {
924  }
925 }
926 
927 
928 template<UInt spaceDim>
929 void
930 ETCurrentFE<spaceDim, 1>::
931 showMe (std::ostream& out) const
932 {
933  out << " Number of FE Dof : " << M_nbFEDof << std::endl;
934  out << " Number of Map Dof : " << M_nbMapDof << std::endl;
935  out << " Number of QR point : " << M_nbQuadPt << std::endl;
936  out << std::endl;
937 
938  out << " Cell Nodes : " << std::endl;
939  for ( UInt i (0); i < M_nbMapDof; ++i )
940  {
941  for ( UInt icoor (0); icoor < S_spaceDimension; ++icoor)
942  {
943  out << M_cellNode[i][icoor] << " ";
944  }
945  out << std::endl;
946  }
947  out << std::endl;
948 
949  out << " Jacobian : " << std::endl;
950  for (UInt iQuad (0); iQuad < M_nbQuadPt; ++iQuad)
951  {
952  for (UInt iDim (0); iDim < S_spaceDimension; ++iDim)
953  {
954  for (UInt jDim (0); jDim < S_spaceDimension; ++jDim)
955  {
956  out << M_jacobian[iQuad][iDim][jDim] << " ";
957  }
958  out << std::endl;
959  }
960  out << std::endl;
961  }
962 
963  out << " Det jacobian : " << std::endl;
964  for (UInt iQuad (0); iQuad < M_nbQuadPt; ++iQuad)
965  {
966  out << M_detJacobian[iQuad] << " ";
967  }
968  out << std::endl;
969 
970  out << " T inverse Jacobian : " << std::endl;
971  for (UInt iQuad (0); iQuad < M_nbQuadPt; ++iQuad)
972  {
973  for (UInt iDim (0); iDim < S_spaceDimension; ++iDim)
974  {
975  for (UInt jDim (0); jDim < S_spaceDimension; ++jDim)
976  {
977  out << M_tInverseJacobian[iQuad][iDim][jDim] << " ";
978  }
979  out << std::endl;
980  }
981  out << std::endl;
982  }
983 
984  out << " DPhi : " << std::endl;
985  for (UInt iQuad (0); iQuad < M_nbQuadPt; ++iQuad)
986  {
987  for (UInt iDof (0); iDof < M_nbFEDof; ++iDof)
988  {
989  for (UInt iCoor (0); iCoor < S_spaceDimension; ++iCoor)
990  {
991  out << M_dphi[iQuad][iDof][iCoor] << " ";
992  }
993  out << std::endl;
994  }
995  out << std::endl;
996  }
997 
998  out << " D2Phi : " << std::endl;
999  for (UInt iQuad (0); iQuad < M_nbQuadPt; ++iQuad)
1000  {
1001  for (UInt iDof (0); iDof < M_nbFEDof; ++iDof)
1002  {
1003  for (UInt iCoor (0); iCoor < S_spaceDimension; ++iCoor)
1004  {
1005  for (UInt jCoor (0); jCoor < S_spaceDimension; ++jCoor)
1006  {
1007  out << M_d2phi[iQuad][iDof][iCoor][jCoor] << " ";
1008  }
1009  out << std::endl;
1010  }
1011  out << std::endl;
1012  }
1013  out << std::endl;
1014  }
1015 
1016  out << " Laplacian : " << std::endl;
1017  for (UInt iQuad (0); iQuad < M_nbQuadPt; ++iQuad)
1018  {
1019  for (UInt iDof (0); iDof < M_nbFEDof; ++iDof)
1020  {
1021  out << M_laplacian[iQuad][iDof] << " ";
1022  }
1023  out << std::endl;
1024  }
1025 }
1026 
1027 // ===================================================
1028 // Set Methods
1029 // ===================================================
1030 
1031 template< UInt spaceDim>
1032 void
1033 ETCurrentFE<spaceDim, 1>::
1035 {
1036  if (M_quadratureRule != 0)
1037  {
1038  delete M_quadratureRule;
1039  }
1041  M_nbQuadPt = qr.nbQuadPt();
1043 }
1044 
1045 
1046 // ===================================================
1047 // Private Methods
1048 // ===================================================
1049 
1050 
1051 template< UInt spaceDim >
1052 void
1053 ETCurrentFE<spaceDim, 1>::
1055 {
1056  // The first group of values can be computed as it
1057  // it does not depend on the current element
1058 
1059  // PHI
1060  M_phi.resize (M_nbQuadPt);
1061  for (UInt q (0); q < M_nbQuadPt; ++q)
1062  {
1063  M_phi[q].resize (M_nbFEDof);
1064  for (UInt j (0); j < M_nbFEDof; ++j)
1065  {
1066  M_phi[q][j] = M_referenceFE->phi (j, M_quadratureRule->quadPointCoor (q) );
1067  }
1068  }
1069 
1070 #ifdef HAVE_LIFEV_DEBUG
1071  M_isDphiUpdated = true;
1072 #endif
1073 
1074  // PHI MAP
1075  M_phiMap.resize (M_nbQuadPt);
1076  for (UInt q (0); q < M_nbQuadPt; ++q)
1077  {
1078  M_phiMap[q].resize (M_nbMapDof);
1079  for (UInt i (0); i < M_nbMapDof; ++i)
1080  {
1082  }
1083  }
1084 
1085  // DPHIREFERENCEFE
1086  M_dphiReferenceFE.resize (M_nbQuadPt);
1087  for (UInt q (0); q < M_nbQuadPt; ++q)
1088  {
1089  M_dphiReferenceFE[q].resize (M_nbFEDof);
1090  for (UInt i (0); i < M_nbFEDof; ++i)
1091  {
1092  M_dphiReferenceFE[q][i].resize (spaceDim);
1093  for (UInt j (0); j < spaceDim; ++j)
1094  {
1095  M_dphiReferenceFE[q][i][j] = M_referenceFE->dPhi (i, j, M_quadratureRule->quadPointCoor (q) );
1096  }
1097  }
1098  }
1099 
1100  // DPHIGEOMETRICMAP
1101  M_dphiGeometricMap.resize (M_nbQuadPt);
1102  for (UInt q (0); q < M_nbQuadPt; ++q)
1103  {
1104  M_dphiGeometricMap[q].resize (M_nbMapDof);
1105  for (UInt i (0); i < M_nbMapDof; ++i)
1106  {
1107  M_dphiGeometricMap[q][i].resize (spaceDim);
1108  for (UInt j (0); j < spaceDim; ++j)
1109  {
1111  }
1112  }
1113  }
1114 
1115  // DPHI2REFERENCEFE
1116  M_d2phiReferenceFE.resize (M_nbQuadPt);
1117  for (UInt q (0); q < M_nbQuadPt; ++q)
1118  {
1119  M_d2phiReferenceFE[q].resize (M_nbFEDof);
1120  for (UInt i (0); i < M_nbFEDof; ++i)
1121  {
1122  M_d2phiReferenceFE[q][i].resize (spaceDim);
1123  for (UInt j (0); j < spaceDim; ++j)
1124  {
1125  M_d2phiReferenceFE[q][i][j].resize (spaceDim);
1126  for (UInt k (0); k < spaceDim; ++k)
1127  {
1128  M_d2phiReferenceFE[q][i][j][k] = M_referenceFE->d2Phi (i, j, k, M_quadratureRule->quadPointCoor (q) );
1129  }
1130  }
1131  }
1132  }
1133 
1134  // D2PHIREFERENCEFE
1135  M_d2phiReferenceFE.resize (M_nbQuadPt);
1136  for (UInt q (0); q < M_nbQuadPt; ++q)
1137  {
1138  M_d2phiReferenceFE[q].resize (M_nbFEDof);
1139  for (UInt i (0); i < M_nbFEDof; ++i)
1140  {
1141  M_d2phiReferenceFE[q][i].resize (spaceDim);
1142  for (UInt j (0); j < spaceDim; ++j)
1143  {
1144  M_d2phiReferenceFE[q][i][j].resize (spaceDim);
1145  for (UInt k (0); k < spaceDim; ++k)
1146  {
1147  M_d2phiReferenceFE[q][i][j][k] = M_referenceFE->d2Phi (i, j, k, M_quadratureRule->quadPointCoor (q) );
1148  }
1149  }
1150  }
1151  }
1152 
1153  // The second group of values cannot be computed
1154  // now because it depends on the current element.
1155  // So, we just make space for it.
1156 
1157  // Cell nodes
1158  M_cellNode.resize (M_nbMapDof);
1159  for (UInt i (0); i < M_nbMapDof; ++i)
1160  {
1161  M_cellNode[i].resize (spaceDim);
1162  }
1163 
1164  // Quad nodes
1165  M_quadNode.resize (M_nbQuadPt);
1166  /*for (UInt i(0); i<M_nbQuadPt; ++i)
1167  {
1168  M_quadNode[i].resize(spaceDim);
1169  }*/
1171  // Jacobian
1172  M_jacobian.resize (M_nbQuadPt);
1173  for (UInt i (0); i < M_nbQuadPt; ++i)
1174  {
1175  M_jacobian[i].resize (spaceDim);
1176  for (UInt j (0); j < spaceDim; ++j)
1177  {
1178  M_jacobian[i][j].resize (spaceDim);
1179  }
1180  }
1181 
1182  // Det jacobian
1183  M_detJacobian.resize (M_nbQuadPt);
1184 
1185  // wDet
1186  M_wDet.resize (M_nbQuadPt);
1187 
1188  // tInverseJacobian
1189  M_tInverseJacobian.resize (M_nbQuadPt);
1190  for (UInt i (0); i < M_nbQuadPt; ++i)
1191  {
1192  M_tInverseJacobian[i].resize (spaceDim);
1193  for (UInt j (0); j < spaceDim; ++j)
1194  {
1195  M_tInverseJacobian[i][j].resize (spaceDim);
1196  }
1197  }
1198 
1199  // dphi
1200  M_dphi.resize (M_nbQuadPt);
1201  for (UInt i (0); i < M_nbQuadPt; ++i)
1202  {
1203  M_dphi[i].resize (M_nbFEDof);
1204  }
1205 
1206  // d2phi
1207  M_d2phi.resize (M_nbQuadPt);
1208  for (UInt i (0); i < M_nbQuadPt; ++i)
1209  {
1210  // we have fieldDim * DoF basis functions
1211  M_d2phi[i].resize ( M_nbFEDof );
1212  }
1213 
1214  // laplacian
1215  M_laplacian.resize (M_nbQuadPt);
1216  for (UInt i (0); i < M_nbQuadPt; ++i)
1217  {
1218  // we have fieldDim * DoF basis functions
1219  M_laplacian[i].resize ( M_nbFEDof );
1220  }
1221 
1222 }
1223 
1224 
1225 template <UInt spaceDim>
1226 void
1227 ETCurrentFE<spaceDim, 1>::
1228 updateQuadNode (const UInt& iQuadPt)
1229 {
1230  // Check the requirements
1231  ASSERT (M_isCellNodeUpdated, "Cell must be updated to compute the quadrature node position");
1232 
1233  // Set the check boolean
1234 #ifdef HAVE_LIFEV_DEBUG
1235  M_isQuadNodeUpdated = true;
1236 #endif
1237 
1238  for (UInt iDim (0); iDim < S_spaceDimension; ++iDim)
1239  {
1240  M_quadNode[iQuadPt][iDim] = 0.0;
1241 
1242  for (UInt iDof (0); iDof < M_nbMapDof; ++iDof)
1243  {
1244  M_quadNode[iQuadPt][iDim] += M_cellNode[iDof][iDim] * M_phiMap[iQuadPt][iDof];
1245  }
1246  }
1247 }
1248 
1249 
1250 template< UInt spaceDim>
1251 void
1252 ETCurrentFE<spaceDim, 1>::
1253 updateJacobian (const UInt& iQuadPt)
1254 {
1255  // Check the requirements
1256  ASSERT (M_isCellNodeUpdated, "Cell must be updated to compute the jacobian");
1257 
1258  // Set the check boolean
1259 #ifdef HAVE_LIFEV_DEBUG
1260  M_isJacobianUpdated = true;
1261 #endif
1262 
1263  Real partialSum (0.0);
1264  for (UInt iDim (0); iDim < S_spaceDimension; ++iDim)
1265  {
1266  for (UInt jDim (0); jDim < S_spaceDimension; ++jDim)
1267  {
1268  partialSum = 0.0;
1269  for (UInt iterNode (0); iterNode < M_nbMapDof; ++iterNode)
1270  {
1271  partialSum += M_cellNode[iterNode][iDim] * M_dphiGeometricMap[iQuadPt][iterNode][jDim];
1272  }
1273 
1274  M_jacobian[iQuadPt][iDim][jDim] = partialSum;
1275  }
1276  }
1277 }
1278 
1279 template< UInt spaceDim>
1280 void
1281 ETCurrentFE<spaceDim, 1>::
1282 updateWDet (const UInt& iQuadPt)
1283 {
1284  ASSERT (M_isDetJacobianUpdated, "Determinant of the jacobian must be updated to compute WDet");
1285 
1286 #ifdef HAVE_LIFEV_DEBUG
1287  M_isWDetUpdated = true;
1288 #endif
1289 
1290  M_wDet[iQuadPt] = M_detJacobian[iQuadPt] * M_quadratureRule->weight (iQuadPt);
1291 }
1292 
1293 
1294 template< UInt spaceDim>
1295 void
1296 ETCurrentFE<spaceDim, 1>::
1297 updateDphi (const UInt& iQuadPt)
1298 {
1299  ASSERT (M_isInverseJacobianUpdated,
1300  "Inverse jacobian must be updated to compute the derivative of the basis functions");
1301 
1302 #ifdef HAVE_LIFEV_DEBUG
1303  M_isDphiUpdated = true;
1304 #endif
1305 
1306  Real partialSum (0.0);
1307 
1308  for (UInt iDof (0); iDof < M_nbFEDof; ++iDof)
1309  {
1310  for (UInt iCoor (0); iCoor < S_spaceDimension; ++iCoor)
1311  {
1312  partialSum = 0.0;
1313  for (UInt jCoor (0); jCoor < S_spaceDimension; ++jCoor)
1314  {
1315  partialSum += M_tInverseJacobian[iQuadPt][iCoor][jCoor] * M_dphiReferenceFE[iQuadPt][iDof][jCoor];
1316  }
1317  M_dphi[iQuadPt][iDof][iCoor] = partialSum;
1318  }
1319  }
1320 }
1321 
1322 template< UInt spaceDim>
1323 void ETCurrentFE< spaceDim, 1 >::updateD2phi ( const UInt& iQuadPt )
1324 {
1325  ASSERT ( M_isInverseJacobianUpdated,
1326  "Inverse jacobian must be updated to compute the derivative of the basis functions" );
1327 
1328 #ifdef HAVE_LIFEV_DEBUG
1329  M_isD2phiUpdated = true;
1330 #endif
1331 
1332  Real partialSum ( 0.0 );
1333 
1334  for ( UInt iDof ( 0 ); iDof < M_nbFEDof; ++iDof )
1335  {
1336  for ( UInt iCoor ( 0 ); iCoor < S_spaceDimension; ++iCoor )
1337  {
1338  for ( UInt jCoor ( 0 ); jCoor < S_spaceDimension; ++jCoor )
1339  {
1340  partialSum = 0.0;
1341  for ( UInt k1 (0); k1 < S_spaceDimension; ++k1 )
1342  {
1343  for ( UInt k2 (0) ; k2 < S_spaceDimension; ++k2 )
1344  {
1345  partialSum += M_tInverseJacobian[iQuadPt][iCoor][k1]
1346  * M_d2phiReferenceFE[iQuadPt][iDof][k1][k2]
1347  * M_tInverseJacobian[iQuadPt][jCoor][k2];
1348  }
1349  }
1350 
1351  M_d2phi[iQuadPt][iDof][iCoor][jCoor] = partialSum;
1352  }
1353  }
1354  }
1355 }
1356 
1357 template< UInt spaceDim >
1358 void ETCurrentFE< spaceDim, 1 >::updateLaplacian ( const UInt& iQuadPt )
1359 {
1360  ASSERT ( M_isD2phiUpdated,
1361  "Basis function second derivatives must be updated to compute the laplacian" );
1362 
1363 #ifdef HAVE_LIFEV_DEBUG
1364  M_isLaplacianUpdated = true;
1365 #endif
1366 
1367  Real partialSum ( 0.0 );
1368 
1369  for ( UInt iDof ( 0 ); iDof < M_nbFEDof; ++iDof )
1370  {
1371  partialSum = 0.0;
1372  for ( UInt iCoor ( 0 ); iCoor < S_spaceDimension; ++iCoor )
1373  {
1374  partialSum += M_d2phi[iQuadPt][iDof][iCoor][iCoor];
1375  }
1376 
1377  M_laplacian[iQuadPt][iDof] = partialSum;
1378  }
1379 }
1380 
1381 template< UInt spaceDim>
1382 template< typename ElementType >
1383 void
1384 ETCurrentFE<spaceDim, 1>::
1385 updateCellNode (const ElementType& element)
1386 {
1387 
1388 #ifdef HAVE_LIFEV_DEBUG
1389  M_isCellNodeUpdated = true;
1390 #endif
1391 
1392  M_currentId = element.id();
1393  M_currentLocalId = element.localId();
1394 
1395  for ( UInt i (0); i < M_nbMapDof; ++i )
1396  {
1397  for ( UInt icoor (0); icoor < S_spaceDimension; ++icoor)
1398  {
1399  M_cellNode[i][icoor] = element.point (i).coordinate (icoor);
1400  }
1401  }
1402 }
1403 
1404 template< UInt spaceDim >
1405 void
1406 ETCurrentFE<spaceDim, 1>::
1407 updateCellNode (const std::vector<VectorSmall<spaceDim> >& ptsCoordinates)
1408 {
1409 #ifdef HAVE_LIFEV_DEBUG
1410  M_isCellNodeUpdated = true;
1411 #endif
1412 
1413  ASSERT ( ptsCoordinates.size() == M_nbMapDof, "Number of points does not define the right geometric shape.");
1414 
1415  for ( UInt i (0); i < M_nbMapDof; ++i )
1416  {
1417  for ( UInt icoor (0); icoor < S_spaceDimension; ++icoor)
1418  {
1419  M_cellNode[i][icoor] = ptsCoordinates[i][icoor];
1420  }
1421  }
1422 }
1423 
1424 template< UInt spaceDim>
1425 void
1426 ETCurrentFE<spaceDim, 1>::
1428 {
1429  ASSERT (M_isCellNodeUpdated, "Cell must be updated to compute the diameter");
1430 
1431 #ifdef HAVE_LIFEV_DEBUG
1432  M_isDiameterUpdated = true;
1433 #endif
1434 
1435  M_diameter = 0.0;
1436  Real dist;
1437 
1438  for ( UInt i (0); i < M_nbMapDof; ++i )
1439  {
1440  for ( UInt j (i + 1); j < M_nbMapDof; ++j)
1441  {
1442  dist = 0.0;
1443  for ( UInt icoor (0); icoor < S_spaceDimension; ++icoor)
1444  {
1445  dist += (M_cellNode[i][icoor] - M_cellNode[j][icoor]) * (M_cellNode[i][icoor] - M_cellNode[j][icoor]);
1446  }
1447  M_diameter = std::max (M_diameter, dist);
1448  }
1449  }
1450 
1451  M_diameter = std::sqrt (M_diameter);
1452 }
1453 
1454 template< UInt spaceDim>
1455 void
1456 ETCurrentFE<spaceDim, 1>::
1458 {
1459  ASSERT (M_isCellNodeUpdated, "Cell must be updated to compute the metric");
1460 
1461 #ifdef HAVE_LIFEV_DEBUG
1462  M_isMetricUpdated = true;
1463 #endif
1464 
1465  // Coordinates vertices tetrahedron
1466 
1467  Real x1 = M_cellNode[0][0]; Real y1 = M_cellNode[0][1]; Real z1 = M_cellNode[0][2];
1468  Real x2 = M_cellNode[1][0]; Real y2 = M_cellNode[1][1]; Real z2 = M_cellNode[1][2];
1469  Real x3 = M_cellNode[2][0]; Real y3 = M_cellNode[2][1]; Real z3 = M_cellNode[2][2];
1470  Real x4 = M_cellNode[3][0]; Real y4 = M_cellNode[3][1]; Real z4 = M_cellNode[3][2];
1471 
1472  // Jacobian matrix
1473 
1474  Real J11 = x2-x1;
1475  Real J12 = x3-x1;
1476  Real J13 = x4-x1;
1477  Real J21 = y2-y1;
1478  Real J22 = y3-y1;
1479  Real J23 = y4-y1;
1480  Real J31 = z2-z1;
1481  Real J32 = z3-z1;
1482  Real J33 = z4-z1;
1483 
1484  Real detJ = (x2-x1)*( (y3-y1) * (z4-z1) - (y4-y1) * (z3-z1) ) - (x3-x1) * ( (y2-y1)*(z4-z1) - (z2-z1)*(y4-y1) ) + (x4-x1) * ( (y2-y1)*(z3-z1) - (z2-z1)*(y3-y1) );
1485 
1486  Real invJ11 = 1.0/detJ*(J22*J33-J32*J23);
1487  Real invJ12 = 1.0/detJ*(J13*J32-J33*J12);
1488  Real invJ13 = 1.0/detJ*(J12*J23-J22*J13);
1489  Real invJ21 = 1.0/detJ*(J23*J31-J33*J21);
1490  Real invJ22 = 1.0/detJ*(J11*J33-J31*J13);
1491  Real invJ23 = 1.0/detJ*(J13*J21-J23*J11);
1492  Real invJ31 = 1.0/detJ*(J21*J32-J31*J22);
1493  Real invJ32 = 1.0/detJ*(J12*J31-J32*J11);
1494  Real invJ33 = 1.0/detJ*(J11*J22-J21*J12);
1495 
1496  // Initialize to zero the entries of the metric tensor and metric vector
1497  for ( int i = 0; i < 3; ++i )
1498  {
1499  M_metricVector(i) = 0.0;
1500  for ( int j = 0; j < 3; ++j )
1501  {
1502  M_metricTensor(i,j) = 0.0;
1503  }
1504  }
1505 
1506  // Computing metric tensor
1507 
1508  M_metricTensor(0,0) = invJ11*invJ11 + invJ21*invJ21 + invJ31*invJ31;
1509  M_metricTensor(0,1) = invJ11*invJ12 + invJ21*invJ22 + invJ31*invJ32;
1510  M_metricTensor(0,2) = invJ11*invJ13 + invJ21*invJ23 + invJ31*invJ33;
1511 
1512  M_metricTensor(1,0) = invJ12*invJ11 + invJ22*invJ21 + invJ32*invJ31;
1513  M_metricTensor(1,1) = invJ12*invJ12 + invJ22*invJ22 + invJ32*invJ32;
1514  M_metricTensor(1,2) = invJ12*invJ13 + invJ22*invJ23 + invJ32*invJ33;
1515 
1516  M_metricTensor(2,0) = invJ13*invJ11 + invJ23*invJ21 + invJ33*invJ31;
1517  M_metricTensor(2,1) = invJ13*invJ12 + invJ23*invJ22 + invJ33*invJ32;
1518  M_metricTensor(2,2) = invJ13*invJ13 + invJ23*invJ23 + invJ33*invJ33;
1519 
1520  // Computing metric vector
1521 
1522  M_metricVector(0) = invJ11 + invJ21 + invJ31;
1523  M_metricVector(1) = invJ12 + invJ22 + invJ32;
1524  M_metricVector(2) = invJ13 + invJ23 + invJ33;
1525 
1526 }
1527 
1528 template< UInt spaceDim>
1529 void
1530 ETCurrentFE<spaceDim, 1>::
1532 {
1533  ASSERT (M_isWDetUpdated, "Wdet must be updated to compute the measure");
1534 
1535 #ifdef HAVE_LIFEV_DEBUG
1536  M_isMeasureUpdated = true;
1537 #endif
1538 
1539  M_measure = 0.0;
1540 
1541  for (UInt iq (0); iq < M_nbQuadPt; ++iq)
1542  {
1543  M_measure += M_wDet[iq];
1544  }
1545 }
1546 
1547 
1548 } // Namespace LifeV
1549 
1550 #endif /* ETCURRENTFE_HPP */
void updateWDet(const UInt &iQuadPt)
Update WeightedJacobian.
void updateCellNode(const ElementType &element)
Update the cell nodes.
VectorSmall< spaceDim > array1D_Return_Type
VectorSmall< spaceDim > const & dphi(const UInt &i, const UInt &q) const
Getter for the derivatives of the basis function in the quadrature nodes (current element) ...
friend class ExpressionAssembly::EvaluationHK
Friend to allow direct access to the raw data.
GeometricMap - Structure for the geometrical mapping.
const Real & weight(const UInt &ig) const
weight(ig) is the ig-th quadrature weight
void updateLaplacian(const UInt &iQuadPt)
Update Laplacian.
friend class ExpressionAssembly::EvaluationDetJacobian
Friend to allow direct access to the raw data.
void updateDiameter()
Update the diameter of the cell.
friend class ExpressionAssembly::EvaluationLaplacianJ
Friend to allow direct access to the raw data.
uint32_type flag_Type
bit-flag with up to 32 different flags
Definition: LifeV.hpp:197
void updateDetJacobian(const UInt &iQuadPt)
Update DetJacobian.
Real const & laplacian(const UInt &i, const UInt &q) const
Getter for the derivatives of the basis function in the quadrature nodes (current element) ...
void updateQuadNode(const UInt &iQuadPt)
Update the quadrature nodes.
UInt nbFEDof() const
Getter for the number of degrees of freedom of this element.
std::vector< VectorSmall< spaceDim > > array1D_vector_Type
friend class ExpressionAssembly::EvaluationPhiI
Friend to allow direct access to the raw data.
MatrixSmall< 3, 3 > metricTensor() const
Getter for the metricTensor of the current element.
friend class ExpressionAssembly::EvaluationPosition
Friend to allow direct access to the raw data.
void updateD2phi(const UInt &iQuadPt)
Update D2phi.
Real dPhi(UInt i, UInt icoor, const GeoVector &v) const
return the value of the icoor-th derivative of the i-th basis function on point v ...
QuadratureRule(const QuadratureRule &qr)
Copy constructor.
void updateInverseJacobian(const UInt &iQuadPt)
static const UInt S_spaceDimension
Static value for the space dimension.
std::vector< array2D_Type > array3D_Type
void setupInternalConstants()
Resize all the internal containers w.r. to the stored data and compute the constant values...
ETCurrentFE(const ETCurrentFE< spaceDim, 1 > &otherFE)
Copy constructor.
Real measure() const
Getter for the measure of the current element.
void updateJacobian(const UInt &iQuadPt)
Update Jacobian.
Real phi(const UInt &i, const UInt &q) const
Getter for the values of the basis functions in the quadrature nodes in the current element...
std::vector< array1D_Type > array2D_Type
friend class ExpressionAssembly::EvaluationDphiI
Friend to allow direct access to the raw data.
MatrixSmall< 3, 3 > M_metricTensor
ETCurrentFE()
No default constructor.
std::vector< Real > array1D_Type
void update(const elementType &element, const flag_Type &flag)
Update method.
const GeoVector & quadPointCoor(const UInt &ig) const
quadPointCoor(ig) is the full coordinates of the quadrature point ig
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90
UInt currentId() const
Getter for the identifier of the current element.
Real detJac() const
Getter for the eterminant of the jacobian of the current element.
void operator=(const ETCurrentFE< spaceDim, 1 > &)
No assignement.
void updateMeasure()
Update the measure of the cell.
virtual ~ETCurrentFE()
Destructor.
void updateMetric()
Update the metric of the cell.
void updateInverseJacobian(const UInt &iQuadPt)
Update InverseJacobian.
std::vector< std::vector< MatrixSmall< spaceDim, spaceDim > > > array2D_matrix_Type
Real diameter() const
Getter for the diameter of the current element.
friend class ExpressionAssembly::EvaluationMeas
Friend to allow direct access to the raw data.
const GeometricMap * M_geometricMap
const UInt & nbDof() const
Return the number of degrees of freedom for this reference element.
const ReferenceFE * M_referenceFE
Real dphi(const UInt &i, const UInt &dxi, const UInt &q) const
Getter for the derivatives of the basis function in the quadrature nodes (current element) ...
VectorSmall< 3 > metricVector() const
Getter for the metricTensor of the current element.
double Real
Generic real data.
Definition: LifeV.hpp:175
Real wDet(const UInt &q) const
Getter for the weighted jacobian determinant (current element)
ETCurrentFE(const ReferenceFE &refFE, const GeometricMap &geoMap, const QuadratureRule &qr)
Full constructor.
friend class ExpressionAssembly::EvaluationLaplacianI
Friend to allow direct access to the raw data.
The class for a reference Lagrangian finite element.
void updateCellNode(const std::vector< VectorSmall< spaceDim > > &ptsCoordinates)
Update the cell nodes with a std::vector of points.
friend class ExpressionAssembly::EvaluationDphiJ
Friend to allow direct access to the raw data.
VectorSmall()
Empty constructor (all components are set to zero)
std::vector< std::vector< VectorSmall< spaceDim > > > array2D_vector_Type
ETCurrentFE(const ReferenceFE &refFE, const GeometricMap &geoMap)
Constructor without quadrature rule.
void updateDphi(const UInt &iQuadPt)
Update Dphi.
static const UInt S_fieldDimension
Static value for the dimension of the field (1 here as it is a scalar FE)
const QuadratureRule * M_quadratureRule
friend class ExpressionAssembly::EvaluationMetricVector
Friend to allow direct access to the raw data.
QuadratureRule - The basis class for storing and accessing quadrature rules.
void showMe(std::ostream &out=std::cout) const
ShowMe method.
Real phi(UInt i, const GeoVector &v) const
Return the value of the i-th basis function in the point v.
friend class ExpressionAssembly::EvaluationPhiJ
Friend to allow direct access to the raw data.
void setQuadratureRule(const QuadratureRule &qr)
Setter for the quadrature rule.
const UInt & nbQuadPt() const
Getter for the number of quadrature points.
friend class ExpressionAssembly::EvaluationMetricTensor
Friend to allow direct access to the raw data.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
std::vector< array3D_Type > array4D_Type
Real quadNode(const UInt &q, const UInt &coord) const
Getter for the coordinates of the quadrature nodes in the current element.