CoarseningManager.h 3.07 KB
 Praetorius, Simon committed Aug 02, 2013 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ``````/****************************************************************************** * * AMDiS - Adaptive multidimensional simulations * * Copyright (C) 2013 Dresden University of Technology. All Rights Reserved. * Web: https://fusionforge.zih.tu-dresden.de/projects/amdis * * Authors: * Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al. * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * * This file is part of AMDiS * * See also license.opensource.txt in the distribution. * ******************************************************************************/ `````` Thomas Witkowski committed Dec 16, 2010 20 21 `````` `````` Peter Gottschling committed Feb 15, 2008 22 23 24 25 26 27 28 29 30 `````` /** \file CoarseningManager.h */ #ifndef AMDIS_COARSENINGMANAGER_H #define AMDIS_COARSENINGMANAGER_H #include "Global.h" #include "Mesh.h" #include "ProblemStatBase.h" `````` Thomas Witkowski committed May 07, 2009 31 ``````#include "AMDiS_fwd.h" `````` Peter Gottschling committed Feb 15, 2008 32 33 34 35 36 37 38 39 40 41 42 43 `````` namespace AMDiS { /** \ingroup Adaption * \brief * Base class of CoarseningManager1d, CoarseningManager2d, CoarseningManager3d. * A CoarseningManager contains all functionality to perform coarsening * operations on the mesh. */ class CoarseningManager { public: `````` Thomas Witkowski committed May 07, 2009 44 `````` /// Constructs a CoarseningManager which belongs to aMesh `````` Peter Gottschling committed Feb 15, 2008 45 `````` CoarseningManager() `````` Praetorius, Simon committed Oct 23, 2013 46 47 `````` : mesh(nullptr), stack(nullptr), `````` Thomas Witkowski committed May 07, 2009 48 49 `````` doMore(0) {} `````` Peter Gottschling committed Feb 15, 2008 50 `````` `````` Thomas Witkowski committed May 07, 2009 51 52 `````` /// destructor virtual ~CoarseningManager() {} `````` Peter Gottschling committed Feb 15, 2008 53 `````` `````` Thomas Witkowski committed May 07, 2009 54 `````` /// Returns the Mesh the CoarseningManager belongs to. `````` Thomas Witkowski committed Jun 10, 2009 55 56 57 58 `````` inline Mesh* getMesh() { return mesh; } `````` Peter Gottschling committed Feb 15, 2008 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 `````` /** \brief * Tries to coarsen every element of mesh at least mark times. First * all elements are marked for coarsening and then coarsenMesh will * be called. */ Flag globalCoarsen(Mesh *aMesh, int mark); /** \brief * Traversal routine for recursiv coarsening of a triangulation. It has * a default definition in CoarseningManager but it can be overriden * by sub classes (like in CoarseningManager1d), if another implementation * is needed. */ virtual Flag coarsenMesh(Mesh *aMesh); protected: `````` Thomas Witkowski committed Feb 09, 2011 77 78 `````` /// Defines the way how one element of the mesh is coarsen. virtual void coarsenFunction(ElInfo *) {} `````` Peter Gottschling committed Feb 15, 2008 79 80 81 82 83 84 85 86 87 88 `````` /** \brief * Propagate coarsening information over the whole hierarchy * by POSTORDER traversal of the hierarchy tree. * leaves: 'increment' coarsening mark, * inner nodes: set coarsening mark to * min(0,child[0].mark+1,child[1].mark+1) */ void spreadCoarsenMark(); `````` Thomas Witkowski committed May 07, 2009 89 `````` /// Resets the element marks `````` Peter Gottschling committed Feb 15, 2008 90 91 92 `````` void cleanUpAfterCoarsen(); protected: `````` Thomas Witkowski committed May 07, 2009 93 94 `````` /// The Mesh this CoarseningManager belongs to. Mesh *mesh; `````` Peter Gottschling committed Feb 15, 2008 95 `````` `````` Thomas Witkowski committed May 07, 2009 96 `````` /// Used for non recursive mesh traversal. `````` Peter Gottschling committed Feb 15, 2008 97 98 `````` TraverseStack *stack; `````` Thomas Witkowski committed May 07, 2009 99 `````` /// Spezifies whether the coarsening operation is still in progress `````` Peter Gottschling committed Feb 15, 2008 100 101 `````` bool doMore; `````` Thomas Witkowski committed May 07, 2009 102 `````` /// Spezifies how many DOFVectors should restricted while coarsening `````` Peter Gottschling committed Feb 15, 2008 103 104 105 106 107 108 109 110 111 112 113 114 `````` int callCoarseRestrict; friend class RCNeighbourList; }; } #include "CoarseningManager1d.h" #include "CoarseningManager2d.h" #include "CoarseningManager3d.h" #endif // AMDIS_COARSENINGMANAGER_H``````