1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_ALBERTAGRID_IMP_HH
4 #define DUNE_ALBERTAGRID_IMP_HH
5 
6 /** \file
7  *  \author Robert Kloefkorn and Martin Nolte
8  *  \brief  provides the AlbertaGrid class
9  */
10 
11 #if HAVE_ALBERTA || DOXYGEN
12 
13 #include <cassert>
14 #include <cstddef>
15 
16 #include <algorithm>
17 #include <iostream>
18 #include <fstream>
19 #include <memory>
20 #include <vector>
21 
22 // Dune includes
23 #include <dune/common/fvector.hh>
24 #include <dune/common/fmatrix.hh>
25 #include <dune/common/stdstreams.hh>
26 #include <dune/common/parallel/communication.hh>
27 
28 #include <dune/grid/common/grid.hh>
29 #include <dune/grid/common/gridfactory.hh>
30 #include <dune/grid/common/adaptcallback.hh>
31 #include <dune/grid/common/sizecache.hh>
32 
33 //- Local includes
34 // some cpp defines and include of alberta.h
35 #include "albertaheader.hh"
36 
37 #include <dune/grid/albertagrid/misc.hh>
38 #include <dune/grid/albertagrid/capabilities.hh>
39 #include <dune/grid/albertagrid/backuprestore.hh>
40 
41 #include <dune/grid/albertagrid/coordcache.hh>
42 #include <dune/grid/albertagrid/gridfamily.hh>
43 #include <dune/grid/albertagrid/level.hh>
44 #include <dune/grid/albertagrid/intersection.hh>
45 #include <dune/grid/albertagrid/intersectioniterator.hh>
46 #include <dune/grid/albertagrid/datahandle.hh>
47 #include <dune/grid/albertagrid/entityseed.hh>
48 
49 #include "indexsets.hh"
50 #include "geometry.hh"
51 #include "entity.hh"
52 #include "hierarchiciterator.hh"
53 #include "treeiterator.hh"
54 #include "leveliterator.hh"
55 #include "leafiterator.hh"
56 
57 namespace Dune
58 {
59 
60   // External Forward Declarations
61   // -----------------------------
62 
63   template< class Grid >
64   struct DGFGridFactory;
65 
66 
67 
68   // AlbertaGrid
69   // -----------
70 
71   /** \class AlbertaGrid
72    *  \brief [<em> provides \ref Dune::Grid </em>]
73    *  \brief simplicial grid imlementation from the ALBERTA finite element
74    *         toolbox
75    *  \ingroup GridImplementations
76    *  \ingroup AlbertaGrid
77    *
78    *  AlbertaGrid provides access to the grid from the ALBERTA finite element
79    *  toolbox through the %Dune interface.
80    *
81    *  ALBERTA is a finite element toolbox written by Alfred Schmidt and
82    *  Kunibert G. Siebert (see http://www.alberta-fem.de). It contains a
83    *  simplicial mesh in 1, 2 and 3 space dimensions that can be dynamically
84    *  adapted by a bisection algorithm.
85    *
86    *  Supported ALBERTA versions include 3.0 or higher.
87    *  It can be downloaded from the ALBERTA website
88    *  (https://gitlab.mathematik.uni-stuttgart.de/ians-nmh/alberta/alberta3).
89    *
90    *  After installing ALBERTA, just configure DUNE with the cmake option
91    *  <tt>-DAlberta_ROOT=[path/to/alberta]</tt> and provide the path to ALBERTA.
92    *
93    *  Each program linking to ALBERTA only supports a fixed dimension of world.
94    *  This is obtained from the <tt>ALBERTA_DIM</tt> preprocessor variable. This
95    *  variable and all other necessary link flags and libraries are set by the
96    *  cmake function <tt>add_dune_alberta_flags(WORLDDIM [N] [targets]...)</tt>
97    *  with N the world dimension.
98    *
99    *  CMake sets the config.h variables <tt>HAVE_ALBERTA</tt> that tells you whether
100    *  ALBERTA was found, and <tt>ALBERTA_DIM</tt> compile flags which tells you the
101    *  dimension of world <em>for this program</em>.
102    */
103   template< int dim, int dimworld = Alberta::dimWorld >
104   class AlbertaGrid
105     : public GridDefaultImplementation
106       < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >
107   {
108     typedef AlbertaGrid< dim, dimworld > This;
109     typedef GridDefaultImplementation
110     < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >
111     Base;
112 
113     template< int, int, class > friend class AlbertaGridEntity;
114     template< class > friend class AlbertaLevelGridView;
115     template< class > friend class AlbertaLeafGridView;
116     template< int, class, bool > friend class AlbertaGridTreeIterator;
117     template< class > friend class AlbertaGridHierarchicIterator;
118 
119     friend class GridFactory< This >;
120     friend struct DGFGridFactory< This >;
121 
122     friend class AlbertaGridIntersectionBase< const This >;
123     friend class AlbertaGridLeafIntersection< const This >;
124 
125     friend class AlbertaMarkerVector< dim, dimworld >;
126 #if (__GNUC__ < 4) && !(defined __ICC)
127     // add additional friend decls for gcc 3.4
128     friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities<true>;
129     friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities<false>;
130 #endif
131     friend class AlbertaGridIndexSet< dim, dimworld >;
132     friend class AlbertaGridHierarchicIndexSet< dim, dimworld >;
133 
134     template< class, class >
135     friend class Alberta::AdaptRestrictProlongHandler;
136 
137   public:
138     //! the grid family of AlbertaGrid
139     typedef AlbertaGridFamily< dim, dimworld > GridFamily;
140 
141     typedef typename GridFamily::ctype ctype;
142 
143     static const int dimension = GridFamily::dimension;
144     static const int dimensionworld = GridFamily::dimensionworld;
145 
146     // the Traits
147     typedef typename AlbertaGridFamily< dim, dimworld >::Traits Traits;
148 
149     //! type of leaf index set
150     typedef typename Traits::LeafIndexSet LeafIndexSet;
151     //! type of level index sets
152     typedef typename Traits::LevelIndexSet LevelIndexSet;
153 
154     //! type of hierarchic index set
155     typedef typename Traits::HierarchicIndexSet HierarchicIndexSet;
156 
157     //! type of global id set
158     typedef typename Traits::GlobalIdSet GlobalIdSet;
159     //! type of local id set
160     typedef typename Traits::LocalIdSet LocalIdSet;
161 
162     //! type of collective communication
163     typedef typename Traits::CollectiveCommunication CollectiveCommunication;
164 
165   private:
166     //! type of LeafIterator
167     typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
168 
169     //! id set impl
170     typedef AlbertaGridIdSet<dim,dimworld> IdSetImp;
171 
172     //! AdaptationState
173     struct AdaptationState
174     {
175       enum Phase { ComputationPhase, PreAdaptationPhase, PostAdaptationPhase };
176 
177     private:
178       Phase phase_;
179       int coarsenMarked_;
180       int refineMarked_;
181 
182     public:
AdaptationStateDune::AlbertaGrid::AdaptationState183       AdaptationState ()
184         : phase_( ComputationPhase ),
185           coarsenMarked_( 0 ),
186           refineMarked_( 0 )
187       {}
188 
markDune::AlbertaGrid::AdaptationState189       void mark ( int count )
190       {
191         if( count < 0 )
192           ++coarsenMarked_;
193         if( count > 0 )
194           refineMarked_ += (2 << count);
195       }
196 
unmarkDune::AlbertaGrid::AdaptationState197       void unmark ( int count )
198       {
199         if( count < 0 )
200           --coarsenMarked_;
201         if( count > 0 )
202           refineMarked_ -= (2 << count);
203       }
204 
coarsenDune::AlbertaGrid::AdaptationState205       bool coarsen () const
206       {
207         return (coarsenMarked_ > 0);
208       }
209 
refineMarkedDune::AlbertaGrid::AdaptationState210       int refineMarked () const
211       {
212         return refineMarked_;
213       }
214 
preAdaptDune::AlbertaGrid::AdaptationState215       void preAdapt ()
216       {
217         if( phase_ != ComputationPhase )
218           error( "preAdapt may only be called in computation phase." );
219         phase_ = PreAdaptationPhase;
220       }
221 
adaptDune::AlbertaGrid::AdaptationState222       void adapt ()
223       {
224         if( phase_ != PreAdaptationPhase )
225           error( "adapt may only be called in preadapdation phase." );
226         phase_ = PostAdaptationPhase;
227       }
228 
postAdaptDune::AlbertaGrid::AdaptationState229       void postAdapt ()
230       {
231         if( phase_ != PostAdaptationPhase )
232           error( "postAdapt may only be called in postadaptation phase." );
233         phase_ = ComputationPhase;
234 
235         coarsenMarked_ = 0;
236         refineMarked_ = 0;
237       }
238 
239     private:
errorDune::AlbertaGrid::AdaptationState240       void error ( const std::string &message )
241       {
242         DUNE_THROW( InvalidStateException, message );
243       }
244     };
245 
246     template< class DataHandler >
247     struct AdaptationCallback;
248 
249     // max number of allowed levels is 64
250     static const int MAXL = 64;
251 
252     typedef Alberta::ElementInfo< dimension > ElementInfo;
253     typedef Alberta::MeshPointer< dimension > MeshPointer;
254     typedef Alberta::HierarchyDofNumbering< dimension > DofNumbering;
255     typedef AlbertaGridLevelProvider< dimension > LevelProvider;
256 
257   public:
258     AlbertaGrid ( const This & ) = delete;
259     This &operator= ( const This & ) = delete;
260 
261     /** \brief create an empty grid */
262     AlbertaGrid ();
263 
264     /** \brief create a grid from an ALBERTA macro data structure
265      *
266      *  \param[in]  macroData   macro data to create grid from
267      *  \param[in]  projection  shared pointer to a global boundary projection (defaults to 0)
268      */
269     AlbertaGrid ( const Alberta::MacroData< dimension > &macroData,
270                   const std::shared_ptr< DuneBoundaryProjection< dimensionworld > > &projection
271                     = std::shared_ptr< DuneBoundaryProjection< dimensionworld > >() );
272 
273     template< class Proj, class Impl >
274     AlbertaGrid ( const Alberta::MacroData< dimension > &macroData,
275                   const Alberta::ProjectionFactoryInterface< Proj, Impl > &projectionFactory );
276 
277     /** \brief create a grid from an ALBERTA macro grid file
278      *
279      *  \param[in]  macroGridFileName  name of the macro grid file
280      */
281     AlbertaGrid ( const std::string &macroGridFileName );
282 
283     /** \brief desctructor */
284     ~AlbertaGrid ();
285 
286     //! Return maximum level defined in this grid. Levels are numbered
287     //! 0 ... maxLevel with 0 the coarsest level.
288     int maxLevel () const;
289 
290     //! Iterator to first entity of given codim on level
291     template<int cd, PartitionIteratorType pitype>
292     typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
293     lbegin (int level) const;
294 
295     //! one past the end on this level
296     template<int cd, PartitionIteratorType pitype>
297     typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
298     lend (int level) const;
299 
300     //! Iterator to first entity of given codim on level
301     template< int codim >
302     typename Traits::template Codim< codim >::LevelIterator
303     lbegin ( int level ) const;
304 
305     //! one past the end on this level
306     template< int codim >
307     typename Traits::template Codim< codim >::LevelIterator
308     lend ( int level ) const;
309 
310     //! return LeafIterator which points to first leaf entity
311     template< int codim, PartitionIteratorType pitype >
312     typename Traits
313     ::template Codim< codim >::template Partition< pitype >::LeafIterator
314     leafbegin () const;
315 
316     //! return LeafIterator which points behind last leaf entity
317     template< int codim, PartitionIteratorType pitype >
318     typename Traits
319     ::template Codim< codim >::template Partition< pitype >::LeafIterator
320     leafend () const;
321 
322     //! return LeafIterator which points to first leaf entity
323     template< int codim >
324     typename Traits::template Codim< codim >::LeafIterator
325     leafbegin () const;
326 
327     //! return LeafIterator which points behind last leaf entity
328     template< int codim >
329     typename Traits::template Codim< codim >::LeafIterator
330     leafend () const;
331 
332     /** \brief Number of grid entities per level and codim
333      * because lbegin and lend are none const, and we need this methods
334      * counting the entities on each level, you know.
335      */
336     int size (int level, int codim) const;
337 
338     //! number of entities per level and geometry type in this process
339     int size (int level, GeometryType type) const;
340 
341     //! number of leaf entities per codim in this process
342     int size (int codim) const;
343 
344     //! number of leaf entities per geometry type in this process
345     int size (GeometryType type) const;
346 
347     //! number of boundary segments within the macro grid
numBoundarySegments() const348     std::size_t numBoundarySegments () const
349     {
350       return numBoundarySegments_;
351     }
352 
353     //! View for a grid level for All_Partition
levelGridView(int level) const354     typename Traits::LevelGridView levelGridView ( int level ) const
355     {
356       typedef typename Traits::LevelGridView View;
357       typedef typename View::GridViewImp ViewImp;
358       return View( ViewImp( *this, level ) );
359     }
360 
361     //! View for the leaf grid for All_Partition
leafGridView() const362     typename Traits::LeafGridView leafGridView () const
363     {
364       typedef typename Traits::LeafGridView View;
365       typedef typename View::GridViewImp ViewImp;
366       return View( ViewImp( *this ) );
367     }
368 
369   public:
370     //***************************************************************
371     //  Interface for Adaptation
372     //***************************************************************
373     using Base::getMark;
374     using Base::mark;
375 
376     /** \copydoc Dune::Grid::getMark(const typename Codim<0>::Entity &e) const */
377     int getMark ( const typename Traits::template Codim< 0 >::Entity &e ) const;
378 
379     /** \copydoc Dune::Grid::mark(int refCount,const typename Codim<0>::Entity &e) */
380     bool mark ( int refCount, const typename Traits::template Codim< 0 >::Entity &e );
381 
382     //! uses the interface, mark on entity and refineLocal
383     void globalRefine ( int refCount );
384 
385     template< class DataHandle >
386     void globalRefine ( int refCount, AdaptDataHandleInterface< This, DataHandle > &handle );
387 
388     /** \copydoc Dune::Grid::adapt() */
389     bool adapt ();
390 
391     //! callback adapt method with AdaptDataHandleInterface
392     template< class DataHandle >
393     bool adapt ( AdaptDataHandleInterface< This, DataHandle > &handle );
394 
395     //! returns true, if a least one element is marked for coarsening
396     bool preAdapt ();
397 
398     //! clean up some markers
399     void postAdapt();
400 
401     /** \brief return reference to collective communication, if MPI found
402      * this is specialisation for MPI */
comm() const403     const CollectiveCommunication &comm () const
404     {
405       return comm_;
406     }
407 
typeName()408     static std::string typeName ()
409     {
410       std::ostringstream s;
411       s << "AlbertaGrid< " << dim << ", " << dimworld << " >";
412       return s.str();
413     }
414 
415     /** \brief obtain Entity from EntitySeed. */
416     template< class EntitySeed >
417     typename Traits::template Codim< EntitySeed::codimension >::Entity
entity(const EntitySeed & seed) const418     entity ( const EntitySeed &seed ) const
419     {
420       typedef typename Traits::template Codim< EntitySeed::codimension >::EntityImpl EntityImpl;
421       return EntityImpl( *this, seed.impl().elementInfo( meshPointer() ), seed.impl().subEntity() );
422     }
423 
424     //**********************************************************
425     // End of Interface Methods
426     //**********************************************************
427     /** \brief write Grid to file in Xdr */
428     bool writeGrid( const std::string &filename, ctype time ) const;
429 
430     /** \brief read Grid from file filename and store time of mesh in time */
431     bool readGrid( const std::string &filename, ctype &time );
432 
433     // return hierarchic index set
hierarchicIndexSet() const434     const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_; }
435 
436     //! return level index set for given level
437     const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;
438 
439     //! return leaf index set
440     const typename Traits :: LeafIndexSet & leafIndexSet () const;
441 
442     //! return global IdSet
globalIdSet() const443     const GlobalIdSet &globalIdSet () const
444     {
445       return idSet_;
446     }
447 
448     //! return local IdSet
localIdSet() const449     const LocalIdSet &localIdSet () const
450     {
451       return idSet_;
452     }
453 
454     // access to mesh pointer, needed by some methods
getMesh() const455     ALBERTA MESH* getMesh () const
456     {
457       return mesh_;
458     };
459 
meshPointer() const460     const MeshPointer &meshPointer () const
461     {
462       return mesh_;
463     }
464 
dofNumbering() const465     const DofNumbering &dofNumbering () const
466     {
467       return dofNumbering_;
468     }
469 
levelProvider() const470     const LevelProvider &levelProvider () const
471     {
472       return levelProvider_;
473     }
474 
dune2alberta(int codim,int i) const475     int dune2alberta ( int codim, int i ) const
476     {
477       return numberingMap_.dune2alberta( codim, i );
478     }
479 
alberta2dune(int codim,int i) const480     int alberta2dune ( int codim, int i ) const
481     {
482       return numberingMap_.alberta2dune( codim, i );
483     }
484 
generic2alberta(int codim,int i) const485     int generic2alberta ( int codim, int i ) const
486     {
487       return genericNumberingMap_.dune2alberta( codim, i );
488     }
489 
alberta2generic(int codim,int i) const490     int alberta2generic ( int codim, int i ) const
491     {
492       return genericNumberingMap_.alberta2dune( codim, i );
493     }
494 
495   private:
496     typedef std::vector<int> ArrayType;
497 
498     void setup ();
499 
500     // make the calculation of indexOnLevel and so on.
501     // extra method because of Reihenfolge
502     void calcExtras();
503 
504   private:
505     // delete mesh and all vectors
506     void removeMesh();
507 
508     //***********************************************************************
509     //  MemoryManagement for Entitys and Geometrys
510     //**********************************************************************
511     typedef MakeableInterfaceObject< typename Traits::template Codim< 0 >::Entity >
512     EntityObject;
513 
514   public:
515     friend class AlbertaGridLeafIntersectionIterator< const This >;
516 
517     template< int codim >
518     static int
getTwist(const typename Traits::template Codim<codim>::Entity & entity)519     getTwist ( const typename Traits::template Codim< codim >::Entity &entity )
520     {
521       return entity.impl().twist();
522     }
523 
524     template< int codim >
525     static int
getTwist(const typename Traits::template Codim<0>::Entity & entity,int subEntity)526     getTwist ( const typename Traits::template Codim< 0 >::Entity &entity, int subEntity )
527     {
528       return entity.impl().template twist< codim >( subEntity );
529     }
530 
531     static int
getTwistInInside(const typename Traits::LeafIntersection & intersection)532     getTwistInInside ( const typename Traits::LeafIntersection &intersection )
533     {
534       return intersection.impl().twistInInside();
535     }
536 
537     static int
getTwistInOutside(const typename Traits::LeafIntersection & intersection)538     getTwistInOutside ( const typename Traits::LeafIntersection &intersection )
539     {
540       return intersection.impl().twistInOutside();
541     }
542 
543   public:
544     // read global element number from elNumbers_
545     const Alberta::GlobalVector &
546     getCoord ( const ElementInfo &elementInfo, int vertex ) const;
547 
548   private:
549     // pointer to an Albert Mesh, which contains the data
550     MeshPointer mesh_;
551 
552     // collective communication
553     CollectiveCommunication comm_;
554 
555     // maximum level of the mesh
556     int maxlevel_;
557 
558     // number of boundary segments within the macro grid
559     size_t numBoundarySegments_;
560 
561     // map between ALBERTA and DUNE numbering
562     Alberta::NumberingMap< dimension, Alberta::Dune2AlbertaNumbering > numberingMap_;
563     Alberta::NumberingMap< dimension, Alberta::Generic2AlbertaNumbering > genericNumberingMap_;
564 
565     DofNumbering dofNumbering_;
566 
567     LevelProvider levelProvider_;
568 
569     // hierarchical numbering of AlbertaGrid, unique per codim
570     HierarchicIndexSet hIndexSet_;
571 
572     // the id set of this grid
573     IdSetImp idSet_;
574 
575     // the level index set, is generated from the HierarchicIndexSet
576     // is generated, when accessed
577     mutable std::vector< typename GridFamily::LevelIndexSetImp * > levelIndexVec_;
578 
579     // the leaf index set, is generated from the HierarchicIndexSet
580     // is generated, when accessed
581     mutable typename GridFamily::LeafIndexSetImp* leafIndexSet_;
582 
583     SizeCache< This > sizeCache_;
584 
585     typedef AlbertaMarkerVector< dim, dimworld > MarkerVector;
586 
587     // needed for VertexIterator, mark on which element a vertex is treated
588     mutable MarkerVector leafMarkerVector_;
589 
590     // needed for VertexIterator, mark on which element a vertex is treated
591     mutable std::vector< MarkerVector > levelMarkerVector_;
592 
593 #if DUNE_ALBERTA_CACHE_COORDINATES
594     Alberta::CoordCache< dimension > coordCache_;
595 #endif
596 
597     // current state of adaptation
598     AdaptationState adaptationState_;
599   };
600 
601 } // namespace Dune
602 
603 #include "albertagrid.cc"
604 
605 // undef all dangerous defines
606 #undef DIM
607 #undef DIM_OF_WORLD
608 
609 #ifdef _ABS_NOT_DEFINED_
610 #undef ABS
611 #endif
612 
613 #ifdef _MIN_NOT_DEFINED_
614 #undef MIN
615 #endif
616 
617 #ifdef _MAX_NOT_DEFINED_
618 #undef MAX
619 #endif
620 
621 #ifdef obstack_chunk_alloc
622 #undef obstack_chunk_alloc
623 #endif
624 #ifdef obstack_chunk_free
625 #undef obstack_chunk_free
626 #endif
627 #include <dune/grid/albertagrid/undefine-3.0.hh>
628 
629 // We use MEM_ALLOC, so undefine it here.
630 #undef MEM_ALLOC
631 
632 // We use MEM_REALLOC, so undefine it here.
633 #undef MEM_REALLOC
634 
635 // We use MEM_CALLOC, so undefine it here.
636 #undef MEM_CALLOC
637 
638 // We use MEM_FREE, so undefine it here.
639 #undef MEM_FREE
640 
641 // Macro ERROR may be defined by alberta_util.h. If so, undefine it.
642 #ifdef ERROR
643 #undef ERROR
644 #endif // #ifdef ERROR
645 
646 // Macro ERROR_EXIT may be defined by alberta_util.h. If so, undefine it.
647 #ifdef ERROR_EXIT
648 #undef ERROR_EXIT
649 #endif // #ifdef ERROR_EXIT
650 
651 // Macro WARNING may be defined by alberta_util.h. If so, undefine it.
652 #ifdef WARNING
653 #undef WARNING
654 #endif // #ifdef WARNING
655 
656 // Macro TEST may be defined by alberta_util.h. If so, undefine it.
657 #ifdef TEST
658 #undef TEST
659 #endif // #ifdef TEST
660 
661 // Macro TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
662 #ifdef TEST_EXIT
663 #undef TEST_EXIT
664 #endif // #ifdef TEST_EXIT
665 
666 // Macro DEBUG_TEST may be defined by alberta_util.h. If so, undefine it.
667 #ifdef DEBUG_TEST
668 #undef DEBUG_TEST
669 #endif // #ifdef DEBUG_TEST
670 
671 // Macro DEBUG_TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
672 #ifdef DEBUG_TEST_EXIT
673 #undef DEBUG_TEST_EXIT
674 #endif // #ifdef DEBUG_TEST_EXIT
675 
676 // Macro INFO may be defined by alberta_util.h. If so, undefine it.
677 #ifdef INFO
678 #undef INFO
679 #endif // #ifdef INFO
680 
681 // Macro PRINT_INFO may be defined by alberta_util.h. If so, undefine it.
682 #ifdef PRINT_INFO
683 #undef PRINT_INFO
684 #endif // #ifdef PRINT_INFO
685 
686 // Macro PRINT_INT_VEC may be defined by alberta_util.h. If so, undefine it.
687 #ifdef PRINT_INT_VEC
688 #undef PRINT_INT_VEC
689 #endif // #ifdef PRINT_INT_VEC
690 
691 // Macro PRINT_REAL_VEC may be defined by alberta_util.h. If so, undefine it.
692 #ifdef PRINT_REAL_VEC
693 #undef PRINT_REAL_VEC
694 #endif // #ifdef PRINT_REAL_VEC
695 
696 // Macro WAIT may be defined by alberta_util.h. If so, undefine it.
697 #ifdef WAIT
698 #undef WAIT
699 #endif // #ifdef WAIT
700 
701 // Macro WAIT_REALLY may be defined by alberta_util.h. If so, undefine it.
702 #ifdef WAIT_REALLY
703 #undef WAIT_REALLY
704 #endif // #ifdef WAIT_REALLY
705 
706 // Macro GET_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
707 #ifdef GET_WORKSPACE
708 #undef GET_WORKSPACE
709 #endif // #ifdef GET_WORKSPACE
710 
711 // Macro FREE_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
712 #ifdef FREE_WORKSPACE
713 #undef FREE_WORKSPACE
714 #endif // #ifdef FREE_WORKSPACE
715 
716 // Macro MAT_ALLOC may be defined by alberta_util.h. If so, undefine it.
717 #ifdef MAT_ALLOC
718 #undef MAT_ALLOC
719 #endif // #ifdef MAT_ALLOC
720 
721 // Macro MAT_FREE may be defined by alberta_util.h. If so, undefine it.
722 #ifdef MAT_FREE
723 #undef MAT_FREE
724 #endif // #ifdef MAT_FREE
725 
726 // Macro NAME may be defined by alberta_util.h. If so, undefine it.
727 #ifdef NAME
728 #undef NAME
729 #endif // #ifdef NAME
730 
731 // Macro GET_STRUCT may be defined by alberta_util.h. If so, undefine it.
732 #ifdef GET_STRUCT
733 #undef GET_STRUCT
734 #endif // #ifdef GET_STRUCT
735 
736 // Macro ADD_PARAMETER may be defined by alberta_util.h. If so, undefine it.
737 #ifdef ADD_PARAMETER
738 #undef ADD_PARAMETER
739 #endif // #ifdef ADD_PARAMETER
740 
741 // Macro GET_PARAMETER may be defined by alberta_util.h. If so, undefine it.
742 #ifdef GET_PARAMETER
743 #undef GET_PARAMETER
744 #endif // #ifdef GET_PARAMETER
745 
746 #define _ALBERTA_H_
747 
748 #endif // HAVE_ALBERTA || DOXYGEN
749 
750 #endif
751