ProblemVec.h 18.4 KB
Newer Older
1
2
3
4
5
6
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
7
// ==  TU Dresden                                                            ==
8
// ==                                                                        ==
9
10
11
// ==  Institut fr 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
24
// ==                                                                        ==
// ============================================================================

/** \file ProblemVec.h */

#ifndef AMDIS_PROBLEMVEC_H
#define AMDIS_PROBLEMVEC_H

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

namespace AMDiS {

  class ProblemVec : public ProblemStatBase,
		     public StandardProblemIteration
  {
44
  protected:
45
46
47
48
49
50
    // Defines a mapping type from dof indices to world coordinates.
    typedef std::map<DegreeOfFreedom, WorldVector<double> > DofToCoord;

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

51
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
52
    /// Constructor
Thomas Witkowski's avatar
Thomas Witkowski committed
53
    ProblemVec(std::string nameStr,
54
55
	       ProblemIterationInterface *problemIteration = NULL)
      : StandardProblemIteration(this),
Thomas Witkowski's avatar
Thomas Witkowski committed
56
	name(nameStr),
57
	nComponents(-1),
Thomas Witkowski's avatar
Thomas Witkowski committed
58
59
60
61
62
63
64
65
	nMeshes(0),
	traverseInfo(0),
	solver(NULL),
	solution(NULL),
	rhs(NULL),
	systemMatrix(NULL),
	useGetBound(true),
	info(10),
66
	deserialized(false),
67
	computeExactError(false),
68
69
	boundaryConditionSet(false),
	writeAsmInfo(false)
70
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
71
      GET_PARAMETER(0, name + "->components", "%d", &nComponents);
72
      TEST_EXIT(nComponents > 0)("components not set!\n");    
Thomas Witkowski's avatar
Thomas Witkowski committed
73
      estimator.resize(nComponents, NULL);
74
      marker.resize(nComponents, NULL);
75

Thomas Witkowski's avatar
Thomas Witkowski committed
76
77
      assembleMatrixOnlyOnce.resize(nComponents);
      assembledMatrix.resize(nComponents);
78
      for (int i = 0; i < nComponents; i++) {
Thomas Witkowski's avatar
Thomas Witkowski committed
79
80
	assembleMatrixOnlyOnce[i].resize(nComponents);
	assembledMatrix[i].resize(nComponents);
81
	for (int j = 0; j < nComponents; j++) {
Thomas Witkowski's avatar
Thomas Witkowski committed
82
83
	  assembleMatrixOnlyOnce[i][j] = false;
	  assembledMatrix[i][j] = false;
84
85
	}
      }
86
87

      exactSolutionFcts.resize(nComponents);
Thomas Witkowski's avatar
Thomas Witkowski committed
88
    }
89

Thomas Witkowski's avatar
Thomas Witkowski committed
90
91
    /// Destructor
    virtual ~ProblemVec() {}
92

Thomas Witkowski's avatar
Thomas Witkowski committed
93
    /// Initialisation of the problem.
94
95
96
97
98
    virtual void initialize(Flag initFlag,
			    ProblemVec *adoptProblem = NULL,
			    Flag adoptFlag = INIT_NOTHING);


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

Thomas Witkowski's avatar
Thomas Witkowski committed
102
    /// Used in \ref initialize().
103
    virtual void createFeSpace(DOFAdmin *admin);
104

Thomas Witkowski's avatar
Thomas Witkowski committed
105
    /// Used in \ref initialize().
106
107
    virtual void createMatricesAndVectors();

Thomas Witkowski's avatar
Thomas Witkowski committed
108
    /// Used in \ref initialize().
109
110
    virtual void createSolver();

Thomas Witkowski's avatar
Thomas Witkowski committed
111
    /// Used in \ref initialize().
112
113
    virtual void createEstimator();

Thomas Witkowski's avatar
Thomas Witkowski committed
114
    /// Used in \ref initialize().
115
116
    virtual void createMarker();

Thomas Witkowski's avatar
Thomas Witkowski committed
117
    /// Used in \ref initialize().
118
119
    virtual void createFileWriter();

120
121
122
123
    /** \brief
     * 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.
     */
124
125
126
127
128
129
    virtual void doOtherStuff();

