ProblemStat.h 19.3 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 ProblemStat.h */
22

23
24
#ifndef AMDIS_PROBLEM_STAT_H
#define AMDIS_PROBLEM_STAT_H
25

Thomas Witkowski's avatar
Thomas Witkowski committed
26
27
#include <vector>
#include <list>
28
#include "AMDiS_fwd.h"
29
#include "ProblemStatBase.h"
30
#include "Initfile.h"
31
32
33
#include "Boundary.h"
#include "MatrixVector.h"
#include "StandardProblemIteration.h"
34
#include "io/ElementFileWriter.h"
Thomas Witkowski's avatar
Thomas Witkowski committed
35
#include "ComponentTraverseInfo.h"
36
37
#include "AbstractFunction.h"
#include "SolverMatrix.h"
38
#include "SystemVector.h"
39
40
41

namespace AMDiS {

42
43
  using namespace std;

44
45
46
47
48
49
50
  struct OperatorPos 
  {
    int row, col;
    double *factor, *estFactor;
    Flag operatorType;
  };

51

52
53
54
  /// This class defines the stationary problem definition in sequential
  /// computations. For parallel computations, see 
  /// \ref ParallelProblemStatBase.
55
56
  class ProblemStatSeq : public ProblemStatBase,
			 public StandardProblemIteration
57
  {
58
  protected:
59
    // Defines a mapping type from dof indices to world coordinates.
60
    typedef map<DegreeOfFreedom, WorldVector<double> > DofToCoord;
61
62

    // Defines a mapping type from dof indices to world coordinates.
63
    typedef map<WorldVector<double>, DegreeOfFreedom> CoordToDof;
64

65
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
66
    /// Constructor
67
    ProblemStatSeq(string nameStr,
68
		   ProblemIterationInterface *problemIteration = NULL);
69

Thomas Witkowski's avatar
Thomas Witkowski committed
70
    /// Destructor
71
    virtual ~ProblemStatSeq() {}
72

Thomas Witkowski's avatar
Thomas Witkowski committed
73
    /// Initialisation of the problem.
74
    virtual void initialize(Flag initFlag,
75
			    ProblemStatSeq *adoptProblem = NULL,
76
77
			    Flag adoptFlag = INIT_NOTHING);

Thomas Witkowski's avatar
Thomas Witkowski committed
78
    /// Used in \ref initialize().
79
80
    virtual void createMesh();

81
82
83
    /// Used in \ref initialize().
    virtual void createRefCoarseManager();

Thomas Witkowski's avatar
Thomas Witkowski committed
84
    /// Used in \ref initialize().
85
    virtual void createFeSpace(DOFAdmin *admin);
86

Thomas Witkowski's avatar
Thomas Witkowski committed
87
    /// Used in \ref initialize().
88
89
    virtual void createMatricesAndVectors();

Thomas Witkowski's avatar
Thomas Witkowski committed
90
    /// Used in \ref initialize().
91
92
    virtual void createSolver();

Thomas Witkowski's avatar
Thomas Witkowski committed
93
    /// Used in \ref initialize().
94
95
    virtual void createEstimator();

Thomas Witkowski's avatar
Thomas Witkowski committed
96
    /// Used in \ref initialize().
97
98
    virtual void createMarker();

Thomas Witkowski's avatar
Thomas Witkowski committed
99
    /// Used in \ref initialize().
100
101
    virtual void createFileWriter();

102
103
    /// Used in \ref initialize(). This function is deprecated and should not 
    /// be used anymore. There is no guarantee that it will work in the future.
104
105
    virtual void doOtherStuff();

106
107
    /// Implementation of ProblemStatBase::solve(). Deligates the solving
    /// of problems system to \ref solver.
108
109
110
    void solve(AdaptInfo *adaptInfo,
	       bool createMatrixData = true,
	       bool storeMatrixData = false);
111

112
113
    /// Implementation of ProblemStatBase::estimate(). Deligates the estimation
    /// to \ref estimator.
114
115
    virtual void estimate(AdaptInfo *adaptInfo);

116
117
    /// Implementation of ProblemStatBase::markElements().
    /// Deligated to \ref adapt.
118
119
    virtual Flag markElements(AdaptInfo *adaptInfo);

120
121
    /// Implementation of ProblemStatBase::refineMesh(). Deligated to the
    /// RefinementManager of \ref adapt.
122
123
    virtual Flag refineMesh(AdaptInfo *adaptInfo);

124
125
    /// Implementation of ProblemStatBase::coarsenMesh(). Deligated to the
    /// CoarseningManager of \ref adapt.
126
127
    virtual Flag coarsenMesh(AdaptInfo *adaptInfo);

128
129
    /// Implementation of ProblemStatBase::buildBeforeRefine().
    /// Does nothing here.
Thomas Witkowski's avatar
Thomas Witkowski committed
130
    virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
131

132
133
    /// Implementation of ProblemStatBase::buildBeforeCoarsen().
    /// Does nothing here.
Thomas Witkowski's avatar
Thomas Witkowski committed
134
    virtual void buildBeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
135

136
137
138
    /// Implementation of ProblemStatBase::buildAfterCoarsen().
    /// Assembles \ref A and \ref rhs. With the last two parameters, assembling
    /// can be restricted to matrices or vectors only.
139
140
141
    virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
				   bool assembleMatrix = true,
				   bool assembleVector = true);
142

143
144
    bool dualMeshTraverseRequired();

145
146
    void dualAssemble(AdaptInfo *adaptInfo, Flag flag, 
		      bool asmMatrix = true, bool asmVector = true);
147

148
149
150
    /// Determines the execution order of the single adaption steps. If adapt is
    /// true, mesh adaption will be performed. This allows to avoid mesh adaption,
    /// e.g. in timestep adaption loops of timestep adaptive strategies.
151
152
    virtual Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo = FULL_ITERATION);

