ProblemVec.h 17.8 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 "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
	computeExactError(false),
67
68
	boundaryConditionSet(false),
	writeAsmInfo(false)
69
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
70
      GET_PARAMETER(0, name + "->components", "%d", &nComponents);
71
      TEST_EXIT(nComponents > 0)("components not set!\n");    
Thomas Witkowski's avatar
Thomas Witkowski committed
72
      estimator.resize(nComponents, NULL);
73
      marker.resize(nComponents, NULL);
74

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

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

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

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


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

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

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

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

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

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

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

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

    /** \brief
     * Implementation of ProblemStatBase::solve(). Deligates the solving
     * of problems system to \ref solver.
     */
129
    virtual void solve(AdaptInfo *adaptInfo, bool fixedMatrix = false);
130
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

    /** \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
159
    virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
160
161
162
163
164

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

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

176
177
    bool dualMeshTraverseRequired();

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

181
182
183
    void createPrecon();


184
185
186
187
188
189
190
    /** \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
191
    /// Returns number of managed problems
192
193
    virtual int getNumProblems() 
    { 
194
      return 1; 
Thomas Witkowski's avatar
Thomas Witkowski committed
195
    }
196

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

    /** \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.
     */
207
208
    virtual ProblemStatBase *getProblem(int number = 0) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
209
      return this; 
Thomas Witkowski's avatar
Thomas Witkowski committed
210
    }
211

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
221
    /// Adds an Operator to \ref A.
222
    void addMatrixOperator(Operator *op, int i, int j,
223
224
225
226
227
			   double *factor = NULL, double *estFactor = NULL);

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

Thomas Witkowski's avatar
Thomas Witkowski committed
229
    /// Adds an Operator to \ref rhs.
230
    void addVectorOperator(Operator *op, int i,
231
232
233
234
235
			   double *factor = NULL, double *estFactor = NULL);

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

Thomas Witkowski's avatar
Thomas Witkowski committed
237
    /// Adds dirichlet boundary conditions.
238
    virtual void addDirichletBC(BoundaryType type, int row, int col,
239
240
				AbstractFunction<double, WorldVector<double> > *b);

241
242
243
    virtual void addDirichletBC(BoundaryType type, int row, int col,
				DOFVector<double> *vec);

Thomas Witkowski's avatar
Thomas Witkowski committed
244
    /// Adds neumann boundary conditions.
245
246
247
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      AbstractFunction<double, WorldVector<double> > *n);

Thomas Witkowski's avatar
Thomas Witkowski committed
248
    /// Adds robin boundary conditions.
249
250
251
252
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    AbstractFunction<double, WorldVector<double> > *n,
			    AbstractFunction<double, WorldVector<double> > *r);

Thomas Witkowski's avatar
Thomas Witkowski committed
253
    /// Adds periodic boundary conditions.
254
255
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