    /** \brief
     * Implementation of ProblemStatBase::solve(). Deligates the solving
     * of problems system to \ref solver.
     */
130
    virtual void solve(AdaptInfo *adaptInfo, bool fixedMatrix = false);
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

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

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

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

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

    /** \brief
     * Implementation of ProblemStatBase::buildBeforeRefine().
     * Does nothing here.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
160
    virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
161
162
163
164
165

    /** \brief
     * Implementation of ProblemStatBase::buildBeforeCoarsen().
     * Does nothing here.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
166
    virtual void buildBeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
167
168
169

    /** \brief
     * Implementation of ProblemStatBase::buildAfterCoarsen().
170
171
     * Assembles \ref A and \ref rhs. With the last two parameters, assembling
     * can be restricted to matrices or vectors only.
172
     */
173
174
175
    virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
				   bool assembleMatrix = true,
				   bool assembleVector = true);
176

177
178
    bool dualMeshTraverseRequired();

179
180
    void dualAssemble(AdaptInfo *adaptInfo, Flag flag, 
		      bool asmMatrix = true, bool asmVector = true);
181

182
183
184
    void createPrecon();


185
186
187
188
189
190
191
    /** \brief
     * 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.
     */
    virtual Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo = FULL_ITERATION);

Thomas Witkowski's avatar
Thomas Witkowski committed
192
    /// Returns number of managed problems
193
194
    virtual int getNumProblems() 
    { 
195
      return 1; 
Thomas Witkowski's avatar
Thomas Witkowski committed
196
    }
197

Thomas Witkowski's avatar
Thomas Witkowski committed
198
    /// Implementation of ProblemStatBase::getNumComponents()
199
200
    virtual int getNumComponents() 
    { 
201
      return nComponents; 
Thomas Witkowski's avatar
Thomas Witkowski committed
202
    }
203
204
205
206
207

    /** \brief
     * Returns the problem with the given number. If only one problem
     * is managed by this master problem, the number hasn't to be given.
     */
208
209
    virtual ProblemStatBase *getProblem(int number = 0) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
210
      return this; 
Thomas Witkowski's avatar
Thomas Witkowski committed
211
    }
212

213
    /// Writes output files. TODO: Make obsolete.
214
215
    void writeFiles(AdaptInfo *adaptInfo, bool force);

216
217
218
    /// Writes output files.
    void writeFiles(AdaptInfo &adaptInfo, bool force);

Thomas Witkowski's avatar
Thomas Witkowski committed
219
    /// Interpolates fct to \ref solution.
Thomas Witkowski's avatar
Thomas Witkowski committed
220
    void interpolInitialSolution(std::vector<AbstractFunction<double, WorldVector<double> >*> *fct);
221

222
    /// Adds an operator to \ref A.
223
    void addMatrixOperator(Operator *op, int i, int j,
224
225
			   double *factor = NULL, double *estFactor = NULL);

226
    /// Adds an operator to \ref A.
227
228
    void addMatrixOperator(Operator &op, int i, int j,
			   double *factor = NULL, double *estFactor = NULL);
229

230
    /// Adds an operator to \ref rhs.
231
    void addVectorOperator(Operator *op, int i,
232
233
			   double *factor = NULL, double *estFactor = NULL);

234
    /// Adds an operator to \ref rhs.
235
236
    void addVectorOperator(Operator &op, int i,
			   double *factor = NULL, double *estFactor = NULL);
237

238
239
    /// Adds a Dirichlet boundary condition, where the rhs is given by an 
    /// abstract function.
240
    virtual void addDirichletBC(BoundaryType type, int row, int col,
241
242
				AbstractFunction<double, WorldVector<double> > *b);

243
244
    /// Adds a Dirichlet boundary condition, where the rhs is given by a DOF
    /// vector.