Thomas Witkowski's avatar
Thomas Witkowski committed
153
    /// Returns number of managed problems
154
155
    virtual int getNumProblems() 
    { 
156
      return 1; 
Thomas Witkowski's avatar
Thomas Witkowski committed
157
    }
158

Thomas Witkowski's avatar
Thomas Witkowski committed
159
    /// Implementation of ProblemStatBase::getNumComponents()
160
161
    virtual int getNumComponents() 
    { 
162
      return nComponents; 
Thomas Witkowski's avatar
Thomas Witkowski committed
163
    }
164

165
166
    /// Returns the problem with the given number. If only one problem
    /// is managed by this master problem, the number hasn't to be given.
167
168
    virtual ProblemStatBase *getProblem(int number = 0) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
169
      return this; 
Thomas Witkowski's avatar
Thomas Witkowski committed
170
    }
171

172
    /// Writes output files. TODO: Make obsolete.
173
174
    void writeFiles(AdaptInfo *adaptInfo, bool force);

175
176
177
    /// Writes output files.
    void writeFiles(AdaptInfo &adaptInfo, bool force);

Thomas Witkowski's avatar
Thomas Witkowski committed
178
    /// Interpolates fct to \ref solution.
179
    void interpolInitialSolution(vector<AbstractFunction<double, WorldVector<double> >*> *fct);
180

181
    /// Adds an operator to \ref A.
182
    void addMatrixOperator(Operator *op, int i, int j,
183
184
			   double *factor = NULL, double *estFactor = NULL);

185
    /// Adds an operator to \ref A.
186
187
    void addMatrixOperator(Operator &op, int i, int j,
			   double *factor = NULL, double *estFactor = NULL);
188

189
    /// Adds an operator to \ref rhs.
190
    void addVectorOperator(Operator *op, int i,
191
192
			   double *factor = NULL, double *estFactor = NULL);

193
    /// Adds an operator to \ref rhs.
194
195
    void addVectorOperator(Operator &op, int i,
			   double *factor = NULL, double *estFactor = NULL);
196

197
198
    /// Adds a Dirichlet boundary condition, where the rhs is given by an 
    /// abstract function.
199
    virtual void addDirichletBC(BoundaryType type, int row, int col,
200
201
				AbstractFunction<double, WorldVector<double> > *b);

202
203
    /// Adds a Dirichlet boundary condition, where the rhs is given by a DOF
    /// vector.
204
205
206
    virtual void addDirichletBC(BoundaryType type, int row, int col,
				DOFVector<double> *vec);