Thomas Witkowski's avatar
Thomas Witkowski committed
256
257
258
259
    /** \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
260
261
    void assembleOnOneMesh(FiniteElemSpace *feSpace, 
			   Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
262
263
			   DOFMatrix *matrix, DOFVector<double> *vector);

Thomas Witkowski's avatar
Thomas Witkowski committed
264
265

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

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

281
282
283
284
285
    inline const DOFVector<double>* getSolutionVector(int i = 0)
    {
      return solution->getDOFVector(i);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
393
    /// Returns \ref useGetBound.
394
395
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
396
397
      return useGetBound; 
    }
398

399
400
401
402
403
404
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

405
406
407
408
409
410
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
411
    /// Sets \ref estimator.
412
413
    inline void setEstimator(std::vector<Estimator*> est) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
414
415
      estimator = est; 
    }
416

Thomas Witkowski's avatar
Thomas Witkowski committed
417
    /// Sets the FE space for the given component.
418
    inline void setFeSpace(FiniteElemSpace *feSpace, int comp = 0) 
419
    {
420
      feSpaces[comp] = feSpace;
Thomas Witkowski's avatar
Thomas Witkowski committed
421
    }
422

Thomas Witkowski's avatar
Thomas Witkowski committed
423
    /// Sets \ref estimator.
424
    inline void setEstimator(Estimator* est, int comp = 0) 
425
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
426
427
      estimator[comp] = est; 
    }
428

Thomas Witkowski's avatar
Thomas Witkowski committed
429
    /// Sets \ref marker.
430
    inline void setMarker(Marker* mark, int comp = 0) 
431
    { 
432
      marker[comp] = mark; 
Thomas Witkowski's avatar
Thomas Witkowski committed
433
    }
434

Thomas Witkowski's avatar
Thomas Witkowski committed
435
    /// Sets \ref solver.
436
437
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
438
439
      solver = sol; 
    }
440

Thomas Witkowski's avatar
Thomas Witkowski committed
441
    ///
442
    inline void setAssembleMatrixOnlyOnce(int i = 0, int j = 0, bool value = true) 
443
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
444
      assembleMatrixOnlyOnce[i][j] = value;
445
446
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
447
    ///
448
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
449
450
			     int component) 
    {
451
452
453
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
454
    ///
455
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int i = 0) 
456
    {
457
      return exactSolutionFcts[i];
458
459
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
460
    ///
461
462
    void setComputeExactError(bool v) 
    {
463
464
465
      computeExactError = v;
    }

466
467
468
469
470
471
    /// Sets \ref writeAsmInfo;
    void setWriteAsmInfo(bool b)
    {
      writeAsmInfo = b;
    }

472
473
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
474
475
476
477
    /** \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
478
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, std::string name);
479

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
486
487

    /// Returns \ref fileWriters.
488
489
    std::vector<FileWriterInterface*>& getFileWriterList() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
490
491
      return fileWriters;
    }
492

Thomas Witkowski's avatar
Thomas Witkowski committed
493
494
495
496
497
498
499
  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);

500
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
501
502
503
    
    /// Name of this problem.
    std::string name;
504

Thomas Witkowski's avatar
Thomas Witkowski committed
505
    /// Number of problem components
506
    int nComponents;
507
508

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
509
510
511
     * 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.
512
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
513
514
515
    int nMeshes;

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

Thomas Witkowski's avatar
Thomas Witkowski committed
518
519
    /// Meshes of this problem.
    std::vector<Mesh*> meshes;
520

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

Thomas Witkowski's avatar
Thomas Witkowski committed
524
    /// Pointer to the meshes for the different problem components
Thomas Witkowski's avatar
Thomas Witkowski committed
525
    std::vector<Mesh*> componentMeshes;
526
527

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
528
529
530
     * 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.
531
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
532
533
534
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
535
    std::vector<Marker*> marker;
536

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

Thomas Witkowski's avatar
Thomas Witkowski committed
540
    /// Linear solver of this problem. Used in \ref solve().
541
    OEMSolver *solver;
542

Thomas Witkowski's avatar
Thomas Witkowski committed
543
544
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
545

Thomas Witkowski's avatar
Thomas Witkowski committed
546
547
    /// System vector for the right hand side 
    SystemVector *rhs;
548

Thomas Witkowski's avatar
Thomas Witkowski committed
549
550
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
551

552
553
554
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

555
556
557
558
559
560
561
    /** \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
562
    std::vector< std::vector< bool > > assembleMatrixOnlyOnce;
563
564
565

    /** \brief
     * If [i][j] of this field is set to true, the corresponding DOFMatrix of
Thomas Witkowski's avatar
Thomas Witkowski committed
566
     * the systemMatrix has been assembled at least once. This field is used
567
568
569
     * 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
570
    std::vector< std::vector< bool > > assembledMatrix;
571

Thomas Witkowski's avatar
Thomas Witkowski committed
572
573
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
574

Thomas Witkowski's avatar
Thomas Witkowski committed
575
576
    /// Writes the meshes and solution after the adaption loop.
    std::vector<FileWriterInterface*> fileWriters;
577
578
579
580
581
582

    /** \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
583
    RefinementManager *refinementManager;
584
585
586
587
588
589

    /** \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
590
    CoarseningManager *coarseningManager;
591
  
Thomas Witkowski's avatar
Thomas Witkowski committed
592
593
    /// Info level.
    int info;
594

595
596
597
598
599
600
601
602
603
604
605
606
    /** \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;
607
608
609
610
611
612
613
    
    /** \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;
614

615
616
    /// If true, AMDiS prints information about the assembling procedure to the screen.
    bool writeAsmInfo;
617
618
619
620
  };
}

#endif