ProblemVec.h 17.1 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
38
39
40
41
42

namespace AMDiS {

  class ProblemVec : public ProblemStatBase,
		     public StandardProblemIteration
  {
43
  protected:
44
45
46
47
48
49
    // 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;

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

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

      exactSolutionFcts.resize(nComponents);
Thomas Witkowski's avatar
Thomas Witkowski committed
85
    }
86

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

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


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

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

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

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

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

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

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

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

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

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

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

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

174
175
176
    void createPrecon();


177
178
179
180
181
182
183
    /** \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
184
    /// Returns number of managed problems
185
186
    virtual int getNumProblems() 
    { 
187
      return 1; 
Thomas Witkowski's avatar
Thomas Witkowski committed
188
    }
189

Thomas Witkowski's avatar
Thomas Witkowski committed
190
    /// Implementation of ProblemStatBase::getNumComponents()
191
192
    virtual int getNumComponents() 
    { 
193
      return nComponents; 
Thomas Witkowski's avatar
Thomas Witkowski committed
194
    }
195
196
197
198
199

    /** \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.
     */
200
201
    virtual ProblemStatBase *getProblem(int number = 0) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
202
      return this; 
Thomas Witkowski's avatar
Thomas Witkowski committed
203
    }
204

205
    /// Writes output files. TODO: Make obsolete.
206
207
    void writeFiles(AdaptInfo *adaptInfo, bool force);

208
209
210
    /// Writes output files.
    void writeFiles(AdaptInfo &adaptInfo, bool force);

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

Thomas Witkowski's avatar
Thomas Witkowski committed
214
    /// Adds an Operator to \ref A.
215
216
    void addMatrixOperator(Operator *op, int i, int j,
			   double *factor = NULL,
217
			   double *estFactor = NULL);
218

Thomas Witkowski's avatar
Thomas Witkowski committed
219
    /// Adds an Operator to \ref rhs.
220
221
    void addVectorOperator(Operator *op, int i,
			   double *factor = NULL,
222
			   double *estFactor = NULL);
223

Thomas Witkowski's avatar
Thomas Witkowski committed
224
    /// Adds dirichlet boundary conditions.
225
    virtual void addDirichletBC(BoundaryType type, int row, int col,
226
227
				AbstractFunction<double, WorldVector<double> > *b);

Thomas Witkowski's avatar
Thomas Witkowski committed
228
    /// Adds neumann boundary conditions.
229
230
231
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      AbstractFunction<double, WorldVector<double> > *n);

Thomas Witkowski's avatar
Thomas Witkowski committed
232
    /// Adds robin boundary conditions.
233
234
235
236
    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
237
    /// Adds periodic boundary conditions.
238
239
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

Thomas Witkowski's avatar
Thomas Witkowski committed
240
    /// Implementation of ProblemStatBase::allowFirstRefinement().
241
242
    inline void allowFirstRefinement() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
243
244
      allowFirstRef = true;
    }
Thomas Witkowski's avatar
Thomas Witkowski committed
245
246
247
248
249

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

Thomas Witkowski's avatar
Thomas Witkowski committed
254
255
256
    ///
    void assembleOnDifMeshes(FiniteElemSpace *rowFeSpace, 
			     FiniteElemSpace *colFeSpace,
Thomas Witkowski's avatar
Thomas Witkowski committed
257
			     Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
258
259
			     DOFMatrix *matrix, 
			     DOFVector<double> *vector);
260

Thomas Witkowski's avatar
Thomas Witkowski committed
261
262
263
264
265
266
267
268
    ///
    void assembleOnDifMeshes2(const FiniteElemSpace *mainFeSpace, 
			      const FiniteElemSpace *auxFeSpace,
			      Flag assembleFlag,
			      DOFMatrix *matrix,
			      DOFVector<double> *vector);

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
290
    /// Returns \ref systemMatrix.
291
292
    inline Matrix<DOFMatrix*> *getSystemMatrix() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
293
294
      return systemMatrix; 
    }
295