207
208
    /// Adds a Neumann boundary condition, where the rhs is given by an
    /// abstract function.
209
210
211
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      AbstractFunction<double, WorldVector<double> > *n);

212
213
214
215
216
217
    /// Adds a Neumann boundary condition, where the rhs is given by an DOF
    /// vector.
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      DOFVector<double> *n);

    /// Adds Robin boundary condition.
218
219
220
221
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    AbstractFunction<double, WorldVector<double> > *n,
			    AbstractFunction<double, WorldVector<double> > *r);

222
223
224
225
226
227
228
229
230
231
    /// Adds Robin boundary condition.
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    DOFVector<double> *n,
			    DOFVector<double> *r);

    /// Adds Robin boundary condition.
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    Operator *n,
			    Operator *r);

232
    /// Adds a periodic boundary condition.
233
234
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
    /// add boundary operator to matrix side
    virtual void addBoundaryMatrixOperator(BoundaryType type, 
          Operator *op, int row, int col);

    virtual void addBoundaryMatrixOperator(BoundaryType type, 
          Operator &op, int row, int col)
    {
      addBoundaryMatrixOperator(type, &op, row, col);
    }

    /// add boundary operator to rhs (vector) side
    virtual void addBoundaryVectorOperator(BoundaryType type, 
          Operator *op, int row);

    virtual void addBoundaryVectorOperator(BoundaryType type, 
          Operator &op, int row)
    {
      addBoundaryVectorOperator(type, &op, row);
    }

255
256
    /// This function assembles a DOFMatrix and a DOFVector for the case,
    /// the meshes from row and col FE-space are equal.
257
    void assembleOnOneMesh(const FiniteElemSpace *feSpace, 
Thomas Witkowski's avatar
Thomas Witkowski committed
258
			   Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
259
260
			   DOFMatrix *matrix, DOFVector<double> *vector);

Thomas Witkowski's avatar
Thomas Witkowski committed
261
262

    ///
263
264
265
266
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
267
268
269
270
271
  
    /** \name getting methods
     * \{ 
     */

Thomas Witkowski's avatar
Thomas Witkowski committed
272
    /// Returns \ref solution.
273
274
    inline SystemVector* getSolution() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
275
276
      return solution; 
    }
277

278
    inline DOFVector<double>* getSolution(int i)
279
280
281
282
    {
      return solution->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
283
    /// Returns \ref rhs.
284
    inline SystemVector* getRhs() 
285
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
286
287
      return rhs; 
    }
288

289
    inline DOFVector<double>* getRhsVector(int i = 0)
290
291
292
293
    {
      return rhs->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
294
    /// Returns \ref systemMatrix.
295
296
    inline Matrix<DOFMatrix*> *getSystemMatrix() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
297
298
      return systemMatrix; 
    }
299

Thomas Witkowski's avatar
Thomas Witkowski committed
300
    /// Returns a pointer to the corresponding DOFMatrix.
301
302
    inline DOFMatrix* getSystemMatrix(int row, int col) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
303
304
305
306
      return (*systemMatrix)[row][col];
    }

    /// Returns mesh of given component
307
    inline Mesh* getMesh(int comp = 0) 
