ProblemVec.h 16.6 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() 
    { 
177
      return 1; 
Thomas Witkowski's avatar
Thomas Witkowski committed
178
    }
179

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
195
    /// Writes output files.
196
197
    void writeFiles(AdaptInfo *adaptInfo, bool force);

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

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

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

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

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

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
243
244
245
    ///
    void assembleOnDifMeshes(FiniteElemSpace *rowFeSpace, 
			     FiniteElemSpace *colFeSpace,
Thomas Witkowski's avatar
Thomas Witkowski committed
246
			     Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
247
248
			     DOFMatrix *matrix, 
			     DOFVector<double> *vector);
249

Thomas Witkowski's avatar
Thomas Witkowski committed
250
251
252
253
254
255
256
257
    ///
    void assembleOnDifMeshes2(const FiniteElemSpace *mainFeSpace, 
			      const FiniteElemSpace *auxFeSpace,
			      Flag assembleFlag,
			      DOFMatrix *matrix,
			      DOFVector<double> *vector);

    ///
258
259
260
261
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
262
263
264
265
266
  
    /** \name getting methods
     * \{ 
     */

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
279
    /// Returns \ref systemMatrix.
280
281
    inline Matrix<DOFMatrix*> *getSystemMatrix() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
282
283
      return systemMatrix; 
    }
284

Thomas Witkowski's avatar
Thomas Witkowski committed
285
    /// Returns a pointer to the corresponding DOFMatrix.
286
287
    inline DOFMatrix* getSystemMatrix(int row, int col) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
288
289
290
291
      return (*systemMatrix)[row][col];
    }

    /// Returns mesh of given component
292
293
    inline Mesh* getMesh(int comp) 
    {
294
      FUNCNAME("ProblemVec::getMesh()");
Thomas Witkowski's avatar
Thomas Witkowski committed
295
      TEST_EXIT(comp < static_cast<int>(componentMeshes.size()) && comp >= 0)
296
	("invalid component number\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
297
      return componentMeshes[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
298
    }
299

Thomas Witkowski's avatar
Thomas Witkowski committed
300
    /// Returns \ref meshes
301
302
    inline std::vector<Mesh*> getMeshes() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
303
304
      return meshes; 
    }
305

Thomas Witkowski's avatar
Thomas Witkowski committed
306
    /// Returns \ref feSpace_.
307
308
    inline FiniteElemSpace* getFESpace(int comp) 
    { 
309
      FUNCNAME("ProblemVec::getFESpace()");
310
      TEST_EXIT(comp < static_cast<int>(componentSpaces.size()) && comp >= 0)
311
	("invalid component number\n");
312
      return componentSpaces[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
313
    }
314

Thomas Witkowski's avatar
Thomas Witkowski committed
315
    /// Returns \ref feSpaces.
316
317
    inline std::vector<FiniteElemSpace*> getFESpaces() 
    { 
318
      return feSpaces; 
Thomas Witkowski's avatar
Thomas Witkowski committed
319
    }
320

Thomas Witkowski's avatar
Thomas Witkowski committed
321
    /// Returns \ref componentSpaces;
322
323
    inline std::vector<FiniteElemSpace*> getComponentFESpaces() 
    {
324
      return componentSpaces;
325
326
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
327
    /// Returns \ref estimator.
328
329
    inline std::vector<Estimator*> getEstimator() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
330
331
      return estimator; 
    }
332

Thomas Witkowski's avatar
Thomas Witkowski committed
333
    /// Returns \ref estimator.
334
335
    inline Estimator* getEstimator(int comp) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
336
337
      return estimator[comp]; 
    }
338

Thomas Witkowski's avatar
Thomas Witkowski committed
339
    /// Returns \ref refinementManager.
340
341
    inline RefinementManager* getRefinementManager(int comp) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
342
343
      return refinementManager; 
    }
344

Thomas Witkowski's avatar
Thomas Witkowski committed
345
    /// Returns \ref refinementManager.
346
347
    inline CoarseningManager* getCoarseningManager(int comp) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
348
349
      return coarseningManager; 
    }
350

Thomas Witkowski's avatar
Thomas Witkowski committed
351
    /// Returns \ref solver.
352
353
    inline OEMSolver* getSolver() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
354
355
      return solver; 
    }
356

Thomas Witkowski's avatar
Thomas Witkowski committed
357
    /// Returns \ref marker.
358
359
    inline Marker *getMarker(int comp) 
    { 
360
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
361
    }
362

Thomas Witkowski's avatar
Thomas Witkowski committed
363
    /// Returns \ref marker.
364
365
    inline std::vector<Marker*> getMarker() 
    { 
366
      return marker; 
Thomas Witkowski's avatar
Thomas Witkowski committed
367
    }
368

Thomas Witkowski's avatar
Thomas Witkowski committed
369
    /// Returns the name of the problem