245
246
247
    virtual void addDirichletBC(BoundaryType type, int row, int col,
				DOFVector<double> *vec);

248
249
    /// Adds a Neumann boundary condition, where the rhs is given by an
    /// abstract function.
250
251
252
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      AbstractFunction<double, WorldVector<double> > *n);

253
254
255
256
257
258
    /// 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.
259
260
261
262
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    AbstractFunction<double, WorldVector<double> > *n,
			    AbstractFunction<double, WorldVector<double> > *r);

263
    /// Adds a periodic boundary condition.
264
265
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

Thomas Witkowski's avatar
Thomas Witkowski committed
266
267
268
269
    /** \brief
     * This function assembles a DOFMatrix and a DOFVector for the case,
     * the meshes from row and col FE-space are equal.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
270
271
    void assembleOnOneMesh(FiniteElemSpace *feSpace, 
			   Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
272
273
			   DOFMatrix *matrix, DOFVector<double> *vector);

Thomas Witkowski's avatar
Thomas Witkowski committed
274
275

    ///
276
277
278
279
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
280
281
282
283
284
  
    /** \name getting methods
     * \{ 
     */

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
296
    /// Returns \ref rhs.
297
    inline SystemVector* getRhs() 
298
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
299
300
      return rhs; 
    }
301

302
303
304
305
306
    inline const DOFVector<double>* getRhsVector(int i = 0)
    {
      return rhs->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
307
    /// Returns \ref systemMatrix.
308
309
    inline Matrix<DOFMatrix*> *getSystemMatrix() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
310
311
      return systemMatrix; 
    }
312

Thomas Witkowski's avatar
Thomas Witkowski committed
313
    /// Returns a pointer to the corresponding DOFMatrix.
314
315
    inline DOFMatrix* getSystemMatrix(int row, int col) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
316
317
318
319
      return (*systemMatrix)[row][col];
    }

    /// Returns mesh of given component
320
    inline Mesh* getMesh(int comp = 0) 
321
    {
322
      FUNCNAME("ProblemVec::getMesh()");
Thomas Witkowski's avatar
Thomas Witkowski committed
323
      TEST_EXIT(comp < static_cast<int>(componentMeshes.size()) && comp >= 0)
324
	("invalid component number\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
325
      return componentMeshes[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
326
    }
327

Thomas Witkowski's avatar
Thomas Witkowski committed
328
    /// Returns \ref meshes
329
330
    inline std::vector<Mesh*> getMeshes() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
331
332
      return meshes; 
    }
333

Thomas Witkowski's avatar
Thomas Witkowski committed
334
    /// Returns \ref feSpace_.
335
    inline FiniteElemSpace* getFeSpace(int comp = 0) 
336
    { 
337
      FUNCNAME("ProblemVec::getFeSpace()");
338
      TEST_EXIT(comp < static_cast<int>(componentSpaces.size()) && comp >= 0)
339
	("invalid component number\n");
340
      return componentSpaces[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
341
    }
342

Thomas Witkowski's avatar
Thomas Witkowski committed
343
    /// Returns \ref feSpaces.
344
    inline std::vector<FiniteElemSpace*> getFeSpaces() 
345
    { 
346
      return feSpaces; 
Thomas Witkowski's avatar
Thomas Witkowski committed
347
    }
348

Thomas Witkowski's avatar
Thomas Witkowski committed
349
    /// Returns \ref componentSpaces;
350
    inline std::vector<FiniteElemSpace*> getComponentFeSpaces() 
351
    {
352
      return componentSpaces;
353
354
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
355
    /// Returns \ref estimator.
356
    inline std::vector<Estimator*> getEstimators() 
357
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
358
359
      return estimator; 
    }
360

Thomas Witkowski's avatar
Thomas Witkowski committed
361
    /// Returns \ref estimator.
362
    inline Estimator* getEstimator(int comp = 0) 
363
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
364
365
      return estimator[comp]; 
    }
366

Thomas Witkowski's avatar
Thomas Witkowski committed
367
    /// Returns \ref refinementManager.
368
    inline RefinementManager* getRefinementManager(int comp = 0) 
369
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
370
371
      return refinementManager; 
    }
