ParallelDomainBase.h 21.3 KB
Newer Older
1
2
3
4
5
6
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
7
// ==  TU Dresden                                                            ==
8
// ==                                                                        ==
9
10
11
// ==  Institut für Wissenschaftliches Rechnen                               ==
// ==  Zellescher Weg 12-14                                                  ==
// ==  01069 Dresden                                                         ==
12
13
14
15
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
16
// ==  https://gforge.zih.tu-dresden.de/projects/amdis/                      ==
17
18
19
// ==                                                                        ==
// ============================================================================

20
21
22
23
/** \file ParallelDomainBase.h */

#ifndef AMDIS_PARALLELDOMAINBASE_H
#define AMDIS_PARALLELDOMAINBASE_H
24
25
26


#include <map>
27
#include <set>
28
#include <vector>
Thomas Witkowski's avatar
Thomas Witkowski committed
29
#include <mpi.h>
30

Thomas Witkowski's avatar
Thomas Witkowski committed
31
#include "Global.h"
32
33
#include "ProblemTimeInterface.h"
#include "ProblemIterationInterface.h"
34
#include "FiniteElemSpace.h"
35
#include "AdaptInfo.h"
Thomas Witkowski's avatar
Thomas Witkowski committed
36
#include "parallel/InteriorBoundary.h"
37
#include "Serializer.h"
Thomas Witkowski's avatar
Thomas Witkowski committed
38
#include "BoundaryManager.h"
39
40
#include "AMDiS_fwd.h"

