ProblemVec.h 17.6 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

namespace AMDiS {

40
41
42
43
44
45
46
  struct OperatorPos 
  {
    int row, col;
    double *factor, *estFactor;
    Flag operatorType;
  };

47
48
49
  class ProblemVec : public ProblemStatBase,
		     public StandardProblemIteration
  {
50
  protected:
51
52
53
54
55
56
    // 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;

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

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

      exactSolutionFcts.resize(nComponents);
Thomas Witkowski's avatar
Thomas Witkowski committed
92
    }
93

Thomas Witkowski's avatar
Thomas Witkowski committed
94
95
    /// Destructor
    virtual ~ProblemVec() {}
96

Thomas Witkowski's avatar
Thomas Witkowski committed
97
    /// Initialisation of the problem.
98
99
100
101
102
    virtual void initialize(Flag initFlag,
			    ProblemVec *adoptProblem = NULL,
			    Flag adoptFlag = INIT_NOTHING);


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

Thomas Witkowski's avatar
Thomas Witkowski committed
106
    /// Used in \ref initialize().
107
    virtual void createFESpace(DOFAdmin *admin);
108

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

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
121
    /// Used in \ref initialize().
122
123
    virtual void createFileWriter();

124
125
126
127
    /** \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.
     */
128
129
130
131
132
133
    virtual void doOtherStuff();

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

    /** \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
164
    virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
165
166
167
168
169

    /** \brief
     * Implementation of ProblemStatBase::buildBeforeCoarsen().
     * Does nothing here.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
170
    virtual void buildBeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
171
172
173

    /** \brief
     * Implementation of ProblemStatBase::buildAfterCoarsen().
174
175
     * Assembles \ref A and \ref rhs. With the last two parameters, assembling
     * can be restricted to matrices or vectors only.
176
     */
177
178
179
    virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
				   bool assembleMatrix = true,
				   bool assembleVector = 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);

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

Thomas Witkowski's avatar
Thomas Witkowski committed
245
    /// Adds robin boundary conditions.
246
247
248
249
    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
250
    /// Adds periodic boundary conditions.
251
252
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

Thomas Witkowski's avatar
Thomas Witkowski committed
253
    /// Implementation of ProblemStatBase::allowFirstRefinement().
254
255
    inline void allowFirstRefinement() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
256
257
      allowFirstRef = true;
    }
Thomas Witkowski's avatar
Thomas Witkowski committed
258
259
260
261
262

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

Thomas Witkowski's avatar
Thomas Witkowski committed
267
268
269
    ///
    void assembleOnDifMeshes(FiniteElemSpace *rowFeSpace, 
			     FiniteElemSpace *colFeSpace,
Thomas Witkowski's avatar
Thomas Witkowski committed
270
			     Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
271
272
			     DOFMatrix *matrix, 
			     DOFVector<double> *vector);
273

Thomas Witkowski's avatar
Thomas Witkowski committed
274
275
276
277
278
279
280
281
    ///
    void assembleOnDifMeshes2(const FiniteElemSpace *mainFeSpace, 
			      const FiniteElemSpace *auxFeSpace,
			      Flag assembleFlag,
			      DOFMatrix *matrix,
			      DOFVector<double> *vector);

    ///
282
283
284
285
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
286
287
288
289
290
  
    /** \name getting methods
     * \{ 
     */

Thomas Witkowski's avatar
Thomas Witkowski committed
291
    /// Returns \ref solution.
292
293
    inline SystemVector* getSolution() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
294
295
      return solution; 
    }
296

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

Thomas Witkowski's avatar
Thomas Witkowski committed
303
    /// Returns \ref systemMatrix.
304
305
    inline Matrix<DOFMatrix*> *getSystemMatrix() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
306
307
      return systemMatrix; 
    }
308

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
324
    /// Returns \ref meshes
325
326
    inline std::vector<Mesh*> getMeshes() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
327
328
      return meshes; 
    }
329

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
351
    /// Returns \ref estimator.
352
353
    inline std::vector<Estimator*> getEstimator() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
354
355
      return estimator; 
    }
356

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
369
    /// Returns \ref refinementManager.
370
371
    inline CoarseningManager* getCoarseningManager(int comp) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
372
373
      return coarseningManager; 
    }
374

Thomas Witkowski's avatar
Thomas Witkowski committed
375
    /// Returns \ref solver.
376
377
    inline OEMSolver* getSolver() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
378
379
      return solver; 
    }
380

Thomas Witkowski's avatar
Thomas Witkowski committed
381
    /// Returns \ref marker.
382
383
    inline Marker *getMarker(int comp) 
    { 
384
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
385
    }
386

Thomas Witkowski's avatar
Thomas Witkowski committed
387
    /// Returns \ref marker.
388
389
    inline std::vector<Marker*> getMarker() 
    { 
390
      return marker; 
Thomas Witkowski's avatar
Thomas Witkowski committed
391
    }
392

Thomas Witkowski's avatar
Thomas Witkowski committed
393
    /// Returns the name of the problem
Thomas Witkowski's avatar
Thomas Witkowski committed
394
    inline virtual std::string getName() 
395
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
396
397
      return name; 
    }
398

Thomas Witkowski's avatar
Thomas Witkowski committed
399
    /// Returns \ref useGetBound.
400
401
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
402
403
      return useGetBound; 
    }
404

405
406
407
408
409
410
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

411
412
413
414
415
416
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
417
    /// Sets \ref estimator.
418
419
    inline void setEstimator(std::vector<Estimator*> est) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
420
421
      estimator = est; 
    }
422

Thomas Witkowski's avatar
Thomas Witkowski committed
423
    /// Sets the FE space for the given component.
424
425
    inline void setFESpace(FiniteElemSpace *feSpace, int comp) 
    {
426
      feSpaces[comp] = feSpace;
Thomas Witkowski's avatar
Thomas Witkowski committed
427
    }
428

Thomas Witkowski's avatar
Thomas Witkowski committed
429
    /// Sets \ref estimator.
430
431
    inline void setEstimator(Estimator* est, int comp) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
432
433
      estimator[comp] = est; 
    }
434

Thomas Witkowski's avatar
Thomas Witkowski committed
435
    /// Sets \ref marker.
436
437
    inline void setMarker(Marker* mark, int comp) 
    { 
438
      marker[comp] = mark; 
Thomas Witkowski's avatar
Thomas Witkowski committed
439
    }
440

Thomas Witkowski's avatar
Thomas Witkowski committed
441
    /// Sets \ref solver.
442
443
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
444
445
      solver = sol; 
    }
446

Thomas Witkowski's avatar
Thomas Witkowski committed
447
    ///
448
449
    inline void setAssembleMatrixOnlyOnce(int i, int j, bool value = true) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
450
      assembleMatrixOnlyOnce[i][j] = value;
451
452
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
453
    ///
454
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
455
456
			     int component) 
    {
457
458
459
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
460
    ///
461
462
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int component) 
    {
463
464
465
      return exactSolutionFcts[component];
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
466
    ///
467
468
    void setComputeExactError(bool v) 
    {
469
470
471
      computeExactError = v;
    }

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

Thomas Witkowski's avatar
Thomas Witkowski committed
595
596
    /// Allows one refinement although the adapt tolerance is reached already.
    bool allowFirstRef;
597
598
599
600
601
602
603
604
605
606
607
608
609

    /** \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;
610
611
612
613

    std::map<Operator*, std::vector<OperatorPos> > operators;

    std::map<Operator*, Flag> opFlags;
614
615
616
617
  };
}

#endif