ProblemStat.h 19.2 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
  struct OperatorPos 
  {
    int row, col;
    double *factor, *estFactor;
  };

50

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
69
    /// Destructor
Thomas Witkowski's avatar
Thomas Witkowski committed
70
    virtual ~ProblemStatSeq();
71

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

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

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

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

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

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

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

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

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

101
102
    /// 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.
103
104
    virtual void doOtherStuff();

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

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

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

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

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

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

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

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

142
143
    bool dualMeshTraverseRequired();

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

147
148
149
    /// 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.
150
151
    virtual Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo = FULL_ITERATION);

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

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

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

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

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

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

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

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

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

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

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

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

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

211
212
213
214
215
216
    /// 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.
217
218
219
220
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    AbstractFunction<double, WorldVector<double> > *n,
			    AbstractFunction<double, WorldVector<double> > *r);

221
222
223
224
225
226
227
228
229
230
    /// 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);

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

234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
    /// 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);
    }

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

Thomas Witkowski's avatar
Thomas Witkowski committed
260
261

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Praetorius, Simon's avatar
Praetorius, Simon committed
389
390
391
392
393
394
395
396
    /// 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
397
    /// Returns \ref useGetBound.
398
399
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
400
401
      return useGetBound; 
    }
402

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

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

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

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

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

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

433
    void setComponentSpace(int comp, const FiniteElemSpace *feSpace)
434
435
436
437
438
439
440
441
442
    {
      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
443
    /// Sets \ref estimator.
444
    inline void setEstimator(Estimator* est, int comp = 0) 
445
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
446
447
      estimator[comp] = est; 
    }
448

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

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

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

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

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

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

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

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

498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
    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;
    }
523
524
    /** \} */

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
535
536

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

Thomas Witkowski's avatar
Thomas Witkowski committed
542
  protected:
543
544
    /// 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
545
546
    void computeError(AdaptInfo *adaptInfo);

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

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

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

559
560
561
    /// 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
562
563
564
    int nMeshes;

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

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

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

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

576
577
578
    /// 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
579
580
581
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
582
    vector<Marker*> marker;
583

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

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

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

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

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

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

602
603
604
605
606
    /// 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.
607
    vector<vector<bool> > assembleMatrixOnlyOnce;
608

609
610
611
612
    /// 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.
613
    vector<vector<bool> > assembledMatrix;
614

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

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

621
622
623
    /// 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
624
    RefinementManager *refinementManager;
625

626
627
628
    /// 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
629
    CoarseningManager *coarseningManager;
630
  
Thomas Witkowski's avatar
Thomas Witkowski committed
631
632
    /// Info level.
    int info;
633

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

638
639
640
    /// 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.
641
    vector<AbstractFunction<double, WorldVector<double> >*> exactSolutionFcts;
642

643
644
    /// If true, the error is not estimated but computed from the exact solution
    /// defined by \ref exactSolutionFcts.
645
    bool computeExactError;
646
    
647
648
649
650
    /// 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.
651
    bool boundaryConditionSet;
652

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

657
    map<Operator*, vector<OperatorPos> > operators;
658
  };
659
660
661
662

#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
  typedef ProblemStatSeq ProblemStat;
#endif
663
664
665
}

#endif