Thomas Witkowski's avatar
Thomas Witkowski committed
296
    /// Returns a pointer to the corresponding DOFMatrix.
297
298
    inline DOFMatrix* getSystemMatrix(int row, int col) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
299
300
301
302
      return (*systemMatrix)[row][col];
    }

    /// Returns mesh of given component
303
304
    inline Mesh* getMesh(int comp) 
    {
305
      FUNCNAME("ProblemVec::getMesh()");
Thomas Witkowski's avatar
Thomas Witkowski committed
306
      TEST_EXIT(comp < static_cast<int>(componentMeshes.size()) && comp >= 0)
307
	("invalid component number\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
308
      return componentMeshes[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
309
    }
310

Thomas Witkowski's avatar
Thomas Witkowski committed
311
    /// Returns \ref meshes
312
313
    inline std::vector<Mesh*> getMeshes() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
314
315
      return meshes; 
    }
316

Thomas Witkowski's avatar
Thomas Witkowski committed
317
    /// Returns \ref feSpace_.
318
319
    inline FiniteElemSpace* getFESpace(int comp) 
    { 
320
      FUNCNAME("ProblemVec::getFESpace()");
321
      TEST_EXIT(comp < static_cast<int>(componentSpaces.size()) && comp >= 0)
322
	("invalid component number\n");
323
      return componentSpaces[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
324
    }
325

Thomas Witkowski's avatar
Thomas Witkowski committed
326
    /// Returns \ref feSpaces.
327
328
    inline std::vector<FiniteElemSpace*> getFESpaces() 
    { 
329
      return feSpaces; 
Thomas Witkowski's avatar
Thomas Witkowski committed
330
    }
331

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

Thomas Witkowski's avatar
Thomas Witkowski committed
338
    /// Returns \ref estimator.
339
340
    inline std::vector<Estimator*> getEstimator() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
341
342
      return estimator; 
    }
343

Thomas Witkowski's avatar
Thomas Witkowski committed
344
    /// Returns \ref estimator.
345
346
    inline Estimator* getEstimator(int comp) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
347
348
      return estimator[comp]; 
    }
349

Thomas Witkowski's avatar
Thomas Witkowski committed
350
    /// Returns \ref refinementManager.
351
352
    inline RefinementManager* getRefinementManager(int comp) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
353
354
      return refinementManager; 
    }
355

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

Thomas Witkowski's avatar
Thomas Witkowski committed
362
    /// Returns \ref solver.
363
364
    inline OEMSolver* getSolver() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
365
366
      return solver; 
    }
367

Thomas Witkowski's avatar
Thomas Witkowski committed
368
    /// Returns \ref marker.
369
370
    inline Marker *getMarker(int comp) 
    { 
371
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
372
    }
373

Thomas Witkowski's avatar
Thomas Witkowski committed
374
    /// Returns \ref marker.
375
376
    inline std::vector<Marker*> getMarker() 
    { 
377
      return marker; 
Thomas Witkowski's avatar
Thomas Witkowski committed
378
    }
379

Thomas Witkowski's avatar
Thomas Witkowski committed
380
    /// Returns the name of the problem
Thomas Witkowski's avatar
Thomas Witkowski committed
381
    inline virtual std::string getName() 
382
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
383
384
      return name; 
    }
385

Thomas Witkowski's avatar
Thomas Witkowski committed
386
    /// Returns \ref useGetBound.
387
388
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
389
390
      return useGetBound; 
    }
391

392
393
394
395
396
397
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

398
399
400
401
402
403
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
404
    /// Sets \ref estimator.
405
406
    inline void setEstimator(std::vector<Estimator*> est) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
407
408
      estimator = est; 
    }
409

Thomas Witkowski's avatar
Thomas Witkowski committed
410
    /// Sets the FE space for the given component.
411
412
    inline void setFESpace(FiniteElemSpace *feSpace, int comp) 
    {
413
      feSpaces[comp] = feSpace;
Thomas Witkowski's avatar
Thomas Witkowski committed
414
    }
415

