Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer, es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Ein Anmelden über dieses erzeugt ein neues Konto. Das alte Konto ist über den Reiter "Standard" erreichbar. Die Administratoren

Dear Gitlab user, it is now possible to log in to our service using the ZIH login/LDAP. Logging in via this will create a new account. The old account can be accessed via the "Standard" tab. The administrators

MeshDistributor.h 20.8 KB
Newer Older
1 2 3 4
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
5
// ==  http://www.amdis-fem.org                                              ==
6 7
// ==                                                                        ==
// ============================================================================
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.


20

21
/** \file MeshDistributor.h */
22

23 24
#ifndef AMDIS_MESHDISTRIBUTOR_H
#define AMDIS_MESHDISTRIBUTOR_H
25 26


Thomas Witkowski's avatar
Thomas Witkowski committed
27
#include <mpi.h>
28
#include "parallel/ParallelTypes.h"
29
#include "parallel/MeshPartitioner.h"
Thomas Witkowski's avatar
Thomas Witkowski committed
30
#include "parallel/InteriorBoundary.h"
31
#include "parallel/StdMpi.h"
32
#include "AMDiS_fwd.h"
Thomas Witkowski's avatar
Thomas Witkowski committed
33
#include "Global.h"
34 35
#include "ProblemTimeInterface.h"
#include "ProblemIterationInterface.h"
36
#include "FiniteElemSpace.h"
37
#include "Serializer.h"
Thomas Witkowski's avatar
Thomas Witkowski committed
38
#include "BoundaryManager.h"
39
#include "ElementObjectData.h"
40
#include "SystemVector.h"
41

42
namespace AMDiS {
43 44

  using namespace std;
Thomas Witkowski's avatar
Thomas Witkowski committed
45 46 47 48