370
371
    inline virtual const std::string& getName() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
372
373
      return name; 
    }
374

Thomas Witkowski's avatar
Thomas Witkowski committed
375
    /// Returns \ref useGetBound.
376
377
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
378
379
      return useGetBound; 
    }
380

381
382
383
384
385
386
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

387
388
389
390
391
392
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
393
    /// Sets \ref estimator.
394
395
    inline void setEstimator(std::vector<Estimator*> est) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
396
397
      estimator = est; 
    }
398

Thomas Witkowski's avatar
Thomas Witkowski committed
399
    /// Sets the FE space for the given component.
400
401
    inline void setFESpace(FiniteElemSpace *feSpace, int comp) 
    {
402
      feSpaces[comp] = feSpace;
Thomas Witkowski's avatar
Thomas Witkowski committed
403
    }
404

Thomas Witkowski's avatar
Thomas Witkowski committed
405
    /// Sets \ref estimator.
406
407
    inline void setEstimator(Estimator* est, int comp) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
408
409
      estimator[comp] = est; 
    }
410

Thomas Witkowski's avatar
Thomas Witkowski committed
411
    /// Sets \ref marker.
412
413
    inline void setMarker(Marker* mark, int comp) 
    { 
414
      marker[comp] = mark; 
Thomas Witkowski's avatar
Thomas Witkowski committed
415
    }
416

Thomas Witkowski's avatar
Thomas Witkowski committed
417
    /// Sets \ref solver.
418
419
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
420
421
      solver = sol; 
    }
422

Thomas Witkowski's avatar
Thomas Witkowski committed
423
    ///
424
425
    inline void setAssembleMatrixOnlyOnce(int i, int j, bool value = true) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
426
      assembleMatrixOnlyOnce[i][j] = value;
427
428
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
429
    ///
430
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
431
432
			     int component) 
    {
433
434
435
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
436
    ///
437
438
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int component) 
    {
439
440
441
      return exactSolutionFcts[component];
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
442
    ///
443
444
    void setComputeExactError(bool v) 
    {
445
446
447
      computeExactError = v;
    }

448
449
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
450
451
452
453
454
    /** \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);
455

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
462
463

    /// Returns \ref fileWriters.
464
465
    std::vector<FileWriterInterface*>& getFileWriterList() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
466
467
      return fileWriters;
    }
468

Thomas Witkowski's avatar
Thomas Witkowski committed
469
470
471
472
473
474
475
  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);

476
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
477
478
479
    
    /// Name of this problem.
    std::string name;
480

Thomas Witkowski's avatar
Thomas Witkowski committed
481
    /// Number of problem components
482
    int nComponents;
483
484

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
485
486
487
     * 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.
488
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
489
490
491
    int nMeshes;

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

Thomas Witkowski's avatar
Thomas Witkowski committed
494
495
    /// Meshes of this problem.
    std::vector<Mesh*> meshes;
496

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

Thomas Witkowski's avatar
Thomas Witkowski committed
500
    /// Pointer to the meshes for the different problem components
Thomas Witkowski's avatar
Thomas Witkowski committed
501
    std::vector<Mesh*> componentMeshes;
502
503

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
504
505
506
     * 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.
507
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
508
509
510
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
511
    std::vector<Marker*> marker;
512

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

Thomas Witkowski's avatar
Thomas Witkowski committed
516
    /// Linear solver of this problem. Used in \ref solve().
517
    OEMSolver *solver;
518

Thomas Witkowski's avatar
Thomas Witkowski committed
519
520
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
521

Thomas Witkowski's avatar
Thomas Witkowski committed
522
523
    /// System vector for the right hand side 
    SystemVector *rhs;
524

Thomas Witkowski's avatar
Thomas Witkowski committed
525
526
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
527

528
529
530
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

531
532
533
534
535
536
537
    /** \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
538
    std::vector< std::vector< bool > > assembleMatrixOnlyOnce;
539
540
541

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

Thomas Witkowski's avatar
Thomas Witkowski committed
548
549
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
550

Thomas Witkowski's avatar
Thomas Witkowski committed
551
552
    /// Writes the meshes and solution after the adaption loop.
    std::vector<FileWriterInterface*> fileWriters;
553
554
555
556
557
558

    /** \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
559
    RefinementManager *refinementManager;
560
561
562
563
564
565

    /** \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
566
    CoarseningManager *coarseningManager;
567
  
Thomas Witkowski's avatar
Thomas Witkowski committed
568
569
    /// Info level.
    int info;
570

Thomas Witkowski's avatar
Thomas Witkowski committed
571
572
    /// Allows one refinement although the adapt tolerance is reached already.
    bool allowFirstRef;
573
574
575
576
577
578
579
580
581
582
583
584
585

    /** \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;
586
587
588
589
  };
}

#endif