ProblemVec.h 18 KB
Newer Older
1
2
3
4
5
6
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
7
// ==  TU Dresden                                                            ==
8
// ==                                                                        ==
9
10
11
// ==  Institut fr Wissenschaftliches Rechnen                               ==
// ==  Zellescher Weg 12-14                                                  ==
// ==  01069 Dresden                                                         ==
12
13
14
15
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
16
// ==  https://gforge.zih.tu-dresden.de/projects/amdis/                      ==
17
18
19
20
21
22
23
24
// ==                                                                        ==
// ============================================================================

/** \file ProblemVec.h */

#ifndef AMDIS_PROBLEMVEC_H
#define AMDIS_PROBLEMVEC_H

Thomas Witkowski's avatar
Thomas Witkowski committed
25
26
#include <vector>
#include <list>
27
#include "AMDiS_fwd.h"
28
29
30
31
32
#include "ProblemStatBase.h"
#include "Parameters.h"
#include "Boundary.h"
#include "MatrixVector.h"
#include "StandardProblemIteration.h"
33
#include "ElementFileWriter.h"
Thomas Witkowski's avatar
Thomas Witkowski committed
34
#include "ComponentTraverseInfo.h"
35
36
#include "AbstractFunction.h"
#include "SolverMatrix.h"
37
#include "SystemVector.h"
38
39
40

namespace AMDiS {

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

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

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

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

      exactSolutionFcts.resize(nComponents);
Thomas Witkowski's avatar
Thomas Witkowski committed
94
    }
95

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

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


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

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

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

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

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

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

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

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

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

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

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

    /** \brief
     * Implementation of ProblemStatBase::buildAfterCoarsen().
176
177
     * Assembles \ref A and \ref rhs. With the last two parameters, assembling
     * can be restricted to matrices or vectors only.
178
     */
179
180
181
    virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
				   bool assembleMatrix = true,
				   bool assembleVector = true);
182

183
184
    bool dualMeshTraverseRequired();

185
186
    void dualAssemble(AdaptInfo *adaptInfo, Flag flag, 
		      bool asmMatrix = true, bool asmVector = true);
187

188
189
190
    void createPrecon();


191
192
193
194
195
196
197
    /** \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
198
    /// Returns number of managed problems
199
200
    virtual int getNumProblems() 
    { 
201
      return 1; 
Thomas Witkowski's avatar
Thomas Witkowski committed
202
    }
203

Thomas Witkowski's avatar
Thomas Witkowski committed
204
    /// Implementation of ProblemStatBase::getNumComponents()
205
206
    virtual int getNumComponents() 
    { 
207
      return nComponents; 
Thomas Witkowski's avatar
Thomas Witkowski committed
208
    }
209
210
211
212
213

    /** \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.
     */
214
215
    virtual ProblemStatBase *getProblem(int number = 0) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
216
      return this; 
Thomas Witkowski's avatar
Thomas Witkowski committed
217
    }
218

219
    /// Writes output files. TODO: Make obsolete.
220
221
    void writeFiles(AdaptInfo *adaptInfo, bool force);

222
223
224
    /// Writes output files.
    void writeFiles(AdaptInfo &adaptInfo, bool force);

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

Thomas Witkowski's avatar
Thomas Witkowski committed
228
    /// Adds an Operator to \ref A.
229
    void addMatrixOperator(Operator *op, int i, int j,
230
231
232
233
234
			   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);
235

Thomas Witkowski's avatar
Thomas Witkowski committed
236
    /// Adds an Operator to \ref rhs.
237
    void addVectorOperator(Operator *op, int i,
238
239
240
241
242
			   double *factor = NULL, double *estFactor = NULL);

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

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

248
249
250
    virtual void addDirichletBC(BoundaryType type, int row, int col,
				DOFVector<double> *vec);

Thomas Witkowski's avatar
Thomas Witkowski committed
251
    /// Adds neumann boundary conditions.
252
253
254
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      AbstractFunction<double, WorldVector<double> > *n);

Thomas Witkowski's avatar
Thomas Witkowski committed
255
    /// Adds robin boundary conditions.