Thomas Witkowski's avatar
Thomas Witkowski committed
416
    /// Sets \ref estimator.
417
418
    inline void setEstimator(Estimator* est, int comp) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
419
420
      estimator[comp] = est; 
    }
421

Thomas Witkowski's avatar
Thomas Witkowski committed
422
    /// Sets \ref marker.
423
424
    inline void setMarker(Marker* mark, int comp) 
    { 
425
      marker[comp] = mark; 
Thomas Witkowski's avatar
Thomas Witkowski committed
426
    }
427

Thomas Witkowski's avatar
Thomas Witkowski committed
428
    /// Sets \ref solver.
429
430
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
431
432
      solver = sol; 
    }
433

Thomas Witkowski's avatar
Thomas Witkowski committed
434
    ///
435
436
    inline void setAssembleMatrixOnlyOnce(int i, int j, bool value = true) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
437
      assembleMatrixOnlyOnce[i][j] = value;
438
439
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
440
    ///
441
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
442
443
			     int component) 
    {
444
445
446
      exactSolutionFcts[component] = fct;
    }

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

Thomas Witkowski's avatar
Thomas Witkowski committed
453
    ///
454
455
    void setComputeExactError(bool v) 
    {
456
457
458
      computeExactError = v;
    }

459
460
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
461
462
463
464
    /** \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
465
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, std::string name);
466

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
473
474

    /// Returns \ref fileWriters.
475
476
    std::vector<FileWriterInterface*>& getFileWriterList() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
477
478
      return fileWriters;
    }
479

Thomas Witkowski's avatar
Thomas Witkowski committed
480
481
482
483
484
485
486
  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);

487
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
488
489
490
    
    /// Name of this problem.
    std::string name;
491

Thomas Witkowski's avatar
Thomas Witkowski committed
492
    /// Number of problem components
493
    int nComponents;
494
495

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
496
497
498
     * 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.
499
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
500
501
502
    int nMeshes;

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

Thomas Witkowski's avatar
Thomas Witkowski committed
505
506
    /// Meshes of this problem.
    std::vector<Mesh*> meshes;
507

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

Thomas Witkowski's avatar
Thomas Witkowski committed
511
    /// Pointer to the meshes for the different problem components
Thomas Witkowski's avatar
Thomas Witkowski committed
512
    std::vector<Mesh*> componentMeshes;
513
514

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
515
516
517
     * 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.
518
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
519
520
521
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
522
    std::vector<Marker*> marker;
523

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

Thomas Witkowski's avatar
Thomas Witkowski committed
527
    /// Linear solver of this problem. Used in \ref solve().
528
    OEMSolver *solver;
529

Thomas Witkowski's avatar
Thomas Witkowski committed
530
531
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
532

Thomas Witkowski's avatar
Thomas Witkowski committed
533
534
    /// System vector for the right hand side 
    SystemVector *rhs;
535

Thomas Witkowski's avatar
Thomas Witkowski committed
536
537
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
538

539
540
541
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

542
543
544
545
546
547
548
    /** \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
549
    std::vector< std::vector< bool > > assembleMatrixOnlyOnce;
550
551
552

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

Thomas Witkowski's avatar
Thomas Witkowski committed
559
560
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
561

Thomas Witkowski's avatar
Thomas Witkowski committed
562
563
    /// Writes the meshes and solution after the adaption loop.
    std::vector<FileWriterInterface*> fileWriters;
564
565
566
567
568
569

    /** \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
570
    RefinementManager *refinementManager;
571
572
573
574
575
576

    /** \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
577
    CoarseningManager *coarseningManager;
578
  
Thomas Witkowski's avatar
Thomas Witkowski committed
579
580
    /// Info level.
    int info;
581

Thomas Witkowski's avatar
Thomas Witkowski committed
582
583
    /// Allows one refinement although the adapt tolerance is reached already.
    bool allowFirstRef;
584
585
586
587
588
589
590
591
592
593
594
595
596

    /** \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;
597
598
599
600
  };
}

#endif