308
    {
309
      FUNCNAME("ProblemStatSeq::getMesh()");
Thomas Witkowski's avatar
Thomas Witkowski committed
310
      TEST_EXIT(comp < static_cast<int>(componentMeshes.size()) && comp >= 0)
311
	("invalid component number\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
312
      return componentMeshes[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
313
    }
314

Thomas Witkowski's avatar
Thomas Witkowski committed
315
    /// Returns \ref meshes
316
    inline vector<Mesh*> getMeshes() 
317
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
318
319
      return meshes; 
    }
320

Thomas Witkowski's avatar
Thomas Witkowski committed
321
    /// Returns \ref feSpace_.
322
    inline const FiniteElemSpace* getFeSpace(int comp = 0) 
323
    { 
324
      FUNCNAME("ProblemStatSeq::getFeSpace()");
325
      TEST_EXIT(comp < static_cast<int>(componentSpaces.size()) && comp >= 0)
326
	("invalid component number\n");
327
      return componentSpaces[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
328
    }
329

Thomas Witkowski's avatar
Thomas Witkowski committed
330
    /// Returns \ref feSpaces.
331
    inline vector<const FiniteElemSpace*> getFeSpaces() 
332
    { 
333
      return feSpaces; 
Thomas Witkowski's avatar
Thomas Witkowski committed
334
    }
335

Thomas Witkowski's avatar
Thomas Witkowski committed
336
    /// Returns \ref componentSpaces;
337
    inline vector<const FiniteElemSpace*> getComponentFeSpaces() 
338
    {
339
      return componentSpaces;
340
341
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
342
    /// Returns \ref estimator.
343
    inline vector<Estimator*> getEstimators() 
344
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
345
346
      return estimator; 
    }
347

Thomas Witkowski's avatar
Thomas Witkowski committed
348
    /// Returns \ref estimator.
349
    inline Estimator* getEstimator(int comp = 0) 
350
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
351
352
      return estimator[comp]; 
    }
353

Thomas Witkowski's avatar
Thomas Witkowski committed
354
    /// Returns \ref refinementManager.
355
    inline RefinementManager* getRefinementManager(int comp = 0) 
356
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
357
358
      return refinementManager; 
    }
359

Thomas Witkowski's avatar
Thomas Witkowski committed
360
    /// Returns \ref refinementManager.
361
    inline CoarseningManager* getCoarseningManager(int comp = 0) 
362
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
363
364
      return coarseningManager; 
    }
365

Thomas Witkowski's avatar
Thomas Witkowski committed
366
    /// Returns \ref solver.
367
368
    inline OEMSolver* getSolver() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
369
370
      return solver; 
    }
371

Thomas Witkowski's avatar
Thomas Witkowski committed
372
    /// Returns \ref marker.
373
    inline Marker *getMarker(int comp = 0) 
374
    { 
375
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
376
    }
377

Thomas Witkowski's avatar
Thomas Witkowski committed
378
    /// Returns \ref marker.
379
    inline vector<Marker*> getMarkers() 
380
    { 
381
      return marker; 
Thomas Witkowski's avatar
Thomas Witkowski committed
382
    }
383

Thomas Witkowski's avatar
Thomas Witkowski committed
384
    /// Returns the name of the problem
385
    inline virtual string getName() 
386
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
387
388
      return name; 
    }
389

Praetorius, Simon's avatar
Praetorius, Simon committed
390
391
392
393
394
395
396
397
    /// Returns the name of the problem
    inline string getComponentName(int comp = 0)
    {
      TEST_EXIT(comp < static_cast<int>(componentNames.size()) && comp >= 0)
	("invalid component number\n");
      return componentNames[comp];
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
398
    /// Returns \ref useGetBound.
399
400
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
401
402
      return useGetBound; 
    }
403

404
405
406
407
408
409
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

410
411
412
413
414
415
    /// Returns \ref deserialized;
    bool isDeserialized()
    {
      return deserialized;
    }

416
417
418
419
420
421
    /** \} */

    /** \name setting methods
     * \{ 
     */

Thomas Witkowski's avatar
Thomas Witkowski committed
422
    /// Sets \ref estimator.
423
    inline void setEstimator(vector<Estimator*> est) 
424
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
425
426
      estimator = est; 
    }
427

Thomas Witkowski's avatar
Thomas Witkowski committed
428
    /// Sets the FE space for the given component.
429
    inline void setFeSpace(const FiniteElemSpace *feSpace, int comp = 0) 
430
    {
431
      feSpaces[comp] = feSpace;
Thomas Witkowski's avatar
Thomas Witkowski committed
432
    }
433

434
    void setComponentSpace(int comp, const FiniteElemSpace *feSpace)
435
436
437
438
439
440
441
442
443
    {
      if (static_cast<int>(componentSpaces.size()) < nComponents)
        componentSpaces.resize(nComponents);
      TEST_EXIT(comp >= 0 && comp < nComponents)
        ("Component number not in feasable range!");

      componentSpaces[comp] = feSpace;
    }
    
Thomas Witkowski's avatar
Thomas Witkowski committed
444
    /// Sets \ref estimator.
445
    inline void setEstimator(Estimator* est, int comp = 0) 