256
257
258
259
    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
260
    /// Adds periodic boundary conditions.
261
262
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

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

Thomas Witkowski's avatar
Thomas Witkowski committed
271
272

    ///
273
274
275
276
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
277
278
279
280
281
  
    /** \name getting methods
     * \{ 
     */

Thomas Witkowski's avatar
Thomas Witkowski committed
282
    /// Returns \ref solution.
283
284
    inline SystemVector* getSolution() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
285
286
      return solution; 
    }
287

288
289
290
291
292
    inline const DOFVector<double>* getSolutionVector(int i = 0)
    {
      return solution->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
293
    /// Returns \ref rhs.
294
    inline SystemVector* getRhs() 
295
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
296
297
      return rhs; 
    }
298

299
300
301
302
303
    inline const DOFVector<double>* getRhsVector(int i = 0)
    {
      return rhs->getDOFVector(i);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

473
474
475
476
477
478
    /// Sets \ref writeAsmInfo;
    void setWriteAsmInfo(bool b)
    {
      writeAsmInfo = b;
    }

479
480
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
481
482
483
484
    /** \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
485
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, std::string name);
486

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
493
494

    /// Returns \ref fileWriters.
495
496
    std::vector<FileWriterInterface*>& getFileWriterList() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
497
498
      return fileWriters;
    }
499

Thomas Witkowski's avatar
Thomas Witkowski committed
500
501
502
503
504
505
506
  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);

507
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
508
509
510
    
    /// Name of this problem.
    std::string name;
511

Thomas Witkowski's avatar
Thomas Witkowski committed
512
    /// Number of problem components
513
    int nComponents;
514
515

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
516
517
518
     * 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.
519
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
520
521
522
    int nMeshes;

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

Thomas Witkowski's avatar
Thomas Witkowski committed
525
526
    /// Meshes of this problem.
    std::vector<Mesh*> meshes;
527

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

Thomas Witkowski's avatar
Thomas Witkowski committed
531
    /// Pointer to the meshes for the different problem components
Thomas Witkowski's avatar
Thomas Witkowski committed
532
    std::vector<Mesh*> componentMeshes;
533
534

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
535
536
537
     * 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.
538
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
539
540
541
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
542
    std::vector<Marker*> marker;
543

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

Thomas Witkowski's avatar
Thomas Witkowski committed
547
    /// Linear solver of this problem. Used in \ref solve().
548
    OEMSolver *solver;
549

Thomas Witkowski's avatar
Thomas Witkowski committed
550
551
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
552

Thomas Witkowski's avatar
Thomas Witkowski committed
553
554
    /// System vector for the right hand side 
    SystemVector *rhs;
555

Thomas Witkowski's avatar
Thomas Witkowski committed
556
557
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
558

559
560
561
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

562
563
564
565
566
567
568
    /** \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
569
    std::vector< std::vector< bool > > assembleMatrixOnlyOnce;
570
571
572

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

Thomas Witkowski's avatar
Thomas Witkowski committed
579
580
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
581

Thomas Witkowski's avatar
Thomas Witkowski committed
582
583
    /// Writes the meshes and solution after the adaption loop.
    std::vector<FileWriterInterface*> fileWriters;
584
585
586
587
588
589

    /** \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
590
    RefinementManager *refinementManager;
591
592
593
594
595
596

    /** \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
597
    CoarseningManager *coarseningManager;
598
  
Thomas Witkowski's avatar
Thomas Witkowski committed
599
600
    /// Info level.
    int info;
601

602
603
604
605
606
607
608
609
610
611
612
613
    /** \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;
614
615
616
617
618
619
620
    
    /** \brief
     * If at least on boundary condition is set, this variable is true. It is used
     * to ensure that no operators are added after boundary condition were set. If
     * this would happen, boundary conditions could set wrong on off diagonal matrices.
     */
    bool boundaryConditionSet;
621
622
623
624

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

    std::map<Operator*, Flag> opFlags;
625
626
627

    /// If true, AMDiS prints information about the assembling procedure to the screen.
    bool writeAsmInfo;
628
629
630
631
  };
}

#endif