41
42
namespace AMDiS {

43
44
45
46
47
48
49
  struct DofPtrSortFct {
    bool operator() (const DegreeOfFreedom *dof0, const DegreeOfFreedom *dof1) 
    {
      return (*dof0 < *dof1);
    }
  };
   
50
51
  class ParMetisPartitioner;

52
  class ParallelDomainBase : public ProblemIterationInterface,
53
			     public ProblemTimeInterface
54
  {
55
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
56
57
58
59
60
61
62
63
64
65
66
67
    /// Defines a mapping type from DOFs to rank numbers.
    typedef std::map<const DegreeOfFreedom*, int> DofToRank;

    /// Defines a mapping type from DOFs to a set of rank numbers.
    typedef std::map<const DegreeOfFreedom*, std::set<int> > DofToPartitions;

    /// Defines a mapping type from rank numbers to sets of DOFs.
    typedef std::map<int, DofContainer> RankToDofContainer;

    /// Defines a mapping type from DOF indices to DOF indices.
    typedef std::map<DegreeOfFreedom, DegreeOfFreedom> DofMapping;

68
69
70
    /// Defines a mapping type from DOFs to boolean values.
    typedef std::map<const DegreeOfFreedom*, bool> DofToBool;

Thomas Witkowski's avatar
Thomas Witkowski committed
71
    /// Defines a mapping type from DOF indices to boolean values.
72
    typedef std::map<DegreeOfFreedom, bool> DofIndexToBool;
Thomas Witkowski's avatar
Thomas Witkowski committed
73

Thomas Witkowski's avatar
Thomas Witkowski committed
74
75
76
77
78
79
    /// Defines a mapping type from rank numbers to sets of coordinates.
    typedef std::map<int, std::vector<WorldVector<double> > > RankToCoords;

    /// Forward type (it maps rank numbers to the interior boundary objects).
    typedef InteriorBoundary::RankToBoundMap RankToBoundMap;

Thomas Witkowski's avatar
Thomas Witkowski committed
80
81
    typedef std::map<int, DofContainer> ElementIdxToDofs;

Thomas Witkowski's avatar
Thomas Witkowski committed
82
83
    typedef std::map<const DegreeOfFreedom*, DegreeOfFreedom> DofIndexMap;

84
    typedef std::map<DegreeOfFreedom, std::set<DegreeOfFreedom> > PeriodicDofMap;
85
86
    
    typedef std::vector<MeshStructure> MeshCodeVec;
87

88
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
89
90
91
    ParallelDomainBase(ProblemVec *problemStat,
		       ProblemInstatVec *problemInstat);
		       
92
    virtual ~ParallelDomainBase() {}
93

94
    virtual void initParallelization(AdaptInfo *adaptInfo);
95

96
    virtual void exitParallelization(AdaptInfo *adaptInfo);
97

98
99
100
101
102
103
104
105
106
    /** \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
     * to update the dof numberings and mappings on all rank due to the new mesh
     * structure.
     */
    void checkMeshChange();

107
    void updateDofAdmins();    
108

109
110
111
112
113
114
115
    /** \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();
116
117
118
119
120
121

    /// Set for each element on the partitioning level the number of leaf elements.
    double setElemWeights(AdaptInfo *adaptInfo);

    void partitionMesh(AdaptInfo *adaptInfo);

122
123
124
125
126
    virtual void setTime(AdaptInfo *adaptInfo) 
    {
      if (timeIF) 
	timeIF->setTime(adaptInfo);      
    }
127

128
129
130
131
132
    virtual void initTimestep(AdaptInfo *adaptInfo) 
    {
      if (timeIF) 
	timeIF->initTimestep(adaptInfo);
    }
133

134
135
136
137
138
    virtual void closeTimestep(AdaptInfo *adaptInfo) 
    {
      if (timeIF) 
	timeIF->closeTimestep(adaptInfo);
    }
139

Thomas Witkowski's avatar
Thomas Witkowski committed
140
    virtual void solveInitialProblem(AdaptInfo *adaptInfo);
141
  
142
143
144
145
146
    virtual void transferInitialSolution(AdaptInfo *adaptInfo) 
    {
      if (timeIF) 
	timeIF->transferInitialSolution(adaptInfo);
    }
147

148
149
    virtual void beginIteration(AdaptInfo *adaptInfo) 
    {
150
151
152
      iterationIF->beginIteration(adaptInfo);
    }

153
    virtual Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo = FULL_ITERATION);
154

155
156
    virtual Flag buildAndAdapt(AdaptInfo *adaptInfo, Flag toDo);

157
158
    virtual void endIteration(AdaptInfo *adaptInfo) 
    {
159
160
      iterationIF->endIteration(adaptInfo);
    }
161

162
    virtual void solve() = 0;
163

164
165
166
167
    virtual int getNumProblems() 
    {
      return 0;
    }
168

Thomas Witkowski's avatar
Thomas Witkowski committed
169
    inline virtual std::string getName() 
170
    { 
171
172
173
      return name; 
    }

174
    /// Returns \ref nRankDOFs, the number of DOFs in the rank mesh.
175
    int getNumberRankDofs() 
176
    {
177
      return nRankDofs;
178
179
    }

180
181
182
183
    virtual ProblemStatBase *getProblem(int number = 0) 
    {
      return NULL;
    }
184
    // Writes all data of this object to an output stream.
185
    virtual void serialize(std::ostream &out);
186

187
    // Reads the object data from an input stream.
188
    virtual void deserialize(std::istream &in);
189
190

  protected:
191
    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
192
     * Determines the interior boundaries, i.e. boundaries between ranks, and stores
193
194
     * all information about them in \ref interiorBoundary.
     */
195
    void createInteriorBoundaryInfo();
196

Thomas Witkowski's avatar
Thomas Witkowski committed
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
    /** \brief
     * Deterimes the interior boundaries between ranks, that are based on the 
     * neighbourhood information of the macro elements. That means that in 2d the
     * function search for all edge based interior boundaries and in 3d for all face
     * based interior boundaries. This function cannot find boundaries of substructure
     * elements, i.e. vertex boundaries in 2d and vertex and edge boundaries in 3d.
     */
    void createMacroElementInteriorBoundaryInfo();

    /** \brief
     * Determines all interior boundaries between rank that consist of element's
     * substructures. In 2d these may be only vertices. In 3d there may be also
     * interior boundaries consisting of either a whole edge or of a single vertex.
     */
    void createSubstructureInteriorBoundaryInfo();

213
214
215
    /// Removes all macro elements from the mesh that are not part of ranks partition.
    void removeMacroElements();

216
217
    /// Creates from a macro mesh a correct local and global DOF index numbering.
    void createLocalGlobalNumbering();
218

219
220
    /// Updates the local and global DOF numbering after the mesh has been changed.
    void updateLocalGlobalNumbering();
221

222
223
224
225
226
    /** \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.
     */
227
228
    void createPeriodicMap();

229
230
    /** \brief
     * This function create new mappings from local to global indices, 
231
     * \ref mapLocalGlobalDofs, and from local to dof indices, \ref mapLocalToDofIndex.
232
233
234
235
236
237
238
239
240
241
242
243
244
245
     * Furthermore, using the first argument the dof indices in ranks partition are
     * changed.
     * 
     * \param[in] rankDofsNewLocalIndex       Map from dof pointers of all dofs in rank
     *                                        to new dof indices.
     * \param[in] rankOwnedDofsNewLocalIndex  Map from dof pointers of dofs owned by
     *                                        the rank to the new local index.
     * \param[in] rankDofsNewGlobalIndex      Map from dof pointers of all dofs in rank
     *                                        to the new global index.
     */
    void createLocalMappings(DofIndexMap &rankDofsNewLocalIndex,
			     DofIndexMap &rankOwnedDofsNewLocalIndex,
			     DofIndexMap &rankDofsNewGlobalIndex);

246
247
    /** \brief
     * This function traverses the whole mesh, i.e. before it is really partitioned,
Thomas Witkowski's avatar
Thomas Witkowski committed
248
249
250
     * and collects information about which DOF corresponds to which rank. Can only
     * be used, if \ref partitionVec is set correctly. This is only the case, when
     * the macro mesh is partitioned.
251
     *
252
253
254
255
256
     * \param[out] partitionDOFs   Stores to each DOF pointer the set of ranks the DOF
     *                             is part of.
     * \param[out] rankDOFs        Stores all rank DOFs.
     * \param[out] boundaryDOFs    Stores all DOFs in ranks partition that are on an 
     *                             interior boundary but correspond to another rank.
257
     */
258
    void createDofMemberInfo(DofToPartitions& partitionDofs,
Thomas Witkowski's avatar
n  
Thomas Witkowski committed
259
260
			     DofContainer& rankOwnedDofs,
			     DofContainer& rankAllDofs,
261
262
			     DofToRank& boundaryDofs,
			     DofToBool& vertexDof);
Thomas Witkowski's avatar
Thomas Witkowski committed
263

264
265
266
267
268
269
270
271
272
273
274
275
276
277
    /** \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.
     * 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.
     *
     * \param[in] allBound   Defines a map from rank to interior boundaries which 
     *                       should be checked.
     */
    bool checkAndAdaptBoundary(RankToBoundMap &allBound);

278
    void dbgCreateElementMap(ElementIdxToDofs &elMap);
Thomas Witkowski's avatar
Thomas Witkowski committed
279
    
280
    void dbgTestElementMap(ElementIdxToDofs &elMap);
Thomas Witkowski's avatar
Thomas Witkowski committed
281

282
    void dbgTestInteriorBoundary();
283
     
Thomas Witkowski's avatar
Thomas Witkowski committed
284
285
286
    /** \brief
     * This function is used for debugging only. It traverses all interior boundaries
     * and compares the dof indices on them with the dof indices of the boundarys
287
     * neighbours. The function fails, when dof indices on an interior boundary do
Thomas Witkowski's avatar
Thomas Witkowski committed
288
     * not fit together.
289
290
291
     *
     * \param  printCoords   If true, the coords of all common dofs are printed to
     *                       the screen.
Thomas Witkowski's avatar
Thomas Witkowski committed
292
     */
293
    void dbgTestCommonDofs(bool printCoords = false);
294

295
296
    /** \brief
     * This function is used for debugging only. It prints all information from
297
     * the local to global dof mapping, see \ref mapLocalGlobalDofs.
298
299
300
     *
     * \param  rank  If specified, only the information from the given rank is printed.
     */
301
    void printMapLocalGlobal(int rank = -1);
302
303
304
305
306
307
308

    /** \brief
     * This function is used for debugging only. It prints all information about
     * the periodic mapping of dofs, that are on periodic boundaries.
     *
     * \param  rank  If specified, only the information from the given rank is printed.
     */
309
310
311
312
313
314
315
316
317
318
319
320
    void printMapPeriodic(int rank = -1);

    /** \brief
     * This function is used for debugging only. It prints information about dofs
     * in rank's partition.
     *
     * \param  rank         If specified, only the information from the given 
     *                      rank is printed.
     * \param  rankDofs     List of all dofs in ranks partition that are owned by rank.
     * \param  rankAllDofs  List of all dofs in ranks partition.
     */
    void printRankDofs(int rank, DofContainer& rankDofs, DofContainer& rankAllDofs);
321

322
323
324
325
326
327
328
    /** \brief
     * This functions create a Paraview file with the macro mesh where the elements
     * are colored by the partition they are part of. This function can be used for
     * debugging.
     */
    void writePartitioningMesh(std::string filename);

329
    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
330
     * This function must be used if the values of a DOFVector must be synchronised
331
332
     * 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
Thomas Witkowski's avatar
Thomas Witkowski committed
333
     * having these DOFs.
334
335
     *
     * This function must be used, for example, after the lineary system is solved, or
Thomas Witkowski's avatar
Thomas Witkowski committed
336
     * after the DOFVector is set by some user defined functions, e.g., initial
337
     * solution functions.
Thomas Witkowski's avatar
Thomas Witkowski committed
338
339
340
341
342
343
344
     */    
    void synchVector(DOFVector<double> &vec);

    /** \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.
345
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
346
    void synchVector(SystemVector &vec);
347

Thomas Witkowski's avatar
Thomas Witkowski committed
348
349
350
    // Removes all periodic boundaries from a given boundary map.
    void removeBoundaryCondition(BoundaryIndexMap& boundaryMap);

351
352
353
354
355
356
357
358
359
360
361
362
    bool fitElementToMeshCode(MeshStructure &code, 
			      Element *el, 
			      int ithSide, 
			      int elType,
			      int &refCounter);
    
    bool fitElementToMeshCode2(MeshStructure &code, 
			       Element *el, 
			       int ithSide, 
			       int elType,
			       int &refCounter);

363
364
365
366
367
368
369
370
371
372
373
374
375
    /// Writes a vector of dof pointers to an output stream.
    void serialize(std::ostream &out, DofContainer &data);

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

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

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

377
378
379
380
381
382
    /// Writes a periodic dof mapping to an output stream.
    void serialize(std::ostream &out, PeriodicDofMap &data);

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

383
384
385
386
387
    /// Writes a mapping from dof pointers to some values to an output stream.
    template<typename T>
    void serialize(std::ostream &out, std::map<const DegreeOfFreedom*, T> &data)
    {
      int mapSize = data.size();
388
      SerUtil::serialize(out, mapSize);
389
390
391
392
      for (typename std::map<const DegreeOfFreedom*, T>::iterator it = data.begin();
	   it != data.end(); ++it) {
	int v1 = (*(it->first));
	T v2 = it->second;
393
394
	SerUtil::serialize(out, v1);
	SerUtil::serialize(out, v2);
395
396
397
398
399
400
401
402
      }
    }

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

405
      int mapSize = 0;
406
      SerUtil::deserialize(in, mapSize);
407
408
409
      for (int i = 0; i < mapSize; i++) {
	int v1 = 0;
	T v2;
410
411
	SerUtil::deserialize(in, v1);
	SerUtil::deserialize(in, v2);
412
413
414

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

415
416
417
418
	data[dofMap[v1]] = v2;
      }
    }
		        
419
420
    inline void orderDofs(const DegreeOfFreedom* dof0,
			  const DegreeOfFreedom* dof1,
Thomas Witkowski's avatar
Thomas Witkowski committed
421
422
423
			  const DegreeOfFreedom* dof2,
			  DofContainer &vec)
    {
424
      DofPtrSortFct dofPtrSort;
Thomas Witkowski's avatar
Thomas Witkowski committed
425
      vec.resize(3);
426
427
428
429
430
      vec[0] = dof0; 
      vec[1] = dof1; 
      vec[2] = dof2;
      sort(vec.begin(), vec.end(), dofPtrSort);
    }
Thomas Witkowski's avatar
Thomas Witkowski committed
431

432
433
434
435
436
437
438
439
440
441
442
443
444
    inline void orderDofs(const DegreeOfFreedom* dof0,
			  const DegreeOfFreedom* dof1,
			  const DegreeOfFreedom* dof2,
			  const DegreeOfFreedom* dof3,
			  DofContainer &vec)
    {
      DofPtrSortFct dofPtrSort;
      vec.resize(4);
      vec[0] = dof0; 
      vec[1] = dof1; 
      vec[2] = dof2;
      vec[3] = dof3;
      sort(vec.begin(), vec.end(), dofPtrSort);
Thomas Witkowski's avatar
Thomas Witkowski committed
445
446
    }

447
448
449
450
451
452
453
454
    inline void printColValues(int row,
			       std::vector<int>& cols,
			       std::vector<double>& values)
    {
      for (int i = 0; i < static_cast<int>(cols.size()); i++)
	std::cout << "Mat[" << row  << "][" << cols[i] << "] = " << values[i] << "\n";
    }

455
  protected:
456
457
458
459
460
461
    ///
    ProblemIterationInterface *iterationIF;

    ///
    ProblemTimeInterface *timeIF;

Thomas Witkowski's avatar
Thomas Witkowski committed
462
463
464
    ///
    ProblemVec *probStat;

465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
    /// 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)
    std::string name;

481
482
483
    /// Finite element space of the problem.
    FiniteElemSpace *feSpace;

484
485
486
    /// Mesh of the problem.
    Mesh *mesh;

487
488
489
490
491
492
493
    /** \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;

494
495
496
    /// Info level.
    int info;

497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
    /// Pointer to the paritioner which is used to devide a mesh into partitions.
    ParMetisPartitioner *partitioner;

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

    /// Is true, if the mesh was not partitioned before, otherwise it's false.
    bool initialPartitionMesh;

    /** \brief
     * Stores to every coarse element index the number of the partition it 
     * corresponds to.
     */
    std::map<int, int> partitionVec;

    /** \brief
     * Stores an old partitioning of elements. To every element index the number
     * of the parition it corresponds to is stored.
     */
    std::map<int, int> oldPartitionVec;    
517
   
518
    /// Number of DOFs in the rank mesh.
519
    int nRankDofs;
Thomas Witkowski's avatar
Thomas Witkowski committed
520
521

    /** \brief 
Thomas Witkowski's avatar
Thomas Witkowski committed
522
523
524
525
526
527
528
529
530
531
532
533
     * 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
534
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
535
    InteriorBoundary otherIntBoundary;
Thomas Witkowski's avatar
Thomas Witkowski committed
536

537
538
539
540
541
    /** \brief
     *
     */
    InteriorBoundary periodicBoundary;

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

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

    /// Maps local to global dof indices.
556
    DofMapping mapLocalGlobalDofs;
557

Thomas Witkowski's avatar
Thomas Witkowski committed
558
    /// Maps local dof indices to real dof indices.
559
    DofMapping mapLocalToDofIndex;  
560
561
562
563
564
565

    /** \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.
     */
566
567
    DofIndexToBool isRankDof;

568
569
570
571
    /** \brief
     * Maps every dof pointer in ranks macro mesh to a boolean variable indicating 
     * wheather this dof is a vertex dof (true) or not (false).
     */
572
    DofToBool vertexDof;
Thomas Witkowski's avatar
n  
Thomas Witkowski committed
573

574
575
576
577
578
    /** \brief
     * If periodic boundaries are used, this map stores to each dof in rank's 
     * partition, that is on periodic boundaries, the corresponding periodic dofs.
     * The mapping is defined by using global dof indices.
     */
579
580
    PeriodicDofMap periodicDof;

581
    /// 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
582
    int rstart;
583

584
585
586
587
    /** \brief
     * Number of components of the equation. Is used to calculate the exact number
     * of rows in the the overall linear system.
     */
588
    int nComponents;
589

590
    /// Number of rows of the whole linear system that are stored on this rank.
591
592
    int nRankRows;

593
    /// Overall number of the rows in the lineary system.
594
    int nOverallRows;
595
596
597
598
599
600
601
602

    /** \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;
603
604
605
606
607
608

    /** \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;
609
610
611
  };
}

612
#endif // AMDIS_PARALLELDOMAINBASE_H