Liebe Gitlab-Nutzerin, 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.
 Thomas Witkowski committed Feb 09, 2010 1 2 3 4 // ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == ==  Thomas Witkowski committed Dec 16, 2010 5 // == http://www.amdis-fem.org ==  Thomas Witkowski committed Feb 09, 2010 6 7 // == == // ============================================================================  Thomas Witkowski committed Dec 16, 2010 8 9 10 11 12 13 14 15 16 17 18 19 // // Software License for AMDiS // // Copyright (c) 2010 Dresden University of Technology // All rights reserved. // Authors: Simon Vey, Thomas Witkowski et al. // // This file is part of AMDiS // // See also license.opensource.txt in the distribution.  Thomas Witkowski committed Feb 09, 2010 20   21 /** \file ParallelDebug.h */  Thomas Witkowski committed Feb 09, 2010 22   23 24 #ifndef AMDIS_PARALLELDEBUG_H #define AMDIS_PARALLELDEBUG_H  Thomas Witkowski committed Feb 09, 2010 25   26 #include "parallel/MeshDistributor.h"  Thomas Witkowski committed Feb 09, 2010 27 28 29  namespace AMDiS {  30  class ParallelDebug  Thomas Witkowski committed May 21, 2010 31 32  { protected:  Thomas Witkowski committed Jun 08, 2010 33  typedef MeshDistributor::RankToDofContainer RankToDofContainer;  Thomas Witkowski committed May 21, 2010 34   Thomas Witkowski committed Jan 12, 2011 35 36 37 38 39  typedef std::vector > CoordsVec; /// Defines a mapping type from rank numbers to sets of coordinates. typedef std::map RankToCoords;  Thomas Witkowski committed Feb 09, 2010 40 41  public: /** \brief  42 43  * Tests the interior and the periodic boundaries on all ranks if their order * fits together.  Thomas Witkowski committed Feb 09, 2010 44 45 46  * * \param[in] pdb Parallel problem definition used for debugging. */  Thomas Witkowski committed Jun 08, 2010 47  static void testInteriorBoundary(MeshDistributor &pdb);  Thomas Witkowski committed Feb 09, 2010 48   Thomas Witkowski committed Jan 06, 2011 49 50 51 52 53 54 55  /** \brief * Test if all periodic boundaries are set in a consistent way on all ranks. * * \param[in] pdb Parallel problem definition used for debugging. */ static void testPeriodicBoundary(MeshDistributor &pdb);  Thomas Witkowski committed Feb 09, 2010 56 57  /** \brief * This function is used for debugging only. It traverses all interior boundaries  58  * and compares the DOF indices on them with the dof indices of the boundarys  Thomas Witkowski committed Feb 09, 2010 59 60 61 62 63 64 65  * neighbours. The function fails, when dof indices on an interior boundary do * not fit together. * * \param[in] pdb Parallel problem definition used for debugging. * \param[in] printCoords If true, the coords of all common dofs are printed * to the screen. */  Thomas Witkowski committed Jun 08, 2010 66  static void testCommonDofs(MeshDistributor &pdb, bool printCoords = false);  Thomas Witkowski committed Feb 09, 2010 67   68 69 70 71 72 73 74 75 76 77  /** \brief * This function is used for debugging only. It checks if on all ranks DOFs with * the same coordinates have the same global index. For this, the function genartes * on all ranks a list of all DOFs with their coordinates and global indices and * sends the list to all neighbouring ranks. * * \param[in] pdb Parallel problem definition used for debugging. */ static void testGlobalIndexByCoords(MeshDistributor &pdb);  Thomas Witkowski committed May 11, 2010 78 79 80 81 82  /** \brief * Tests if all elements in the macro mesh are memeber of exactly one rank. * * \param[in] pdb Parallel problem definition used for debugging. */  Thomas Witkowski committed Jun 08, 2010 83  static void testAllElements(MeshDistributor &pdb);  Thomas Witkowski committed May 11, 2010 84   Thomas Witkowski committed May 21, 2010 85 86 87 88 89 90 91 92  /** \brief * Tests for all ranks simultaneously, if the number of all send and received * DOFs fits together for all communication partners. * * \param[in] pdb Parallel problem definition used for debugging. * \param[in] sendDofs The map of all DOFs the rank will send. * \param[in] recvDofs The map of all DOFs the rank will receive. */  Thomas Witkowski committed Jun 08, 2010 93  static void testDofContainerCommunication(MeshDistributor &pdb,  Thomas Witkowski committed May 21, 2010 94 95 96  RankToDofContainer &sendDofs, RankToDofContainer &recvDofs);  Thomas Witkowski committed Dec 20, 2010 97 98 99  /// Tests if there are multiple DOFs in mesh with the same coords. static void testDoubleDofs(Mesh *mesh);  Thomas Witkowski committed Feb 09, 2010 100 101 102 103 104 105 106 107  /** \brief * This function is used for debugging only. It prints all information from * the local to global dof mapping, see \ref mapLocalGlobalDofs. * * \param[in] pdb Parallel problem definition used for debugging. * \param[in] rank If specified, only the information from the given rank * is printed. */  Thomas Witkowski committed Jun 08, 2010 108  static void printMapLocalGlobal(MeshDistributor &pdb, int rank = -1);  Thomas Witkowski committed Feb 09, 2010 109 110 111 112 113 114 115 116 117  /** \brief * This function is used for debugging only. It prints all information about * the periodic mapping of dofs, that are on periodic boundaries. * * \param[in] pdb Parallel problem definition used for debugging. * \param[in] rank If specified, only the information from the given rank * is printed. */  Thomas Witkowski committed Jun 08, 2010 118  static void printMapPeriodic(MeshDistributor &pdb, int rank = -1);  Thomas Witkowski committed Feb 09, 2010 119 120 121 122 123 124 125 126 127 128 129 130  /** \brief * This function is used for debugging only. It prints information about dofs * in rank's partition. * * \param[in] pdb Parallel problem definition used for debugging. * \param[in] rank If specified, only the information from the given * rank is printed. * \param[in] rankDofs List of all dofs in ranks partition that are owned * by rank. * \param[in] rankAllDofs List of all dofs in ranks partition. */  Thomas Witkowski committed Jun 08, 2010 131  static void printRankDofs(MeshDistributor &pdb,  Thomas Witkowski committed Feb 09, 2010 132 133 134  int rank, DofContainer& rankDofs, DofContainer& rankAllDofs);  Thomas Witkowski committed May 21, 2010 135 136 137 138 139 140  /** \brief * This functions prints all information about all interior boundaries on all ranks. * * \param[in] pdb Parallel problem definition used for debugging. */  Thomas Witkowski committed Jun 08, 2010 141  static void printBoundaryInfo(MeshDistributor &pdb);  Thomas Witkowski committed Jun 18, 2010 142   143 144  static void writeDebugFile(MeshDistributor &pdb, std::string prefix, std::string postfix);  145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163  /** \brief * This functions create a Paraview file with the macro mesh where the elements * are colored by the partition they are part of. */ static void writePartitioning(MeshDistributor &pdb, string filename); /** \brief * The mesh is written to a value and all values are assigned by the rank number * where the vertex is contained in. * * \param[in] filename Name of the output file without extension (.vtu). * \param[in] counter Counter index. If not negative, this number is added * to the filename. * \param[in] feSpace */ static void writePartitioningFile(std::string filename, int counter, FiniteElemSpace *feSpace);  Thomas Witkowski committed Feb 09, 2010 164 165 166 167 168  }; } // namespace AMDiS #endif