372

Thomas Witkowski's avatar
Thomas Witkowski committed
373
    /// Returns \ref refinementManager.
374
    inline CoarseningManager* getCoarseningManager(int comp = 0) 
375
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
376
377
      return coarseningManager; 
    }
378

Thomas Witkowski's avatar
Thomas Witkowski committed
379
    /// Returns \ref solver.
380
381
    inline OEMSolver* getSolver() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
382
383
      return solver; 
    }
384

Thomas Witkowski's avatar
Thomas Witkowski committed
385
    /// Returns \ref marker.
386
    inline Marker *getMarker(int comp = 0) 
387
    { 
388
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
389
    }
390

Thomas Witkowski's avatar
Thomas Witkowski committed
391
    /// Returns \ref marker.
392
    inline std::vector<Marker*> getMarkers() 
393
    { 
394
      return marker; 
Thomas Witkowski's avatar
Thomas Witkowski committed
395
    }
396

Thomas Witkowski's avatar
Thomas Witkowski committed
397
    /// Returns the name of the problem
Thomas Witkowski's avatar
Thomas Witkowski committed
398
    inline virtual std::string getName() 
399
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
400
401
      return name; 
    }
402

Thomas Witkowski's avatar
Thomas Witkowski committed
403
    /// Returns \ref useGetBound.
404
405
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
406
407
      return useGetBound; 
    }
408

409
410
411
412
413
414
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

415
416
417
418
419
420
    /// Returns \ref deserialized;
    bool isDeserialized()
    {
      return deserialized;
    }

421
422
423
424
425
426
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
427
    /// Sets \ref estimator.
428
429
    inline void setEstimator(std::vector<Estimator*> est) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
430
431
      estimator = est; 
    }
432

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

Thomas Witkowski's avatar
Thomas Witkowski committed
439
    /// Sets \ref estimator.
440
    inline void setEstimator(Estimator* est, int comp = 0) 
441
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
442
443
      estimator[comp] = est; 
    }
444

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

Thomas Witkowski's avatar
Thomas Witkowski committed
451
    /// Sets \ref solver.
452
453
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
454
455
      solver = sol; 
    }
456

Thomas Witkowski's avatar
Thomas Witkowski committed
457
    ///
458
    inline void setAssembleMatrixOnlyOnce(int i = 0, int j = 0, bool value = true) 
459
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
460
      assembleMatrixOnlyOnce[i][j] = value;
461
462
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
463
    ///