  struct BoundaryDofInfo
  {
49
    map<GeoIndex, DofContainerSet> geoDofs;
Thomas Witkowski's avatar
Thomas Witkowski committed
50
  };
51
  
Thomas Witkowski's avatar
Thomas Witkowski committed
52

53
  class MeshDistributor
54
  {
55
  private:
56
    MeshDistributor();
57
	          
58
    virtual ~MeshDistributor() {}
59

60
  public:
61
    void initParallelization();
62

63
    void exitParallelization();
64

65 66 67 68 69 70 71
    /// Adds a DOFVector to the set of \ref interchangeVecs. Thus, this vector will
    /// be automatically interchanged between ranks when mesh is repartitioned.
    void addInterchangeVector(DOFVector<double> *vec)
    {
      interchangeVectors.push_back(vec);
    }

72 73 74 75 76 77 78
    /// Adds all DOFVectors of a SystemVector to \ref interchangeVecs.
    void addInterchangeVector(SystemVector *vec)
    {
      for (int i = 0; i < vec->getSize(); i++)
	interchangeVectors.push_back(vec->getDOFVector(i));
    }
    
79 80 81 82
    /** \brief
     * This function checks if the mesh has changed on at least on rank. In this case,
     * the interior boundaries are adapted on all ranks such that they fit together on
     * all ranks. Furthermore the function \ref updateLocalGlobalNumbering() is called
83
     * to update the DOF numberings and mappings on all rank due to the new mesh
84
     * structure.
85 86 87 88 89
     *
     * \param[in]  tryRepartition   If this parameter is true, repartitioning may be
     *                              done. This depends on several other parameters. If
     *                              the parameter is false, the mesh is only checked
     *                              and adapted but never repartitioned.
90
     */
91
    void checkMeshChange(bool tryRepartition = true);
92

93 94 95 96 97 98 99
    /** \brief
     * Test, if the mesh consists of macro elements only. The mesh partitioning of
     * the parallelization works for macro meshes only and would fail, if the mesh
     * is already refined in some way. Therefore, this function will exit the program
     * if it finds a non macro element in the mesh.
     */
    void testForMacroMesh();
100 101

    /// Set for each element on the partitioning level the number of leaf elements.
102
    void setInitialElementWeights();
103

104
    inline virtual string getName() 
105 106 107
    { 
      return name; 
    }
108

Thomas Witkowski's avatar
Thomas Witkowski committed
109 110 111 112 113
    inline Mesh* getMesh()
    {
      return mesh;
    }

114 115 116 117 118
    /// Returns \ref feSpace.
    inline const FiniteElemSpace* getFeSpace()
    {
      return feSpace;
    }
119 120 121
    
    /// Returns \ref nRankDOFs, the number of DOFs in the rank mesh.
    inline int getNumberRankDofs() 
122
    {
123
      return nRankDofs;
124
    }
125

126
    /// Returns \ref nOverallDofs, the global number of DOFs.
127
    inline int getNumberOverallDofs()
128
    {
129
      return nOverallDofs;
130
    }
131

Thomas Witkowski's avatar
Thomas Witkowski committed
132 133 134 135 136
    inline DofMapping& getMapLocalGlobalDofs()
    {
      return mapLocalGlobalDofs;
    }

137
    /// Maps a local DOF to its global index.
138
    inline DegreeOfFreedom mapLocalToGlobal(DegreeOfFreedom dof)
139
    {
140
      return mapLocalGlobalDofs[dof];
141
    }
142

143 144
    DegreeOfFreedom mapGlobalToLocal(DegreeOfFreedom dof);

145
    /// Maps a local DOF to its local index.
146 147 148 149 150
    inline DegreeOfFreedom mapLocalToDofIndex(DegreeOfFreedom dof)
    {
      return mapLocalDofIndex[dof];
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
151 152 153 154 155 156
    /// Returns the periodic mapping for all boundary DOFs in rank.
    inline PeriodicDofMap& getPeriodicMapping()
    {
      return periodicDof;
    }

157
    /// Returns for a global dof index its periodic mapping for a given boundary type.
158
    inline int getPeriodicMapping(int globalDofIndex, BoundaryType type)
159
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
160 161
      FUNCNAME("MeshDistributor::getPeriodicMapping()");

162
      TEST_EXIT_DBG(periodicDof[type].count(globalDofIndex) == 1)
Thomas Witkowski's avatar
Thomas Witkowski committed
163 164
	("There is no periodic association for global DOF %d for boundary type %d!\n",
	 globalDofIndex, type);
165 166 167 168

      return periodicDof[type][globalDofIndex];
    }

169 170 171
    /// For a given global DOF index, this function returns the set of periodic
    /// associations, i.e., the boundary types the DOF is associated to, for this DOF.
    inline std::set<BoundaryType>& getPerDofAssociations(int globalDofIndex)
172
    {      
173 174 175
      TEST_EXIT_DBG(periodicDofAssociations.count(globalDofIndex)) 
 	("Should not happen!\n"); 

176
      return periodicDofAssociations[globalDofIndex];
177
    }
178

179
    /// Returns true, if the DOF (global index) is a periodic DOF.
180
    inline bool isPeriodicDof(int globalDofIndex)
181
    {
182 183
      return (periodicDofAssociations.count(globalDofIndex) > 0 &&
	       periodicDofAssociations[globalDofIndex].size() > 0);
184 185
    }

186 187 188
    /// Returns true, if the DOF (global index) is a periodic DOF for the given
    /// boundary type.
    inline bool isPeriodicDof(int globalDofIndex, BoundaryType type)
189 190
    {
      return (periodicDof[type].count(globalDofIndex) > 0);
191 192
    }

193 194
    /// Return true, if the given DOF is owned by the rank. If false, the DOF is in
    /// rank's partition, but is owned by some other rank.
195 196
    inline bool getIsRankDof(DegreeOfFreedom dof)
    {
197 198 199 200
      if (isRankDof.count(dof))
	return isRankDof[dof];

      return false;
201
    }
202

203 204 205 206 207
    inline DofIndexToBool& getIsRankDof()
    {
      return isRankDof;
    }

208
    inline long getLastMeshChangeIndex()
209
    {
210
      return lastMeshChangeIndex;
211
    }
212

213 214 215 216
    inline int getRstart()
    {
      return rstart;
    }
217

218
    inline int getMpiRank()
219
    {
220
      return mpiRank;
221
    }
222

Thomas Witkowski's avatar
Thomas Witkowski committed
223 224 225 226 227
    inline int getMpiSize()
    {
      return mpiSize;
    }

228 229 230
    inline MPI::Intracomm& getMpiComm()
    {
      return mpiComm;
231 232
    }

233
    inline RankToDofContainer& getSendDofs()
234
    {
235
      return sendDofs;
236 237
    }

238
    inline RankToDofContainer& getRecvDofs()
239
    {
240
      return recvDofs;
241
    }
242

243 244 245 246
    /// Creates a set of all DOFs that are on interior boundaries of rank's
    /// domain. Thus, it creates the union of \ref sendDofs and \ref recvDofs.
    void createBoundaryDofs(std::set<DegreeOfFreedom> &boundaryDofs);

247
    // Writes all data of this object to an output stream.
248
    void serialize(ostream &out);
249

250
    // Reads the object data from an input stream.
251
    void deserialize(istream &in);
252 253 254 255 256 257 258 259 260 261 262

    /** \brief
     * This function must be used if the values of a DOFVector must be synchronised
     * over all ranks. That means, that each rank sends the values of the DOFs, which
     * are owned by the rank and lie on an interior bounday, to all other ranks also
     * having these DOFs.
     *
     * This function must be used, for example, after the lineary system is solved, or
     * after the DOFVector is set by some user defined functions, e.g., initial
     * solution functions.
     */    
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
    template<typename T>
    void synchVector(DOFVector<T> &vec) 
    {
      StdMpi<vector<T> > stdMpi(mpiComm);

      for (RankToDofContainer::iterator sendIt = sendDofs.begin();
	   sendIt != sendDofs.end(); ++sendIt) {
	vector<T> dofs;
	int nSendDofs = sendIt->second.size();
	dofs.reserve(nSendDofs);
	
	for (int i = 0; i < nSendDofs; i++)
	  dofs.push_back(vec[*((sendIt->second)[i])]);
	
	stdMpi.send(sendIt->first, dofs);
      }
      
      for (RankToDofContainer::iterator recvIt = recvDofs.begin();
	   recvIt != recvDofs.end(); ++recvIt)
	stdMpi.recv(recvIt->first, recvIt->second.size());
      
      stdMpi.startCommunication();
      
      for (RankToDofContainer::iterator recvIt = recvDofs.begin();
	   recvIt != recvDofs.end(); ++recvIt)
	for (unsigned int i = 0; i < recvIt->second.size(); i++)
	  vec[*(recvIt->second)[i]] = stdMpi.getRecvData(recvIt->first)[i];      
    }
    
292 293 294 295 296 297 298
    /** \brief
     * Works in the same way as the function above defined for DOFVectors. Due to
     * performance, this function does not call \ref synchVector for each DOFVector,
     * but instead sends all values of all DOFVectors all at once.
     */
    void synchVector(SystemVector &vec);

299 300
    void check3dValidMesh();

Thomas Witkowski's avatar
Thomas Witkowski committed
301 302 303 304 305
    void setBoundaryDofRequirement(Flag flag)
    {
      createBoundaryDofFlag = flag;
    }

306 307 308 309 310
    BoundaryDofInfo& getBoundaryDofInfo()
    {
      return boundaryDofInfo;
    }

311 312
    void getAllBoundaryDofs(DofContainer& dofs);

313 314 315 316 317 318

  public:
    /// Adds a stationary problem to the global mesh distributor objects.
    static void addProblemStatGlobal(ProblemStatSeq *probStat);

    
319
  protected:
320 321
    void addProblemStat(ProblemStatSeq *probStat);

322
    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
323
     * Determines the interior boundaries, i.e. boundaries between ranks, and stores
324 325
     * all information about them in \ref interiorBoundary.
     */
326
    void createInteriorBoundaryInfo();
327

Thomas Witkowski's avatar
Thomas Witkowski committed
328 329 330 331 332
    void updateInteriorBoundaryInfo();

    void createMeshElementData();

    void createBoundaryData();
Thomas Witkowski's avatar
Thomas Witkowski committed
333

Thomas Witkowski's avatar
Thomas Witkowski committed
334 335
    void createBoundaryDofs();

336 337 338
    /// Removes all macro elements from the mesh that are not part of ranks partition.
    void removeMacroElements();

339
    /// Updates the local and global DOF numbering after the mesh has been changed.
340
    void updateLocalGlobalNumbering();
341

342 343 344 345 346
    /** \brief
     * Creates to all dofs in rank's partition that are on a periodic boundary the
     * mapping from dof index to the other periodic dof indices. This information
     * is stored in \ref periodicDof.
     */
347 348
    void createPeriodicMap();

349 350
    void createMacroElementInfo();

351 352
    void updateMacroElementInfo();

353 354 355 356 357 358 359 360 361
    /** \brief
     * Checks for all given interior boundaries if the elements fit together on both
     * sides of the boundaries. If this is not the case, the mesh is adapted. Because
     * refinement of a certain element may forces the refinement of other elements,
     * it is not guaranteed that all rank's meshes fit together after this function
     * terminates. Hence, it must be called until a stable mesh refinement is reached.
     *
     * \param[in] allBound   Defines a map from rank to interior boundaries which 
     *                       should be checked.
362 363 364 365
     *
     * \return    If the mesh has  been changed by this function, it returns true. 
     *            Otherwise, it returns false, i.e., the given interior boundaries 
     *            fit together on both sides.
366 367
     */
    bool checkAndAdaptBoundary(RankToBoundMap &allBound);
368 369 370 371 372 373 374 375
  
    /** \brief
     * Checks if is required to repartition the mesh. If this is the case, a new
     * partition will be created and the mesh will be redistributed between the
     * ranks.
     */
    void repartitionMesh();

376 377
    /// Sets \ref isRankDof to all matrices and rhs vectors in a given 
    /// stationary problem.
378
    void setRankDofs(ProblemStatSeq *probStat);
379

380 381 382
    /// Sets \ref isRankDof to all matrices and rhs vectors in all stationary problems.
    void setRankDofs();

383 384 385 386
    /// Removes all periodic boundary condition information from all matrices and
    /// vectors of all stationary problems and from the mesh itself.
    void removePeriodicBoundaryConditions();

Thomas Witkowski's avatar
Thomas Witkowski committed
387
    // Removes all periodic boundaries from a given boundary map.
388
    void removePeriodicBoundaryConditions(BoundaryIndexMap& boundaryMap);
Thomas Witkowski's avatar
Thomas Witkowski committed
389

390
    /// Writes a vector of dof pointers to an output stream.
391
    void serialize(ostream &out, DofContainer &data);
392 393

    /// Reads a vector of dof pointers from an input stream.
394 395
    void deserialize(istream &in, DofContainer &data,
		     map<int, const DegreeOfFreedom*> &dofMap);
396 397

    /// Writes a \ref RankToDofContainer to an output stream.
398
    void serialize(ostream &out, RankToDofContainer &data);
399 400

    /// Reads a \ref RankToDofContainer from an input stream.
401 402
    void deserialize(istream &in, RankToDofContainer &data,
		     map<int, const DegreeOfFreedom*> &dofMap);
403

404
    /// Writes a periodic dof mapping to an output stream.
405
    void serialize(ostream &out, PeriodicDofMap &data);
406

407
    void serialize(ostream &out, map<int, std::set<int> >& data);
408

409
    /// Reads a periodic dof mapping from an input stream.
410
    void deserialize(istream &in, PeriodicDofMap &data);
411

412
    void deserialize(istream &in, map<int, std::set<int> >& data);
413

414 415
    /// Writes a mapping from dof pointers to some values to an output stream.
    template<typename T>
416
    void serialize(ostream &out, map<const DegreeOfFreedom*, T> &data)
417
    {
418 419
      FUNCNAME("ParallelDomainBase::serialize()");

420
      int mapSize = data.size();
421
      SerUtil::serialize(out, mapSize);
422
      for (typename map<const DegreeOfFreedom*, T>::iterator it = data.begin();
423 424 425
	   it != data.end(); ++it) {
	int v1 = (*(it->first));
	T v2 = it->second;
426 427
	SerUtil::serialize(out, v1);
	SerUtil::serialize(out, v2);
428 429 430 431 432
      }
    }

    /// Reads a mapping from dof pointer to some values from an input stream.
    template<typename T>
433 434
    void deserialize(istream &in, map<const DegreeOfFreedom*, T> &data,
		     map<int, const DegreeOfFreedom*> &dofMap)
435
    {
436 437
      FUNCNAME("ParallelDomainBase::deserialize()");

438
      int mapSize = 0;
439
      SerUtil::deserialize(in, mapSize);
440 441 442
      for (int i = 0; i < mapSize; i++) {
	int v1 = 0;
	T v2;
443 444
	SerUtil::deserialize(in, v1);
	SerUtil::deserialize(in, v2);
445 446 447

	TEST_EXIT_DBG(dofMap.count(v1) != 0)("Cannot find DOF %d in map!\n", v1);

448 449 450
	data[dofMap[v1]] = v2;
      }
    }
451

452
  protected:
453
    /// List of all stationary problems that are managed by this mesh distributor.
454
    vector<ProblemStatSeq*> problemStat;
Thomas Witkowski's avatar
Thomas Witkowski committed
455

456 457 458
    /// If true, the mesh distributor is already initialized;
    bool initialized;

459 460 461 462 463 464 465 466 467 468 469 470 471 472
    /// The rank of the current process.
    int mpiRank;

    /// Overall number of processes.
    int mpiSize;

    /** \brief
     * MPI communicator collected all processes, which should
     * be used for calculation. The Debug procces is not included
     * in this communicator.
     */
    MPI::Intracomm mpiComm;

    /// Name of the problem (as used in the init files)
473
    string name;
474

475 476 477
    /// Finite element space of the problem.
    FiniteElemSpace *feSpace;

478 479 480
    /// Mesh of the problem.
    Mesh *mesh;

481 482 483 484 485 486 487
    /** \brief
     * A refinement manager that should be used on the mesh. It is used to refine
     * elements at interior boundaries in order to fit together with elements on the
     * other side of the interior boundary.
     */    
    RefinementManager *refineManager;

488 489 490
    /// Info level.
    int info;

491 492
    /// Pointer to a mesh partitioner that is used to partition the mesh to the ranks.
    MeshPartitioner *partitioner;
493 494

    /// Weights for the elements, i.e., the number of leaf elements within this element.
495
    map<int, double> elemWeights;
496 497

    /** \brief
498 499
     * Stores to every macro element index the number of the rank that owns this
     * macro element.
500
     */
501
    map<int, int> partitionMap;
502

503
    /// Number of DOFs in the rank mesh.
504
    int nRankDofs;
Thomas Witkowski's avatar
Thomas Witkowski committed
505

506
    /// Number of DOFs in the whole domain.
507 508
    int nOverallDofs;

Thomas Witkowski's avatar
Thomas Witkowski committed
509 510 511 512
    // Data structure to store all sub-objects of all elements of the macro mesh.
    ElementObjects elObjects;

    // Maps to each macro element index a pointer to the corresponding element.
513
    map<int, Element*> macroElIndexMap;
Thomas Witkowski's avatar
Thomas Witkowski committed
514 515
    
    // Maps to each macro element index the type of this element.
516
    map<int, int> macroElIndexTypeMap;
Thomas Witkowski's avatar
Thomas Witkowski committed
517

Thomas Witkowski's avatar
Thomas Witkowski committed
518
    /** \brief 
Thomas Witkowski's avatar
Thomas Witkowski committed
519 520 521 522 523 524 525 526 527 528 529 530
     * Defines the interior boundaries of the domain that result from partitioning
     * the whole mesh. Contains only the boundaries, which are owned by the rank, i.e.,
     * the object gives for every neighbour rank i the boundaries this rank owns and 
     * shares with rank i.
     */
    InteriorBoundary myIntBoundary;
    
    /** \brief
     * Defines the interior boundaries of the domain that result from partitioning
     * the whole mesh. Contains only the boundaries, which are not owned by the rank,
     * i.e., the object gives for every neighbour rank i the boundaries that are
     * owned by rank i and are shared with this rank.
Thomas Witkowski's avatar
Thomas Witkowski committed
531
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
532
    InteriorBoundary otherIntBoundary;
Thomas Witkowski's avatar
Thomas Witkowski committed
533

534
    /** \brief
535 536
     * Defines the periodic boundaries with other ranks. Periodic boundaries have
     * no owner, as it is the case of interior boundaries.
537 538 539
     */
    InteriorBoundary periodicBoundary;

540
    /** \brief
541 542
     * This map contains for each rank the list of DOFs the current rank must send
     * to exchange solution DOFs at the interior boundaries.
543
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
544
    RankToDofContainer sendDofs;
545 546

    /** \brief
547
     * This map contains on each rank the list of DOFs from which the current rank 
548 549
     * will receive DOF values (i.e., this are all DOFs at an interior boundary). The
     * DOF indices are given in rank's local numbering.
550
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
551
    RankToDofContainer recvDofs;
552 553

    /// Maps local to global dof indices.
554
    DofMapping mapLocalGlobalDofs;
555

Thomas Witkowski's avatar
Thomas Witkowski committed
556
    /// Maps local dof indices to real dof indices.
557
    DofMapping mapLocalDofIndex;  
558 559 560 561 562 563

    /** \brief
     * Maps all DOFs in ranks partition to a bool value. If it is true, the DOF is
     * owned by the rank. Otherwise, its an interior boundary DOF that is owned by
     * another rank.
     */
564 565
    DofIndexToBool isRankDof;

566
    /** \brief
567 568 569 570
     * If periodic boundaries are used, this map stores, for each periodic boundary
     * type, for all DOFs in rank's partition (that are on periodic boundaries), the 
     * corresponding mapped periodic DOFs. The mapping is defined by using global 
     * dof indices.
571
     */
572
    PeriodicDofMap periodicDof;
573 574 575 576 577
    
    /** \brief
     * If periodic boundaries are used, this map stores to each periodic DOF in rank's
     * partition the set of periodic boundaries the DOF is associated to. In 2D, most
     * DOFs are only on one periodic boundary. Only, e.g., in a box with all boundaries
578
     * being periodic, the four corners are associated by two different boundaries.
579
     */
580
    map<int, std::set<BoundaryType> > periodicDofAssociations;
581

582 583 584 585 586
    
    /// This set of values must be interchanged between ranks when the mesh is 
    /// repartitioned.
    vector<DOFVector<double>*> interchangeVectors;
		        
587
    /// Is the index of the first row of the linear system, which is owned by the rank.
Thomas Witkowski's avatar
n  
Thomas Witkowski committed
588
    int rstart;
589

590 591 592 593 594 595 596
    /** \brief
     * If the problem definition has been read from a serialization file, this 
     * variable is true, otherwise it is false. This variable is used to stop the
     * initialization function, if the problem definition has already been read from
     * a serialization file.
     */
    bool deserialized;
597

598 599 600
    /// Denotes whether there exists a filewriter for this object.
    bool writeSerializationFile;

601 602 603
    /// If true, it is possible to repartition the mesh during computations.
    bool repartitioningAllowed;

604
    /// Stores the number of mesh changes that must lie in between to repartitionings.
605 606
    int repartitionIthChange;

607 608
    /// Counts the number of mesh changes after the last mesh repartitioning was done.
    int nMeshChangesAfterLastRepartitioning;
609

610 611 612
    /// Countes the number of mesh repartitions that were done. Till now, this 
    /// variable is used only for debug outputs.
    int repartitioningCounter;
613

614
    /// Directory name where all debug output files should be written to.
615
    string debugOutputDir;
616

617 618 619 620 621
    /** \brief
     * Stores the mesh change index. This is used to recognize changes in the mesh 
     * structure (e.g. through refinement or coarsening managers).
     */
    long lastMeshChangeIndex;
622

623
    map<int, vector<int> > macroElementNeighbours;
624

625 626
    /// Store all macro elements of the overall mesh, i.e., before the macro mesh is
    /// redistributed for the first time.
627
    vector<MacroElement*> allMacroElements;
628

Thomas Witkowski's avatar
Thomas Witkowski committed
629 630 631
    Flag createBoundaryDofFlag;

    BoundaryDofInfo boundaryDofInfo;
632

Thomas Witkowski's avatar
Thomas Witkowski committed
633
  public:
634 635 636
    /// The boundary DOFs are sorted by subobject entities, i.e., first all
    /// face DOFs, edge DOFs and to the last vertex DOFs will be set to
    /// communication structure vectors, \ref sendDofs and \ref recvDofs.
Thomas Witkowski's avatar
Thomas Witkowski committed
637 638
    static const Flag BOUNDARY_SUBOBJ_SORTED;

639 640 641 642 643 644 645 646 647
    /// When boundary DOFs are created, \ref boundaryDofInfo is filled for
    /// all DOFs that this rank will send to other ranks (thus, rank 
    /// owned DOFs.
    static const Flag BOUNDARY_FILL_INFO_SEND_DOFS;

    /// When boundary DOFs are created, \ref boundaryDofInfo is filled for
    /// all DOFs that this rank will receive from other ranks (thus, DOFs
    /// that are owned by another rank).
    static const Flag BOUNDARY_FILL_INFO_RECV_DOFS;
Thomas Witkowski's avatar
Thomas Witkowski committed
648

649 650
    static MeshDistributor *globalMeshDistributor;

651
    friend class ParallelDebug;
652 653 654
  };
}

655
#endif // AMDIS_MESHDISTRIBUTOR_H