ProblemVec.h 16.4 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \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
38
39
40
41
42
43

namespace AMDiS {

  class ProblemVec : public ProblemStatBase,
		     public StandardProblemIteration
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
44
    /// Constructor
Thomas Witkowski's avatar
Thomas Witkowski committed
45
    ProblemVec(const std::string &nameStr,
46
47
	       ProblemIterationInterface *problemIteration = NULL)
      : StandardProblemIteration(this),
Thomas Witkowski's avatar
Thomas Witkowski committed
48
	name(nameStr),
49
	nComponents(-1),
Thomas Witkowski's avatar
Thomas Witkowski committed
50
51
52
53
54
55
56
57
58
	nMeshes(0),
	traverseInfo(0),
	solver(NULL),
	solution(NULL),
	rhs(NULL),
	systemMatrix(NULL),
	useGetBound(true),
	info(10),
	allowFirstRef(false),
59
	computeExactError(false)
60
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
61
      GET_PARAMETER(0, name + "->components", "%d", &nComponents);
62
      TEST_EXIT(nComponents > 0)("components not set!\n");    
Thomas Witkowski's avatar
Thomas Witkowski committed
63
      estimator.resize(nComponents, NULL);
64
      marker.resize(nComponents, NULL);
65

Thomas Witkowski's avatar
Thomas Witkowski committed
66
67
      assembleMatrixOnlyOnce.resize(nComponents);
      assembledMatrix.resize(nComponents);
68
      for (int i = 0; i < nComponents; i++) {
Thomas Witkowski's avatar
Thomas Witkowski committed
69
70
	assembleMatrixOnlyOnce[i].resize(nComponents);
	assembledMatrix[i].resize(nComponents);
71
	for (int j = 0; j < nComponents; j++) {
Thomas Witkowski's avatar
Thomas Witkowski committed
72
73
	  assembleMatrixOnlyOnce[i][j] = false;
	  assembledMatrix[i][j] = false;
74
75
	}
      }
76
77

      exactSolutionFcts.resize(nComponents);
Thomas Witkowski's avatar
Thomas Witkowski committed
78
    }
79

Thomas Witkowski's avatar
Thomas Witkowski committed
80
81
    /// Destructor
    virtual ~ProblemVec() {}
82

Thomas Witkowski's avatar
Thomas Witkowski committed
83
    /// Initialisation of the problem.
84
85
86
87
88
    virtual void initialize(Flag initFlag,
			    ProblemVec *adoptProblem = NULL,
			    Flag adoptFlag = INIT_NOTHING);


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

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

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

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

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
110
    /// Used in \ref initialize().
111
112
113
114
115
116
    virtual void doOtherStuff();

    /** \brief
     * Implementation of ProblemStatBase::solve(). Deligates the solving
     * of problems system to \ref solver.
     */
117
    virtual void solve(AdaptInfo *adaptInfo, bool fixedMatrix = false);
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146

    /** \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
147
    virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
148
149
150
151
152

    /** \brief
     * Implementation of ProblemStatBase::buildBeforeCoarsen().
     * Does nothing here.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
153
    virtual void buildBeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
154
155
156

    /** \brief
     * Implementation of ProblemStatBase::buildAfterCoarsen().
157
158
     * Assembles \ref A and \ref rhs. With the last two parameters, assembling
     * can be restricted to matrices or vectors only.
159
     */
160
161
162
    virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
				   bool assembleMatrix = true,
				   bool assembleVector = true);
163

164
165
166
    void createPrecon();