446
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
447
448
      estimator[comp] = est; 
    }
449

Thomas Witkowski's avatar
Thomas Witkowski committed
450
    /// Sets \ref marker.
451
    inline void setMarker(Marker* mark, int comp = 0) 
452
    { 
453
      marker[comp] = mark; 
Thomas Witkowski's avatar
Thomas Witkowski committed
454
    }
455

Thomas Witkowski's avatar
Thomas Witkowski committed
456
    /// Sets \ref solver.
457
458
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
459
460
      solver = sol; 
    }
461

Thomas Witkowski's avatar
Thomas Witkowski committed
462
    ///
463
    inline void setAssembleMatrixOnlyOnce(int i = 0, int j = 0, bool value = true) 
464
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
465
      assembleMatrixOnlyOnce[i][j] = value;
466
467
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
468
    ///
469
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
470
471
			     int component) 
    {
472
473
474
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
475
    ///
476
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int i = 0) 
477
    {
478
      return exactSolutionFcts[i];
479
480
    }

481
482
483
484
485
486
    ///
    vector< AbstractFunction<double, WorldVector<double> >* > getExactSolutionFcts() 
    {
      return exactSolutionFcts;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
487
    ///
488
489
    void setComputeExactError(bool v) 
    {
490
491
492
      computeExactError = v;
    }

493
494
495
496
497
498
    /// Sets \ref writeAsmInfo;
    void setWriteAsmInfo(bool b)
    {
      writeAsmInfo = b;
    }

499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
    void setMeshes(vector<Mesh*> meshes_)
    {
      meshes = meshes_;
      nMeshes = static_cast<int>(meshes.size());
    }

    void setComponentMesh(int comp, Mesh* mesh)
    {
      if (static_cast<int>(componentMeshes.size()) < nComponents)
        componentMeshes.resize(nComponents);
      TEST_EXIT(comp >= 0 && comp < nComponents)
        ("Component number not in feasable range!");

      componentMeshes[comp] = mesh;
    }

    void setRefinementManager(RefinementManager *ref)
    {
      refinementManager = ref;
    }

    void setCoarseningManager(CoarseningManager *coarse)
    {
      coarseningManager = coarse;
    }
524
525
    /** \} */

526
527
    /// Outputs the mesh of the given component, but the values are taken from
    /// the residual error estimator. 
528
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, string name);
529

Thomas Witkowski's avatar
Thomas Witkowski committed
530
    /// Function that implements the serialization procedure.
531
    virtual void serialize(ostream &out);
532

Thomas Witkowski's avatar
Thomas Witkowski committed
533
    /// Function that implements the deserialization procedure.
534
    virtual void deserialize(istream &in);
535

Thomas Witkowski's avatar
Thomas Witkowski committed
536
537

    /// Returns \ref fileWriters.
538
    vector<FileWriterInterface*>& getFileWriterList() 
539
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
540
541
      return fileWriters;
    }
542

Thomas Witkowski's avatar
Thomas Witkowski committed
543
  protected:
544
545
    /// If the exact solution is known, the problem can compute the exact
    /// error instead of the error estimation. This is done in this function.
Thomas Witkowski's avatar
Thomas Witkowski committed
546
547
    void computeError(AdaptInfo *adaptInfo);

548
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
549
550
    
    /// Name of this problem.
551
    string name;
552

Thomas Witkowski's avatar
Thomas Witkowski committed
553
    /// Number of problem components
554
    int nComponents;
555

556
557
558
559
    /// Stores the names for all components. Is used for naming the solution
    /// vectors, \ref solution.
    vector<string> componentNames;

560
561
562
    /// Number of problem meshes. If all components are defined on the same mesh,
    /// this number is 1. Otherwise, this variable is the number of different meshes
    /// within the problem.
Thomas Witkowski's avatar
Thomas Witkowski committed
563
564
565
    int nMeshes;

    /// FE spaces of this problem.
566
    vector<const FiniteElemSpace*> feSpaces;
567

Thomas Witkowski's avatar
Thomas Witkowski committed
568
    /// Meshes of this problem.
569
    vector<Mesh*> meshes;
570

