Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer,
es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Die Konten der externen Nutzer:innen sind über den Reiter "Standard" erreichbar.
 Peter Gottschling committed Feb 15, 2008 1 2 3 4 5 6 // ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == == // ============================================================================ // == ==  Thomas Witkowski committed Sep 28, 2009 7 // == TU Dresden ==  Peter Gottschling committed Feb 15, 2008 8 // == ==  Thomas Witkowski committed Sep 28, 2009 9 10 11 // == Institut fr Wissenschaftliches Rechnen == // == Zellescher Weg 12-14 == // == 01069 Dresden ==  Peter Gottschling committed Feb 15, 2008 12 13 14 15 // == germany == // == == // ============================================================================ // == ==  Thomas Witkowski committed Sep 28, 2009 16 // == https://gforge.zih.tu-dresden.de/projects/amdis/ ==  Peter Gottschling committed Feb 15, 2008 17 18 19 20 21 22 23 24 25 26 // == == // ============================================================================ /** \file BoundaryManager.h */ #ifndef AMDIS_BOUNDARYMANAGER_H #define AMDIS_BOUNDARYMANAGER_H #include  Peter Gottschling committed Apr 28, 2009 27 #include "AMDiS_fwd.h"  Peter Gottschling committed Feb 15, 2008 28 29 30 31 32 #include "Boundary.h" #include "BoundaryCondition.h" namespace AMDiS {  Thomas Witkowski committed Oct 14, 2009 33 34  typedef std::map BoundaryIndexMap;  Peter Gottschling committed Feb 15, 2008 35 36 37 38 39 40 41 42 43 44 45  /** * \ingroup Assembler * * \brief * A BoundaryManager handles a set of boundary conditions and applies * this conditions to DOFVectorBase and DOFMatrix objects. Each DOFVectorBase * and each DOFMatrix has its own BoundaryManager. */ class BoundaryManager { public:  Thomas Witkowski committed Sep 23, 2008 46 47 48 49 50 51  BoundaryManager(const FiniteElemSpace *feSpace); BoundaryManager(BoundaryManager &bm); ~BoundaryManager();  Thomas Witkowski committed May 07, 2009 52  /// Adds a local boundary condition to the list of managed conditions.  Thomas Witkowski committed May 25, 2009 53 54  void addBoundaryCondition(BoundaryCondition *localBC) {  Thomas Witkowski committed Oct 14, 2009 55 56  FUNCNAME("BoundaryManager::addBoundaryCondition()");  Peter Gottschling committed Feb 15, 2008 57  BoundaryType type = localBC->getBoundaryType();  Thomas Witkowski committed Oct 14, 2009 58 59  TEST_EXIT(localBCs[type] == NULL) ("There is already a condition for this type.\n");  Peter Gottschling committed Feb 15, 2008 60  localBCs[type] = localBC;  Thomas Witkowski committed Oct 14, 2009 61 62 63  std::vector& boundMap = globalBoundaryMap[type]; boundMap.push_back(localBC);  64  }  Peter Gottschling committed Feb 15, 2008 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89  void initMatrix(DOFMatrix *matrix); void exitMatrix(DOFMatrix *matrix); void initVector(DOFVectorBase *vector); void exitVector(DOFVectorBase *vector); /** \brief * Calls DOFVectorBase::fillBoundaryCondition() for each local boundary condition * in \ref localBCs. */ void fillBoundaryConditions(ElInfo *elInfo, DOFVectorBase *vec); /** \brief * Calls DOFMatrix::fillBoundaryCondition() for each local boundary condition * in \ref localBCs. */ void fillBoundaryConditions(ElInfo *elInfo, DOFMatrix *mat); /** \brief * Calls BoundaryCondition::boundResidual() for each boundary condition in * \ref localBCs. */  Thomas Witkowski committed Oct 14, 2009 90  double boundResidual(ElInfo *elInfo, DOFMatrix *matrix,  Peter Gottschling committed Feb 15, 2008 91 92  const DOFVectorBase *dv);  Thomas Witkowski committed May 25, 2009 93 94  inline BoundaryCondition *getBoundaryCondition(BoundaryType type) {  Peter Gottschling committed Feb 15, 2008 95  return localBCs[type];  96  }  Peter Gottschling committed Feb 15, 2008 97   Thomas Witkowski committed Oct 14, 2009 98  const BoundaryIndexMap& getBoundaryConditionMap()  Thomas Witkowski committed May 25, 2009 99  {  Peter Gottschling committed Feb 15, 2008 100  return localBCs;  101  }  Peter Gottschling committed Feb 15, 2008 102   Thomas Witkowski committed Oct 14, 2009 103  void setBoundaryConditionMap(const BoundaryIndexMap& bcs)  Thomas Witkowski committed May 25, 2009 104  {  Peter Gottschling committed Feb 15, 2008 105  localBCs = bcs;  106  }  Thomas Witkowski committed Oct 14, 2009 107 108 109 110 111 112 113 114 115 116 117 118 119  /** \brief * Returns true, if there is at least one boundary object with the given boundary * id, which implements a periodic boundary. */ static bool isBoundaryPeriodic(BoundaryType b) { for (int i = 0; i < static_cast(globalBoundaryMap[b].size()); i++) if (globalBoundaryMap[b][i]->isPeriodic()) return true; return false; }  Peter Gottschling committed Feb 15, 2008 120 121  protected:  Thomas Witkowski committed Mar 23, 2009 122  /// Map of managed local boundary conditions.  Thomas Witkowski committed Oct 14, 2009 123  BoundaryIndexMap localBCs;  Thomas Witkowski committed Sep 23, 2008 124   Thomas Witkowski committed Mar 23, 2009 125  /// Temporary thread-safe variable for functions fillBoundaryconditions.  Thomas Witkowski committed Sep 23, 2008 126 127  std::vector localBounds;  Thomas Witkowski committed Mar 23, 2009 128  /// Temporary thread-safe variable for functions fillBoundaryconditions.  Thomas Witkowski committed Jan 19, 2010 129  std::vector > dofIndices;  Thomas Witkowski committed Mar 23, 2009 130   Thomas Witkowski committed Sep 23, 2008 131 132 133 134 135  /** \brief * Stores the number of byte that were allocated in the constructor for * each localBounds value. Is used to free the memory in the destructor. */ int allocatedMemoryLocalBounds;  Thomas Witkowski committed Oct 14, 2009 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150  /** \brief * For every boundary id we store here all possible boundary object (although * it's not clear if it is meaningful to have different boundary conditions on the * same boundary id). * * We have to use this global variable, because the mesh traverse interface does * not provide more information about traversed boundaries at elements than the * boundary id. * * TODO: Change interface such that mesh traverse returns the boundary objects * directly and we can remove this global variable. The biggest problem will be * than serialization and deserialization of the mesh. */ static std::map > globalBoundaryMap;  Peter Gottschling committed Feb 15, 2008 151 152 153 154 155  }; } #endif