167
168
169
170
171
172
173
    /** \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
174
    /// Returns number of managed problems
175
176
    virtual int getNumProblems() { 
      return 1; 
Thomas Witkowski's avatar
Thomas Witkowski committed
177
    }
178

Thomas Witkowski's avatar
Thomas Witkowski committed
179
    /// Implementation of ProblemStatBase::getNumComponents()
180
    virtual int getNumComponents() { 
181
      return nComponents; 
Thomas Witkowski's avatar
Thomas Witkowski committed
182
    }
183
184
185
186
187

    /** \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.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
188
189
    virtual ProblemStatBase *getProblem(int number = 0) { 
      return this; 
Thomas Witkowski's avatar
Thomas Witkowski committed
190
    }
191

Thomas Witkowski's avatar
Thomas Witkowski committed
192
    /// Writes output files.
193
194
    void writeFiles(AdaptInfo *adaptInfo, bool force);

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

Thomas Witkowski's avatar
Thomas Witkowski committed
198
    /// Adds an Operator to \ref A.
199
200
    void addMatrixOperator(Operator *op, int i, int j,
			   double *factor = NULL,
201
202
			   double *estFactor = NULL,
			   bool fake = false);
203

Thomas Witkowski's avatar
Thomas Witkowski committed
204
    /// Adds an Operator to \ref rhs.
205
206
    void addVectorOperator(Operator *op, int i,
			   double *factor = NULL,
207
208
			   double *estFactor = NULL,
			   bool fake = false);
209

Thomas Witkowski's avatar
Thomas Witkowski committed
210
    /// Adds dirichlet boundary conditions.
211
    virtual void addDirichletBC(BoundaryType type, int row, int col,
212
213
				AbstractFunction<double, WorldVector<double> > *b);

Thomas Witkowski's avatar
Thomas Witkowski committed
214
    /// Adds neumann boundary conditions.
215
216
217
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      AbstractFunction<double, WorldVector<double> > *n);

Thomas Witkowski's avatar
Thomas Witkowski committed
218
    /// Adds robin boundary conditions.
219
220
221
222
    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
223
    /// Adds periodic boundary conditions.
224
225
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

Thomas Witkowski's avatar
Thomas Witkowski committed
226
    /// Implementation of ProblemStatBase::allowFirstRefinement().
227
    inline void allowFirstRefinement() {
Thomas Witkowski's avatar
Thomas Witkowski committed
228
229
      allowFirstRef = true;
    }
Thomas Witkowski's avatar
Thomas Witkowski committed
230
231
232
233
234

    /** \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
235
236
    void assembleOnOneMesh(FiniteElemSpace *feSpace, 
			   Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
237
238
			   DOFMatrix *matrix, DOFVector<double> *vector);

Thomas Witkowski's avatar
Thomas Witkowski committed
239
240
241
    ///
    void assembleOnDifMeshes(FiniteElemSpace *rowFeSpace, 
			     FiniteElemSpace *colFeSpace,
Thomas Witkowski's avatar
Thomas Witkowski committed
242
			     Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
243
244
			     DOFMatrix *matrix, 
			     DOFVector<double> *vector);
245

Thomas Witkowski's avatar
Thomas Witkowski committed
246
247
248
249
250
251
252
253
    ///
    void assembleOnDifMeshes2(const FiniteElemSpace *mainFeSpace, 
			      const FiniteElemSpace *auxFeSpace,
			      Flag assembleFlag,
			      DOFMatrix *matrix,
			      DOFVector<double> *vector);

    ///
254
255
256
257
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
258
259
260
261
262
  
    /** \name getting methods
     * \{ 
     */

Thomas Witkowski's avatar
Thomas Witkowski committed
263
    /// Returns \ref solution.
264
    inline SystemVector* getSolution() { 
Thomas Witkowski's avatar
Thomas Witkowski committed
265
266
      return solution; 
    }
267

Thomas Witkowski's avatar
Thomas Witkowski committed
268
    /// Returns \ref rhs.
269
    inline SystemVector* getRHS() { 
Thomas Witkowski's avatar
Thomas Witkowski committed
270
271
      return rhs; 
    }
272

Thomas Witkowski's avatar
Thomas Witkowski committed
273
    /// Returns \ref systemMatrix.
274
    inline Matrix<DOFMatrix*> *getSystemMatrix() { 
Thomas Witkowski's avatar
Thomas Witkowski committed
275
276
      return systemMatrix; 
    }
277

Thomas Witkowski's avatar
Thomas Witkowski committed
278
279
280
281
282
283
    /// Returns a pointer to the corresponding DOFMatrix.
    inline DOFMatrix* getSystemMatrix(int row, int col) {
      return (*systemMatrix)[row][col];
    }

    /// Returns mesh of given component