Thomas Witkowski's avatar
Thomas Witkowski committed
571
    /// Pointer to the fe spaces for the different problem components
572
    vector<const FiniteElemSpace*> componentSpaces;
573

Thomas Witkowski's avatar
Thomas Witkowski committed
574
    /// Pointer to the meshes for the different problem components
575
    vector<Mesh*> componentMeshes;
576

577
578
579
    /// Stores information about which meshes must be traversed to assemble the
    /// specific components. I.e., it was implemented to make use of different
    /// meshes for different components.
Thomas Witkowski's avatar
Thomas Witkowski committed
580
581
582
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
583
    vector<Marker*> marker;
584

Thomas Witkowski's avatar
Thomas Witkowski committed
585
    /// Estimator of this problem. Used in \ref estimate().
586
    vector<Estimator*> estimator;
587

Thomas Witkowski's avatar
Thomas Witkowski committed
588
    /// Linear solver of this problem. Used in \ref solve().
589
    OEMSolver *solver;
590

Thomas Witkowski's avatar
Thomas Witkowski committed
591
592
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
593

Thomas Witkowski's avatar
Thomas Witkowski committed
594
595
    /// System vector for the right hand side 
    SystemVector *rhs;
596

Thomas Witkowski's avatar
Thomas Witkowski committed
597
598
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
599

600
601
602
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

603
604
605
606
607
    /// Some DOFMatrices of the systemMatrix may be assembled only once (for
    /// example if they are independent of the time or older solutions). If
    /// [i][j] of this field is set to true, the corresponding DOFMatrix will
    /// be assembled only once. All other matrices will be assembled at every
    /// time step.
608
    vector<vector<bool> > assembleMatrixOnlyOnce;
609

610
611
612
613
    /// If [i][j] of this field is set to true, the corresponding DOFMatrix of
    /// the systemMatrix has been assembled at least once. This field is used
    /// to determine, if assembling of a matrix can be ommitted, if it is set
    /// to be assembled only once.
614
    vector<vector<bool> > assembledMatrix;
615

Thomas Witkowski's avatar
Thomas Witkowski committed
616
617
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
618

Thomas Witkowski's avatar
Thomas Witkowski committed
619
    /// Writes the meshes and solution after the adaption loop.
620
    vector<FileWriterInterface*> fileWriters;
621

622
623
624
    /// All actions of mesh refinement are performed by refinementManager.
    /// If new refinement algorithms should be realized, one has to override
    /// RefinementManager and give one instance of it to AdaptStationary.
Thomas Witkowski's avatar
Thomas Witkowski committed
625
    RefinementManager *refinementManager;
626

627
628
629
    /// All actions of mesh coarsening are performed by coarseningManager.
    /// If new coarsening algorithms should be realized, one has to override
    /// CoarseningManager and give one instance of it to AdaptStationary.
Thomas Witkowski's avatar
Thomas Witkowski committed
630
    CoarseningManager *coarseningManager;
631
  
Thomas Witkowski's avatar
Thomas Witkowski committed
632
633
    /// Info level.
    int info;
634

635
636
    /// If true, the stationary problem was deserialized from some serialization
    /// file.
637
638
    bool deserialized;

639
640
641
    /// This vectors stores pointers to functions defining the exact solution of
    /// the problem. This may be used to compute the real error of the computed
    /// solution.
642
    vector<AbstractFunction<double, WorldVector<double> >*> exactSolutionFcts;
643

644
645
    /// If true, the error is not estimated but computed from the exact solution
    /// defined by \ref exactSolutionFcts.
646
    bool computeExactError;
647
    
648
649
650
651
    /// If at least on boundary condition is set, this variable is true. It is 
    /// used to ensure that no operators are added after boundary condition were
    /// set. If this would happen, boundary conditions could set wrong on off 
    /// diagonal matrices.
652
    bool boundaryConditionSet;
653

654
655
    /// If true, AMDiS prints information about the assembling procedure to 
    /// the screen.
656
    bool writeAsmInfo;
657

658
    map<Operator*, vector<OperatorPos> > operators;
659

660
    map<Operator*, Flag> opFlags;
661
  };
662
663
664
665

#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
  typedef ProblemStatSeq ProblemStat;
#endif
666
667
668
}

#endif