ProblemStat.h 19.4 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
    void buildAfterCoarsen_sebastianMode(AdaptInfo *adaptInfo, Flag flag);

145
146
    bool dualMeshTraverseRequired();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

224
225
226
227
228
229
230
231
232
233
    /// 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);

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
263
264

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

418
419
420
421
422
423
    /** \} */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
538
539

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
555
    /// Number of problem components
556
    int nComponents;
557

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

562
563
564
    /// 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
565
566
567
    int nMeshes;

    /// FE spaces of this problem.
568
    vector<const FiniteElemSpace*> feSpaces;
569

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

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

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

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

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

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

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

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

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

602
603
604
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

605
606
607
608
609
    /// 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.
610
    vector<vector<bool> > assembleMatrixOnlyOnce;
611

612
613
614
615
    /// 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.
616
    vector<vector<bool> > assembledMatrix;
617

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

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

624
625
626
    /// 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
627
    RefinementManager *refinementManager;
628

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

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

641
642
643
    /// 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.
644
    vector<AbstractFunction<double, WorldVector<double> >*> exactSolutionFcts;
645

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

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

660
    map<Operator*, vector<OperatorPos> > operators;
661

662
    map<Operator*, Flag> opFlags;
663
  };
664
665
666
667

#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
  typedef ProblemStatSeq ProblemStat;
#endif
668
669
670
}

#endif