LifeV
DOF.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 LifeV.
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 License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief Degrees of freedom, the class that provides the localtoglobal table
30 
31  @author M.A. Fernandez & Luca Formaggia
32  @date 00-07-2002
33 
34  @contributor Vincent Martin
35  Mohamed Belhadj
36  Samuel Quinodoz <samuel.quinodoz@epfl.ch>
37  @mantainer Samuel Quinodoz <samuel.quinodoz@epfl.ch>
38 
39  The numbering of the degrees of freedom follow the order
40  Vertices - Edges - Faces - Volumes
41  If more than one degree of freedon is associated to a geometrical entity, the
42  global numbering associated to two "consecutive" degree of freedom on the given
43  entity is consecutive, and the order is according to the entity orientation.
44 
45  */
46 
47 #ifndef _DOF_HH
48 #define _DOF_HH
49 
50 #include <algorithm>
51 
52 #include <lifev/core/LifeV.hpp>
53 
54 #include <lifev/core/array/ArraySimple.hpp>
55 #include <lifev/core/array/MapEpetraData.hpp>
56 
57 #include <lifev/core/fem/DOFLocalPattern.hpp>
58 
59 #include <lifev/core/mesh/ElementShapes.hpp>
60 
61 #include <lifev/core/mesh/MeshEntity.hpp>
62 
63 namespace LifeV
64 {
65 /*! Local-to-global table
66 
67 This class provides the localtoglobal table that relates the local DOF of
68 a finite element to its global numbering. It needs a DOFLocalPattern in
69 order to obtain all the necessary information about the local pattern. In
70 fact it stores a copy of it so to make the local pattern available, if
71 needed.
72 
73 It is useless until is has not been set up on a specific RegionMesh. This is accomplished either by
74 passing the mesh to the constructor, or calling the method DOF::update().
75 
76 \note The methods bulds the table for ALL degrees of freedom, i.e. it does not handle any essential
77 boundary condition.
78 
79 Now the class include also a local-to-global table with DOF grouped by (internal) face
80 that was implemented in the old versions into the dofByFace.hpp and dofByFace.cpp files created by D. A. Di Pietro in 2004
81 
82 @note The dof numbering refers to the global numbering, not the numbering local to a partition of a partitioned mesh
83 @todo This class must be bettered. The logic by which the dof table is built may fail for certain type of elements.
84 */
85 class DOF
86 {
87 public:
88 
89  //! @name Public Types
90  //@{
91  //@}
92 
93 
94  //! @name Constructor & Destructor
95  //@{
96 
97  /*! The minimal constructor
98  \param fePattern is the DOFLocalPattern on which the ref FE is built
99  \param Offset: the smallest DOF numbering. It might be used if we want the
100  degrees of freedom numbering start from a specific value.
101  */
102  DOF ( const DOFLocalPattern& fePattern);
103 
104  //! Copy constructor
105  DOF ( const DOF& dof2 );
106 
107  //! Constructor accepting a mesh as parameter
108  /*!
109  \param mesh a RegionMesh
110  \param _fe is the DOFLocalPattern on which the ref FE is built
111  \param Offset: the smallest DOF numbering. It might be used if we want the
112  degrees of freedom numbering start from a specific value.
113  */
114  template <typename MeshType>
115  DOF ( MeshType& mesh, const DOFLocalPattern& fePattern);
116 
117  //@}
118 
119 
120  //! @name Methods
121  //@{
122 
123  //! Build the localToGlobal table
124  /*!
125  \param mesh A RegionMesh
126  Updates the LocaltoGlobal array
127  */
128  template <typename MeshType>
129  void update ( MeshType& );
130 
131  //! Build the globalElements list
132  /*!
133  @param mesh A RegionMesh
134  */
135  template <typename MeshType>
137 
138  template <typename MeshType>
139  MapEpetraData createMapData ( MeshType& mesh );
140 
141  /*!
142  Returns the global numbering of a DOF, given an boundary facet and the
143  local numbering
144  \param faceId the boundary facet ID
145  \param localDOF the local DOF numbering
146  \return The global numbering of the DOF
147  */
148  ID localToGlobalMapByBdFacet (const ID& facetId, const ID& localDof ) const;
149 
151  {
152  return M_localToGlobalByBdFacet[facetId];
153  }
154 
155  //! Ouput
156  void showMe ( std::ostream& out = std::cout, bool verbose = false ) const;
157  void showMeByBdFacet (std::ostream& out = std::cout, bool verbose = false) const;
158 
159  //@}
160 
161 
162  //! @name Set Methods
163  //@{
164 
165  void setTotalDof (const UInt& totalDof)
166  {
167  M_totalDof = totalDof;
168  }
169 
170  //@}
171 
172 
173  //! @name Get Methods
174  //@{
175 
176  //! The total number of Dof
177  const UInt& numTotalDof() const
178  {
179  return M_totalDof;
180  }
181 
182  //! The number of local DOF (nodes) in the finite element
183  const UInt& numLocalDof() const
184  {
186  }
187 
188  //! Return the specified entries of the localToGlobal table
189  /*!
190  Returns the global numbering of a DOF, given an element and the local numbering
191  \param ELId the element ID
192  \param localNode the local DOF numbering
193  \return The numbering of the DOF
194  */
195  const ID& localToGlobalMap ( const ID ElId, const ID localNode) const
196  {
197  return M_localToGlobal ( localNode, ElId );
198  }
199 
200  //! Number of elements in mesh
201  const UInt& numElements() const
202  {
203  return M_numElement;
204  }
205 
206  //! Number of local vertices (in a elment)
207  const UInt& numLocalVertices() const
208  {
209  return M_nbLocalPeaks;
210  }
211 
212  //! Number of local edges (in a elment)
213  const UInt& numLocalEdges() const
214  {
215  return M_nbLocalRidges;
216  }
217 
218  //! Number of local faces (in a elment)
219  const UInt& numLocalFaces() const
220  {
221  return M_nbLocalFacets;
222  }
223 
224  //! Getter for the localDofPattern
226  {
227  return M_elementDofPattern;
228  }
229 
230 
231  //@}
232 
233 
234 
235 private:
236 
238 
239  typedef ID ( *facetToPointPtr_Type ) ( ID const& localFace, ID const& point );
240 
241  //! The pattern of the local degrees of freedom.
243 
244  // Total number of degrees of freedom
246 
247  // Number of elements in the considered mesh
249 
250 
254 
255  // The local to global table
257 
258  // The local to global table based on the boundary facets
260 
261  // local array that maps the local dof of the
262  facetToPointPtr_Type M_facetToPoint;
263 
264  // Just 5 counters
266 };
267 
268 
269 // ===================================================
270 // Constructors & Destructor
271 // ===================================================
272 
273 //! Constructor that builds the localToglobal table
274 template <typename MeshType>
275 DOF::DOF ( MeshType& mesh, const DOFLocalPattern& fePattern) :
276  M_elementDofPattern ( fePattern ),
277  M_totalDof ( 0 ),
278  M_numElement ( 0 ),
279  M_nbLocalPeaks ( 0 ),
280  M_nbLocalRidges ( 0 ),
281  M_nbLocalFacets ( 0 ),
282  M_localToGlobal ()
283 {
284  for ( UInt i = 0; i < 5; ++i )
285  {
286  M_dofPositionByEntity[ i ] = 0;
287  }
288  update ( mesh );
289 }
290 
291 // ===================================================
292 // Methods
293 // ===================================================
294 
295 //! Build the localToGlobal table
296 template <typename MeshType>
297 void DOF::update ( MeshType& mesh )
298 {
299 
300  typedef typename MeshType::elementShape_Type geoShape_Type;
301  typedef typename geoShape_Type::GeoBShape geoBShape_Type;
302 
303  // Some useful local variables, to save some typing
304  UInt nbLocalDofPerPeak = M_elementDofPattern.nbDofPerPeak();
305  UInt nbLocalDofPerRidge = M_elementDofPattern.nbDofPerRidge();
306  UInt nbLocalDofPerFacet = M_elementDofPattern.nbDofPerFacet();
307  UInt nbLocalDofPerElement = M_elementDofPattern.nbDofPerElement();
308 
309  M_nbLocalPeaks = geoShape_Type::S_numPeaks;
310  M_nbLocalRidges = geoShape_Type::S_numRidges;
311  M_nbLocalFacets = geoShape_Type::S_numFacets;
312 
313  M_numElement = mesh.numElements();
314 
315  UInt nbGlobalElements = mesh.numGlobalElements();
316  UInt nbGlobalRidges = mesh.numGlobalRidges();
317  UInt nbGlobalPeaks = mesh.numGlobalPeaks();
318  UInt nbGlobalFacets = mesh.numGlobalFacets();
319 
320  UInt nbDofElemPeaks = nbLocalDofPerPeak * M_nbLocalPeaks; // number of vertex's DOF on a Element
321  UInt nbDofElemRidges = nbLocalDofPerRidge * M_nbLocalRidges; // number of edge's DOF on a Element
322 
323 
324  UInt i, l, ie;
325 
326  // Total number of degree of freedom for each element
327  UInt nldof = nbLocalDofPerElement
328  + nbLocalDofPerRidge * M_nbLocalRidges
329  + nbLocalDofPerPeak * M_nbLocalPeaks
330  + nbLocalDofPerFacet * M_nbLocalFacets;
331 
332  // Consistency check
333  ASSERT_PRE ( nldof == UInt ( M_elementDofPattern.nbLocalDof() ), "Something wrong in FE specification" ) ;
334 
335  // Global total of degrees of freedom
336  M_totalDof = nbGlobalElements * nbLocalDofPerElement
337  + nbGlobalRidges * nbLocalDofPerRidge
338  + nbGlobalPeaks * nbLocalDofPerPeak
339  + nbGlobalFacets * nbLocalDofPerFacet;
340 
341  // Reshape the container to fit the needs
342  M_localToGlobal.reshape ( nldof, M_numElement );
343 
344  // Make sure the mesh has everything needed
345  bool update_ridges ( nbLocalDofPerRidge != 0 && ! mesh.hasLocalRidges() && (MeshType::S_geoDimensions == 3) );
346  if ( update_ridges )
347  {
348  mesh.updateElementRidges();
349  }
350 
351  bool update_facets ( nbLocalDofPerFacet != 0 && ! mesh.hasLocalFacets() );
352  if ( update_facets )
353  {
354  mesh.updateElementFacets();
355  }
356 
357  UInt gcount ( 0 );
358  UInt lcount;
359  UInt lc;
360 
361  // Peak Based DOFs
362  M_dofPositionByEntity[ 0 ] = gcount;
363  if ( nbLocalDofPerPeak > 0 )
364  for ( ie = 0; ie < M_numElement; ++ie ) //for each element
365  {
366  lc = 0;
367  for ( i = 0; i < M_nbLocalPeaks; ++i ) //for each vertex in the element
368  {
369  ID pID = mesh.element ( ie ).point ( i ).id();
370  for ( l = 0; l < nbLocalDofPerPeak; ++l ) //for each degree of freedom per vertex
371  {
372  // label of the ith point of the mesh element
373  UInt dof = gcount + pID * nbLocalDofPerPeak + l;
374  ASSERT ( dof != NotAnId, "the dof is not properly set" );
375  M_localToGlobal ( lc++, ie ) = dof;
376  }
377  }
378  }
379 
380  // Ridge Based DOFs
381  gcount += nbLocalDofPerPeak * nbGlobalPeaks;//dof per vertex * total # vertices
382  lcount = nbLocalDofPerPeak * M_nbLocalPeaks;
383  M_dofPositionByEntity[ 1 ] = gcount;
384 
385  if ( nbLocalDofPerRidge > 0 )
386  for ( ie = 0; ie < M_numElement; ++ie )
387  {
388  lc = lcount;
389  for ( i = 0; i < M_nbLocalRidges; ++i )
390  {
391  UInt rID = mesh.ridge (mesh.localRidgeId (ie, i) ).id();
392  for ( l = 0; l < nbLocalDofPerRidge; ++l )
393  {
394  UInt dof = gcount + rID * nbLocalDofPerRidge + l;
395  ASSERT ( dof != NotAnId, "the dof is not properly set" );
396  M_localToGlobal ( lc++, ie ) = dof;
397  }
398  }
399  }
400 
401  //Facet based DOFs
402  gcount += nbGlobalRidges * nbLocalDofPerRidge;
403  lcount += nbLocalDofPerRidge * M_nbLocalRidges;
404  M_dofPositionByEntity[ 2 ] = gcount;
405 
406  if ( nbLocalDofPerFacet > 0 )
407  for ( ie = 0; ie < M_numElement; ++ie )
408  {
409  lc = lcount;
410 
411  for ( i = 0; i < M_nbLocalFacets; ++i )
412  {
413  UInt fID = mesh.facet ( mesh.localFacetId ( ie, i ) ).id();
414  for ( l = 0; l < nbLocalDofPerFacet; ++l )
415  {
416  UInt dof = gcount + fID * nbLocalDofPerFacet + l;
417  ASSERT ( dof != NotAnId, "the dof is not properly set" );
418  M_localToGlobal ( lc++, ie ) = dof;
419  }
420  }
421  }
422 
423  // Element Based DOFs
424  gcount += nbGlobalFacets * nbLocalDofPerFacet;
425  lcount += nbLocalDofPerFacet * M_nbLocalFacets;
426 
427  M_dofPositionByEntity[ 3 ] = gcount;
428  if ( nbLocalDofPerElement > 0 )
429  for ( ie = 0; ie < M_numElement; ++ie )
430  {
431  lc = lcount;
432  ID eID = mesh.element ( ie ).id();
433  for ( l = 0; l < nbLocalDofPerElement; ++l )
434  {
435  UInt dof = gcount + eID * nbLocalDofPerElement + l;
436  ASSERT ( dof != NotAnId, "the dof is not properly set" );
437  M_localToGlobal ( lc++, ie ) = dof;
438  }
439  }
440  gcount += nbGlobalElements * nbLocalDofPerElement;
441  M_dofPositionByEntity[ 4 ] = gcount;
442 
443  ASSERT_POS ( gcount == M_totalDof , "Something wrong in Dof Setup " << gcount << " " << M_totalDof ) ;
444 
445  //Building map of global DOF on boundary facets
446  UInt nBElemRidges = geoBShape_Type::S_numRidges; // Number of boundary facet's vertices
447  UInt nBElemFacets = geoBShape_Type::S_numFacets; // Number of boundary facet's edges
448 
449  std::vector<ID> globalDOFOnBdFacet (nbLocalDofPerPeak * nBElemRidges + nBElemFacets * nbLocalDofPerRidge + nbLocalDofPerFacet);
450  M_localToGlobalByBdFacet.resize (mesh.numBoundaryFacets() );
451 
452  for ( ID iBoundaryFacet = 0 ; iBoundaryFacet < mesh.numBoundaryFacets(); ++iBoundaryFacet )
453  {
454  ID iAdjacentElem = mesh.boundaryFacet ( iBoundaryFacet ).firstAdjacentElementIdentity(); // id of the element adjacent to the face
455  ID iElemBFacet = mesh.boundaryFacet ( iBoundaryFacet ).firstAdjacentElementPosition(); // local id of the face in its adjacent element
456 
457  UInt lDof (0), dofOffset; //local DOF on boundary element
458 
459  //loop on Dofs associated with peaks
460  if (nbLocalDofPerPeak)
461  for ( ID iBElemRidge = 0; iBElemRidge < nBElemRidges; ++iBElemRidge )
462  {
463  ID iElemPeak = geoShape_Type::facetToPeak ( iElemBFacet, iBElemRidge ); // local vertex number (in element)
464  dofOffset = iElemPeak * nbLocalDofPerPeak;
465  for ( ID l = 0; l < nbLocalDofPerPeak; ++l )
466  {
467  globalDOFOnBdFacet[ lDof++ ] = M_localToGlobal ( dofOffset + l, iAdjacentElem );
468  }
469  }
470 
471  //loop on Dofs associated with Ridges
472  if (nbLocalDofPerRidge)
473  for ( ID iBElemFacets = 0; iBElemFacets < nBElemFacets; ++iBElemFacets )
474  {
475  ID iElemRidge = geoShape_Type::facetToRidge ( iElemBFacet, iBElemFacets ); // local edge number (in element)
476  dofOffset = nbDofElemPeaks + iElemRidge * nbLocalDofPerRidge;
477  for ( ID l = 0; l < nbLocalDofPerRidge; ++l )
478  {
479  globalDOFOnBdFacet[ lDof++ ] = M_localToGlobal ( dofOffset + l, iAdjacentElem ); // global Dof
480  }
481  }
482 
483  //loop on Dofs associated with facets
484  dofOffset = nbDofElemPeaks + nbDofElemRidges + iElemBFacet * nbLocalDofPerFacet;
485  for ( ID l = 0; l < nbLocalDofPerFacet; ++l )
486  {
487  globalDOFOnBdFacet[ lDof++ ] = M_localToGlobal ( dofOffset + l, iAdjacentElem ); // global Dof
488  }
489 
490 
491  M_localToGlobalByBdFacet[iBoundaryFacet] = globalDOFOnBdFacet;
492  }
493 
494 
495  if ( update_ridges )
496  {
497  mesh.cleanElementRidges();
498  }
499  if ( update_facets )
500  {
501  mesh.cleanElementFacets();
502  }
503 }
504 
505 template <typename MeshType>
507 {
508  /*
509  std::set<Int> dofNumberSet;
510  // Gather all dofs local to the given mesh (dofs use global numbering)
511  // The set ensures no repetition
512  for (UInt elementId=0; elementId < mesh.numElements(); ++elementId )
513  for (UInt localDof=0; localDof < this->numLocalDof();++localDof )
514  dofNumberSet.insert( static_cast<Int>( this->localToGlobalMap( elementId, localDof ) ) );
515  // dump the set into a vector for adjacency
516  // to save memory I use copy() and not the vector constructor directly
517  std::vector<Int> myGlobalElements( dofNumberSet.size() );
518  std::copy( dofNumberSet.begin(), dofNumberSet.end(), myGlobalElements.begin() );
519  // Save memory
520  dofNumberSet.clear();
521  */
522 
523  std::set<Int> myGlobalElementsSet;
524 
525  // insert dof associated to geometric entities owned by current proc
526  const UInt pointOffset ( 0 );
527  const UInt ridgeOffset ( pointOffset + M_elementDofPattern.nbDofPerPeak() * mesh.numGlobalPeaks() );
528  const UInt facetOffset ( ridgeOffset + M_elementDofPattern.nbDofPerRidge() * mesh.numGlobalRidges() );
529  const UInt elementOffset ( facetOffset + M_elementDofPattern.nbDofPerFacet() * mesh.numGlobalFacets() );
530 
531  for ( UInt i = 0; i < mesh.numElements(); i++ )
532  {
533  const typename MeshType::element_Type& element = mesh.element ( i );
534 
535  // point block
536  for ( UInt k = 0; k < element.S_numPoints; k++ )
537  {
538  const typename MeshType::point_Type point = element.point ( k );
539  if ( point.isOwned() )
540  {
541  for ( UInt d = 0; d < M_elementDofPattern.nbDofPerPeak(); d++ )
542  {
543  myGlobalElementsSet.insert ( pointOffset + point.id() + d * mesh.numGlobalPoints() );
544  }
545  }
546  }
547 
548  // ridge block
549  for ( UInt k = 0; k < element.S_numRidges; k++ )
550  {
551  const typename MeshType::ridge_Type ridge = mesh.ridge ( mesh.localRidgeId ( i, k ) );
552  if ( ridge.isOwned() )
553  {
554  for ( UInt d = 0; d < M_elementDofPattern.nbDofPerRidge(); d++ )
555  {
556  myGlobalElementsSet.insert ( ridgeOffset + ridge.id() + d * mesh.numGlobalRidges() );
557  }
558  }
559  }
560 
561  // facet block
562  for ( UInt k = 0; k < element.S_numFacets; k++ )
563  {
564  const typename MeshType::facet_Type facet = mesh.facet ( mesh.localFacetId ( i, k ) );
565  if ( facet.isOwned() )
566  {
567  for ( UInt d = 0; d < M_elementDofPattern.nbDofPerFacet(); d++ )
568  {
569  myGlobalElementsSet.insert ( facetOffset + facet.id() + d * mesh.numGlobalFacets() );
570  }
571  }
572  }
573 
574  // elem block
575  if ( element.isOwned() )
576  {
577  for ( UInt d = 0; d < M_elementDofPattern.nbDofPerElement(); d++ )
578  {
579  myGlobalElementsSet.insert ( elementOffset + element.id() + d * mesh.numGlobalFacets() );
580  }
581  }
582  }
583 
584  std::vector<Int> myGlobalElements ( myGlobalElementsSet.size() );
585  std::copy ( myGlobalElementsSet.begin(), myGlobalElementsSet.end(), myGlobalElements.begin() );
586 
587  return myGlobalElements;
588 }
589 
590 template <typename MeshType>
591 MapEpetraData DOF::createMapData ( MeshType& mesh )
592 {
593  std::set<Int> mapDataSetUnique;
594  std::set<Int> mapDataSetRepeated;
595 
596  // insert dof associated to geometric entities owned by current proc
597  const UInt pointOffset = 0;
598  const UInt ridgeOffset = pointOffset + M_elementDofPattern.nbDofPerPeak() * mesh.numGlobalPeaks();
599  const UInt facetOffset = ridgeOffset + M_elementDofPattern.nbDofPerRidge() * mesh.numGlobalRidges();
600  const UInt elementOffset = facetOffset + M_elementDofPattern.nbDofPerFacet() * mesh.numGlobalFacets();
601 
602  for ( UInt i = 0; i < mesh.numElements(); i++ )
603  {
604  const typename MeshType::element_Type& element = mesh.element ( i );
605 
606  // point block
607  for ( UInt k = 0; k < element.S_numPoints; k++ )
608  {
609  const typename MeshType::point_Type point = element.point ( k );
610  for ( UInt d = 0; d < M_elementDofPattern.nbDofPerPeak(); d++ )
611  {
612  if ( point.isOwned() )
613  {
614  mapDataSetUnique.insert ( pointOffset + point.id() + d * mesh.numGlobalPoints() );
615  }
616  mapDataSetRepeated.insert ( pointOffset + point.id() + d * mesh.numGlobalPoints() );
617  }
618  }
619 
620  // ridge block
621  for ( UInt k = 0; k < element.S_numRidges; k++ )
622  {
623  const typename MeshType::ridge_Type ridge = mesh.ridge ( mesh.localRidgeId ( i, k ) );
624  for ( UInt d = 0; d < M_elementDofPattern.nbDofPerRidge(); d++ )
625  {
626  if ( ridge.isOwned() )
627  {
628  mapDataSetUnique.insert ( ridgeOffset + ridge.id() + d * mesh.numGlobalRidges() );
629  }
630  mapDataSetRepeated.insert ( ridgeOffset + ridge.id() + d * mesh.numGlobalRidges() );
631  }
632  }
633 
634  // facet block
635  for ( UInt k = 0; k < element.S_numFacets; k++ )
636  {
637  const typename MeshType::facet_Type facet = mesh.facet ( mesh.localFacetId ( i, k ) );
638  for ( UInt d = 0; d < M_elementDofPattern.nbDofPerFacet(); d++ )
639  {
640  if ( facet.isOwned() )
641  {
642  mapDataSetUnique.insert ( facetOffset + facet.id() + d * mesh.numGlobalFacets() );
643  }
644  mapDataSetRepeated.insert ( facetOffset + facet.id() + d * mesh.numGlobalFacets() );
645  }
646  }
647 
648  // elem block
649  for ( UInt d = 0; d < M_elementDofPattern.nbDofPerElement(); d++ )
650  {
651  if ( element.isOwned() )
652  {
653  mapDataSetUnique.insert ( elementOffset + element.id() + d * mesh.numGlobalFacets() );
654  }
655  mapDataSetRepeated.insert ( elementOffset + element.id() + d * mesh.numGlobalFacets() );
656  }
657  }
658 
659  MapEpetraData mapData;
660  mapData.unique.assign ( mapDataSetUnique.begin(), mapDataSetUnique.end() );
661  mapData.repeated.assign ( mapDataSetRepeated.begin(), mapDataSetRepeated.end() );
662 
663  return mapData;
664 }
665 
666 }
667 #endif
const UInt & numLocalVertices() const
Number of local vertices (in a elment)
Definition: DOF.hpp:207
MapEpetraData createMapData(MeshType &mesh)
Definition: DOF.hpp:591
std::vector< std::vector< ID > > M_localToGlobalByBdFacet
Definition: DOF.hpp:259
UInt nbDofPerFacet() const
Return the number of degrees of freedom located on the facet. (face in 3D)
DOF(const DOFLocalPattern &fePattern)
Definition: DOF.cpp:50
void update(MeshType &)
Build the localToGlobal table.
Definition: DOF.hpp:297
UInt M_nbLocalFacets
Definition: DOF.hpp:253
UInt M_totalDof
Definition: DOF.hpp:245
const UInt & numLocalEdges() const
Number of local edges (in a elment)
Definition: DOF.hpp:213
Container_Type M_localToGlobal
Definition: DOF.hpp:256
const DOFLocalPattern & M_elementDofPattern
The pattern of the local degrees of freedom.
Definition: DOF.hpp:242
UInt M_numElement
Definition: DOF.hpp:248
const UInt & nbDofPerElement() const
Return the number of degrees of freedom located on the element. (volume in 3D)
void updateInverseJacobian(const UInt &iQuadPt)
UInt M_nbLocalRidges
Definition: DOF.hpp:252
const UInt & numElements() const
Number of elements in mesh.
Definition: DOF.hpp:201
DOF(const DOF &dof2)
Copy constructor.
Definition: DOF.cpp:60
const UInt & numLocalDof() const
The number of local DOF (nodes) in the finite element.
Definition: DOF.hpp:183
#define ASSERT_PRE(X, A)
Definition: LifeAssert.hpp:96
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90
uint32_type ID
IDs.
Definition: LifeV.hpp:194
vectorSize_Type const numberOfColumns() const
Return the number of columns.
const ID & localToGlobalMap(const ID ElId, const ID localNode) const
Return the specified entries of the localToGlobal table.
Definition: DOF.hpp:195
const UInt & numTotalDof() const
The total number of Dof.
Definition: DOF.hpp:177
void setTotalDof(const UInt &totalDof)
Definition: DOF.hpp:165
std::vector< ID > localToGlobalMapOnBdFacet(const ID &facetId) const
Definition: DOF.hpp:150
MapEpetraData.
DOFLocalPattern - A class to store the "couplings" between the basis functions.
ArraySimple< UInt > Container_Type
Definition: DOF.hpp:237
UInt nbDofPerPeak() const
Return the number of degrees of freedom located on the peak (vertex in 3D).
void showMe(std::ostream &out=std::cout, bool verbose=false) const
Ouput.
Definition: DOF.cpp:88
ID localToGlobalMapByBdFacet(const ID &facetId, const ID &localDof) const
Definition: DOF.cpp:81
UInt M_dofPositionByEntity[5]
Definition: DOF.hpp:265
std::vector< Int > globalElements(MeshType &mesh)
Build the globalElements list.
Definition: DOF.hpp:506
#define ASSERT_POS(X, A)
Definition: LifeAssert.hpp:102
const DOFLocalPattern & localDofPattern() const
Getter for the localDofPattern.
Definition: DOF.hpp:225
UInt M_nbLocalPeaks
Definition: DOF.hpp:251
facetToPointPtr_Type M_facetToPoint
Definition: DOF.hpp:262
const UInt & nbLocalDof() const
Return the number of local degrees of freedom.
DOF(MeshType &mesh, const DOFLocalPattern &fePattern)
Constructor accepting a mesh as parameter.
Definition: DOF.hpp:275
void showMeByBdFacet(std::ostream &out=std::cout, bool verbose=false) const
Definition: DOF.cpp:128
const UInt & numLocalFaces() const
Number of local faces (in a elment)
Definition: DOF.hpp:219
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
UInt nbDofPerRidge() const
Return the number of degrees of freedom located on the ridge. (edge in 3D)