464
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
465
466
			     int component) 
    {
467
468
469
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
470
    ///
471
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int i = 0) 
472
    {
473
      return exactSolutionFcts[i];
474
475
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
476
    ///
477
478
    void setComputeExactError(bool v) 
    {
479
480
481
      computeExactError = v;
    }

482
483
484
485
486
487
    /// Sets \ref writeAsmInfo;
    void setWriteAsmInfo(bool b)
    {
      writeAsmInfo = b;
    }

488
489
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
490
491
492
493
    /** \brief
     * Outputs the mesh of the given component, but the values are taken from the 
     * residual error estimator. 
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
494
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, std::string name);
495

Thomas Witkowski's avatar
Thomas Witkowski committed
496
    /// Function that implements the serialization procedure.
Thomas Witkowski's avatar
Thomas Witkowski committed
497
    virtual void serialize(std::ostream &out);
498

Thomas Witkowski's avatar
Thomas Witkowski committed
499
    /// Function that implements the deserialization procedure.
Thomas Witkowski's avatar
Thomas Witkowski committed
500
    virtual void deserialize(std::istream &in);
501

Thomas Witkowski's avatar
Thomas Witkowski committed
502
503

    /// Returns \ref fileWriters.
504
505
    std::vector<FileWriterInterface*>& getFileWriterList() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
506
507
      return fileWriters;
    }
508

Thomas Witkowski's avatar
Thomas Witkowski committed
509
510
511
512
513
514
515
  protected:
    /** \brief
     * If the exact solution is known, the problem can compute the exact
     * error instead of the error estimation. This is done in this function.
     */
    void computeError(AdaptInfo *adaptInfo);

516
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
517
518
519
    
    /// Name of this problem.
    std::string name;
520

Thomas Witkowski's avatar
Thomas Witkowski committed
521
    /// Number of problem components
522
    int nComponents;
523
524

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
525
526
527
     * 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.
528
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
529
530
531
    int nMeshes;

    /// FE spaces of this problem.
532
    std::vector<FiniteElemSpace*> feSpaces;
533

Thomas Witkowski's avatar
Thomas Witkowski committed
534
535
    /// Meshes of this problem.
    std::vector<Mesh*> meshes;
536

Thomas Witkowski's avatar
Thomas Witkowski committed
537
    /// Pointer to the fe spaces for the different problem components
538
    std::vector<FiniteElemSpace*> componentSpaces;
539

Thomas Witkowski's avatar
Thomas Witkowski committed
540
    /// Pointer to the meshes for the different problem components
Thomas Witkowski's avatar
Thomas Witkowski committed
541
    std::vector<Mesh*> componentMeshes;
542
543

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
544
545
546
     * 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.
547
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
548
549
550
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
551
    std::vector<Marker*> marker;
552

Thomas Witkowski's avatar
Thomas Witkowski committed
553
554
    /// Estimator of this problem. Used in \ref estimate().
    std::vector<Estimator*> estimator;
555

Thomas Witkowski's avatar
Thomas Witkowski committed
556
    /// Linear solver of this problem. Used in \ref solve().
557
    OEMSolver *solver;
558

Thomas Witkowski's avatar
Thomas Witkowski committed
559
560
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
561

Thomas Witkowski's avatar
Thomas Witkowski committed
562
563
    /// System vector for the right hand side 
    SystemVector *rhs;
564

Thomas Witkowski's avatar
Thomas Witkowski committed
565
566
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
567

568
569
570
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

571
572
573
574
575
576
577
    /** \brief
     * 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.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
578
    std::vector< std::vector< bool > > assembleMatrixOnlyOnce;
579
580
581

    /** \brief
     * If [i][j] of this field is set to true, the corresponding DOFMatrix of
Thomas Witkowski's avatar
Thomas Witkowski committed
582
     * the systemMatrix has been assembled at least once. This field is used
583
584
585
     * to determine, if assembling of a matrix can be ommitted, if it is set
     * to be assembled only once.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
586
    std::vector< std::vector< bool > > assembledMatrix;
587

Thomas Witkowski's avatar
Thomas Witkowski committed
588
589
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
590

Thomas Witkowski's avatar
Thomas Witkowski committed
591
592
    /// Writes the meshes and solution after the adaption loop.
    std::vector<FileWriterInterface*> fileWriters;
593
594
595
596
597
598

    /** \brief
     * 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
599
    RefinementManager *refinementManager;
600
601
602
603
604
605

    /** \brief
     * 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
606
    CoarseningManager *coarseningManager;
607
  
Thomas Witkowski's avatar
Thomas Witkowski committed
608
609
    /// Info level.
    int info;
610

611
612
613
    /// If true, the stationary problem was deserialized from some serialization file.
    bool deserialized;

614
615
616
617
618
619
620
621
622
623
624
625
    /** \brief
     * 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.
     */
    std::vector<AbstractFunction<double, WorldVector<double> >*> exactSolutionFcts;

    /** \brief
     * If true, the error is not estimated but computed from the exact solution
     * defined by \ref exactSolutionFcts.
     */
    bool computeExactError;
626
627
628
629
630
631
632
    
    /** \brief
     * 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.
     */
    bool boundaryConditionSet;
633

634
635
    /// If true, AMDiS prints information about the assembling procedure to the screen.
    bool writeAsmInfo;
636
637
638
639
  };
}

#endif