284
285
    inline Mesh* getMesh(int comp) {
      FUNCNAME("ProblemVec::getMesh()");
Thomas Witkowski's avatar
Thomas Witkowski committed
286
      TEST_EXIT(comp < static_cast<int>(componentMeshes.size()) && comp >= 0)
287
	("invalid component number\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
288
      return componentMeshes[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
289
    }
290

Thomas Witkowski's avatar
Thomas Witkowski committed
291
    /// Returns \ref meshes
Thomas Witkowski's avatar
Thomas Witkowski committed
292
    inline std::vector<Mesh*> getMeshes() {
Thomas Witkowski's avatar
Thomas Witkowski committed
293
294
      return meshes; 
    }
295

Thomas Witkowski's avatar
Thomas Witkowski committed
296
    /// Returns \ref feSpace_.
297
298
    inline FiniteElemSpace* getFESpace(int comp) { 
      FUNCNAME("ProblemVec::getFESpace()");
299
      TEST_EXIT(comp < static_cast<int>(componentSpaces.size()) && comp >= 0)
300
	("invalid component number\n");
301
      return componentSpaces[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
302
    }
303

Thomas Witkowski's avatar
Thomas Witkowski committed
304
    /// Returns \ref feSpaces.
Thomas Witkowski's avatar
Thomas Witkowski committed
305
    inline std::vector<FiniteElemSpace*> getFESpaces() { 
306
      return feSpaces; 
Thomas Witkowski's avatar
Thomas Witkowski committed
307
    }
308

Thomas Witkowski's avatar
Thomas Witkowski committed
309
    /// Returns \ref componentSpaces;
Thomas Witkowski's avatar
Thomas Witkowski committed
310
    inline std::vector<FiniteElemSpace*> getComponentFESpaces() {
311
      return componentSpaces;
312
313
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
314
    /// Returns \ref estimator.
Thomas Witkowski's avatar
Thomas Witkowski committed
315
    inline std::vector<Estimator*> getEstimator() { 
Thomas Witkowski's avatar
Thomas Witkowski committed
316
317
      return estimator; 
    }
318

Thomas Witkowski's avatar
Thomas Witkowski committed
319
    /// Returns \ref estimator.
320
    inline Estimator* getEstimator(int comp) { 
Thomas Witkowski's avatar
Thomas Witkowski committed
321
322
      return estimator[comp]; 
    }
323

Thomas Witkowski's avatar
Thomas Witkowski committed
324
    /// Returns \ref refinementManager.
325
    inline RefinementManager* getRefinementManager(int comp) { 
Thomas Witkowski's avatar
Thomas Witkowski committed
326
327
      return refinementManager; 
    }
328

Thomas Witkowski's avatar
Thomas Witkowski committed
329
    /// Returns \ref refinementManager.
330
    inline CoarseningManager* getCoarseningManager(int comp) { 
Thomas Witkowski's avatar
Thomas Witkowski committed
331
332
      return coarseningManager; 
    }
333

Thomas Witkowski's avatar
Thomas Witkowski committed
334
    /// Returns \ref solver.
335
    inline OEMSolver* getSolver() { 
Thomas Witkowski's avatar
Thomas Witkowski committed
336
337
      return solver; 
    }
338

Thomas Witkowski's avatar
Thomas Witkowski committed
339
    /// Returns \ref marker.
340
    inline Marker *getMarker(int comp) { 
341
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
342
    }
343

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

Thomas Witkowski's avatar
Thomas Witkowski committed
349
    /// Returns the name of the problem
Thomas Witkowski's avatar
Thomas Witkowski committed
350
    inline virtual const std::string& getName() { 
Thomas Witkowski's avatar
Thomas Witkowski committed
351
352
      return name; 
    }
353

Thomas Witkowski's avatar
Thomas Witkowski committed
354
    /// Returns \ref useGetBound.
355
    inline bool getBoundUsed() { 
Thomas Witkowski's avatar
Thomas Witkowski committed
356
357
      return useGetBound; 
    }
358
359
360
361
362
363
364

    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
365
    /// Sets \ref estimator.
Thomas Witkowski's avatar
Thomas Witkowski committed
366
    inline void setEstimator(std::vector<Estimator*> est) { 
Thomas Witkowski's avatar
Thomas Witkowski committed
367
368
      estimator = est; 
    }
369

Thomas Witkowski's avatar
Thomas Witkowski committed
370
    /// Sets the FE space for the given component.
371
    inline void setFESpace(FiniteElemSpace *feSpace, int comp) {
372
      feSpaces[comp] = feSpace;
Thomas Witkowski's avatar
Thomas Witkowski committed
373
    }
374

Thomas Witkowski's avatar
Thomas Witkowski committed
375
    /// Sets \ref estimator.
376
    inline void setEstimator(Estimator* est, int comp) { 
Thomas Witkowski's avatar
Thomas Witkowski committed
377
378
      estimator[comp] = est; 
    }
379

Thomas Witkowski's avatar
Thomas Witkowski committed
380
    /// Sets \ref marker.
381
382
    inline void setMarker(Marker* mark, int comp) { 
      marker[comp] = mark; 
Thomas Witkowski's avatar
Thomas Witkowski committed
383
    }
384

Thomas Witkowski's avatar
Thomas Witkowski committed
385
    /// Sets \ref solver.
386
    inline void setSolver(OEMSolver* sol) { 
Thomas Witkowski's avatar
Thomas Witkowski committed
387
388
      solver = sol; 
    }
389

Thomas Witkowski's avatar
Thomas Witkowski committed
390
    ///
391
    inline void setAssembleMatrixOnlyOnce(int i, int j, bool value = true) {
Thomas Witkowski's avatar
Thomas Witkowski committed
392
      assembleMatrixOnlyOnce[i][j] = value;
393
394
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
395
    ///
396
397
398
399
400
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
			     int component) {
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
401
    ///
402
403
404
405
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int component) {
      return exactSolutionFcts[component];
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
406
    ///
407
408
409
410
    void setComputeExactError(bool v) {
      computeExactError = v;
    }

411
412
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
413
414
415
416
417
    /** \brief
     * Outputs the mesh of the given component, but the values are taken from the 
     * residual error estimator. 
     */
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, const std::string name);
418

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
425
426

    /// Returns \ref fileWriters.
Thomas Witkowski's avatar
Thomas Witkowski committed
427
    std::vector<FileWriterInterface*>& getFileWriterList() {
Thomas Witkowski's avatar
Thomas Witkowski committed
428
429
      return fileWriters;
    }
430

Thomas Witkowski's avatar
Thomas Witkowski committed
431
432
433
434
435
436
437
  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);

438
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
439
440
441
    
    /// Name of this problem.
    std::string name;
442

Thomas Witkowski's avatar
Thomas Witkowski committed
443
    /// Number of problem components
444
    int nComponents;
445
446

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
447
448
449
     * 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.
450
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
451
452
453
    int nMeshes;

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

Thomas Witkowski's avatar
Thomas Witkowski committed
456
457
    /// Meshes of this problem.
    std::vector<Mesh*> meshes;
458

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

Thomas Witkowski's avatar
Thomas Witkowski committed
462
    /// Pointer to the meshes for the different problem components
Thomas Witkowski's avatar
Thomas Witkowski committed
463
    std::vector<Mesh*> componentMeshes;
464
465

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
466
467
468
     * 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.
469
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
470
471
472
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
473
    std::vector<Marker*> marker;
474

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

Thomas Witkowski's avatar
Thomas Witkowski committed
478
    /// Linear solver of this problem. Used in \ref solve().
479
    OEMSolver *solver;
480

Thomas Witkowski's avatar
Thomas Witkowski committed
481
482
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
483

Thomas Witkowski's avatar
Thomas Witkowski committed
484
485
    /// System vector for the right hand side 
    SystemVector *rhs;
486

Thomas Witkowski's avatar
Thomas Witkowski committed
487
488
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
489

490
491
492
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

493
494
495
496
497
498
499
    /** \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
500
    std::vector< std::vector< bool > > assembleMatrixOnlyOnce;
501
502
503

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

Thomas Witkowski's avatar
Thomas Witkowski committed
510
511
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
512

Thomas Witkowski's avatar
Thomas Witkowski committed
513
514
    /// Writes the meshes and solution after the adaption loop.
    std::vector<FileWriterInterface*> fileWriters;
515
516
517
518
519
520

    /** \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
521
    RefinementManager *refinementManager;
522
523
524
525
526
527

    /** \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
528
    CoarseningManager *coarseningManager;
529
  
Thomas Witkowski's avatar
Thomas Witkowski committed
530
531
    /// Info level.
    int info;
532

Thomas Witkowski's avatar
Thomas Witkowski committed
533
534
    /// Allows one refinement although the adapt tolerance is reached already.
    bool allowFirstRef;
535
536
537
538
539
540
541
542
543
544
545
546
547

    /** \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;
548
549
550
551
  };
}

#endif