ProblemVec.h 18.3 KB
Newer Older
1
2
3
4
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
5
// ==  http://www.amdis-fem.org                                              ==
6
7
// ==                                                                        ==
// ============================================================================
8
9
10
11
12
13
14
15
16
17
18
19
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology 
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.


20
21
22
23
24
25

/** \file ProblemVec.h */

#ifndef AMDIS_PROBLEMVEC_H
#define AMDIS_PROBLEMVEC_H

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

namespace AMDiS {

42
43
  using namespace std;

44
45
46
47
48
49
50
  struct OperatorPos 
  {
    int row, col;
    double *factor, *estFactor;
    Flag operatorType;
  };

51
52
53
  class ProblemVec : public ProblemStatBase,
		     public StandardProblemIteration
  {
54
  protected:
55
    // Defines a mapping type from dof indices to world coordinates.
56
    typedef map<DegreeOfFreedom, WorldVector<double> > DofToCoord;
57
58

    // Defines a mapping type from dof indices to world coordinates.
59
    typedef map<WorldVector<double>, DegreeOfFreedom> CoordToDof;
60

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

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

      exactSolutionFcts.resize(nComponents);
Thomas Witkowski's avatar
Thomas Witkowski committed
98
    }
99

Thomas Witkowski's avatar
Thomas Witkowski committed
100
101
    /// Destructor
    virtual ~ProblemVec() {}
102

Thomas Witkowski's avatar
Thomas Witkowski committed
103
    /// Initialisation of the problem.
104
105
106
107
108
    virtual void initialize(Flag initFlag,
			    ProblemVec *adoptProblem = NULL,
			    Flag adoptFlag = INIT_NOTHING);


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

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

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

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
127
    /// Used in \ref initialize().
128
129
    virtual void createFileWriter();

130
131
132
133
    /** \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.
     */
134
135
136
137
138
139
    virtual void doOtherStuff();

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

    /** \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
170
    virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
171
172
173
174
175

    /** \brief
     * Implementation of ProblemStatBase::buildBeforeCoarsen().
     * Does nothing here.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
176
    virtual void buildBeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
177
178
179

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

187
188
    void buildAfterCoarsen_sebastianMode(AdaptInfo *adaptInfo, Flag flag);

189
190
    bool dualMeshTraverseRequired();

191
192
    void dualAssemble(AdaptInfo *adaptInfo, Flag flag, 
		      bool asmMatrix = true, bool asmVector = true);
193

194
195
196
    void createPrecon();


197
198
199
200
201
202
203
    /** \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
204
    /// Returns number of managed problems
205
206
    virtual int getNumProblems() 
    { 
207
      return 1; 
Thomas Witkowski's avatar
Thomas Witkowski committed
208
    }
209

Thomas Witkowski's avatar
Thomas Witkowski committed
210
    /// Implementation of ProblemStatBase::getNumComponents()
211
212
    virtual int getNumComponents() 
    { 
213
      return nComponents; 
Thomas Witkowski's avatar
Thomas Witkowski committed
214
    }
215
216
217
218
219

    /** \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.
     */
220
221
    virtual ProblemStatBase *getProblem(int number = 0) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
222
      return this; 
Thomas Witkowski's avatar
Thomas Witkowski committed
223
    }
224

225
    /// Writes output files. TODO: Make obsolete.
226
227
    void writeFiles(AdaptInfo *adaptInfo, bool force);

228
229
230
    /// Writes output files.
    void writeFiles(AdaptInfo &adaptInfo, bool force);

Thomas Witkowski's avatar
Thomas Witkowski committed
231
    /// Interpolates fct to \ref solution.
232
    void interpolInitialSolution(vector<AbstractFunction<double, WorldVector<double> >*> *fct);
233

234
    /// Adds an operator to \ref A.
235
    void addMatrixOperator(Operator *op, int i, int j,
236
237
			   double *factor = NULL, double *estFactor = NULL);

238
    /// Adds an operator to \ref A.
239
240
    void addMatrixOperator(Operator &op, int i, int j,
			   double *factor = NULL, double *estFactor = NULL);
241

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

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

250
251
    /// Adds a Dirichlet boundary condition, where the rhs is given by an 
    /// abstract function.
252
    virtual void addDirichletBC(BoundaryType type, int row, int col,
253
254
				AbstractFunction<double, WorldVector<double> > *b);

255
256
    /// Adds a Dirichlet boundary condition, where the rhs is given by a DOF
    /// vector.
257
258
259
    virtual void addDirichletBC(BoundaryType type, int row, int col,
				DOFVector<double> *vec);

260
261
    /// Adds a Neumann boundary condition, where the rhs is given by an
    /// abstract function.
262
263
264
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      AbstractFunction<double, WorldVector<double> > *n);

265
266
267
268
269
270
    /// Adds a Neumann boundary condition, where the rhs is given by an DOF
    /// vector.
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      DOFVector<double> *n);

    /// Adds Robin boundary condition.
271
272
273
274
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    AbstractFunction<double, WorldVector<double> > *n,
			    AbstractFunction<double, WorldVector<double> > *r);

275
276
277
278
279
280
281
282
283
284
    /// Adds Robin boundary condition.
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    DOFVector<double> *n,
			    DOFVector<double> *r);

    /// Adds Robin boundary condition.
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    Operator *n,
			    Operator *r);

285
    /// Adds a periodic boundary condition.
286
287
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

Thomas Witkowski's avatar
Thomas Witkowski committed
288
289
290
291
    /** \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
292
293
    void assembleOnOneMesh(FiniteElemSpace *feSpace, 
			   Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
294
295
			   DOFMatrix *matrix, DOFVector<double> *vector);

Thomas Witkowski's avatar
Thomas Witkowski committed
296
297

    ///
298
299
300
301
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
302
303
304
305
306
  
    /** \name getting methods
     * \{ 
     */

Thomas Witkowski's avatar
Thomas Witkowski committed
307
    /// Returns \ref solution.
308
309
    inline SystemVector* getSolution() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
310
311
      return solution; 
    }
312

313
314
315
316
317
    inline const DOFVector<double>* getSolutionVector(int i = 0)
    {
      return solution->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
318
    /// Returns \ref rhs.
319
    inline SystemVector* getRhs() 
320
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
321
322
      return rhs; 
    }
323

324
325
326
327
328
    inline const DOFVector<double>* getRhsVector(int i = 0)
    {
      return rhs->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
329
    /// Returns \ref systemMatrix.
330
331
    inline Matrix<DOFMatrix*> *getSystemMatrix() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
332
333
      return systemMatrix; 
    }
334

Thomas Witkowski's avatar
Thomas Witkowski committed
335
    /// Returns a pointer to the corresponding DOFMatrix.
336
337
    inline DOFMatrix* getSystemMatrix(int row, int col) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
338
339
340
341
      return (*systemMatrix)[row][col];
    }

    /// Returns mesh of given component
342
    inline Mesh* getMesh(int comp = 0) 
343
    {
344
      FUNCNAME("ProblemVec::getMesh()");
Thomas Witkowski's avatar
Thomas Witkowski committed
345
      TEST_EXIT(comp < static_cast<int>(componentMeshes.size()) && comp >= 0)
346
	("invalid component number\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
347
      return componentMeshes[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
348
    }
349

Thomas Witkowski's avatar
Thomas Witkowski committed
350
    /// Returns \ref meshes
351
    inline vector<Mesh*> getMeshes() 
352
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
353
354
      return meshes; 
    }
355

Thomas Witkowski's avatar
Thomas Witkowski committed
356
    /// Returns \ref feSpace_.
357
    inline FiniteElemSpace* getFeSpace(int comp = 0) 
358
    { 
359
      FUNCNAME("ProblemVec::getFeSpace()");
360
      TEST_EXIT(comp < static_cast<int>(componentSpaces.size()) && comp >= 0)
361
	("invalid component number\n");
362
      return componentSpaces[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
363
    }
364

Thomas Witkowski's avatar
Thomas Witkowski committed
365
    /// Returns \ref feSpaces.
366
    inline vector<FiniteElemSpace*> getFeSpaces() 
367
    { 
368
      return feSpaces; 
Thomas Witkowski's avatar
Thomas Witkowski committed
369
    }
370

Thomas Witkowski's avatar
Thomas Witkowski committed
371
    /// Returns \ref componentSpaces;
372
    inline vector<FiniteElemSpace*> getComponentFeSpaces() 
373
    {
374
      return componentSpaces;
375
376
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
377
    /// Returns \ref estimator.
378
    inline vector<Estimator*> getEstimators() 
379
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
380
381
      return estimator; 
    }
382

Thomas Witkowski's avatar
Thomas Witkowski committed
383
    /// Returns \ref estimator.
384
    inline Estimator* getEstimator(int comp = 0) 
385
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
386
387
      return estimator[comp]; 
    }
388

Thomas Witkowski's avatar
Thomas Witkowski committed
389
    /// Returns \ref refinementManager.
390
    inline RefinementManager* getRefinementManager(int comp = 0) 
391
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
392
393
      return refinementManager; 
    }
394

Thomas Witkowski's avatar
Thomas Witkowski committed
395
    /// Returns \ref refinementManager.
396
    inline CoarseningManager* getCoarseningManager(int comp = 0) 
397
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
398
399
      return coarseningManager; 
    }
400

Thomas Witkowski's avatar
Thomas Witkowski committed
401
    /// Returns \ref solver.
402
403
    inline OEMSolver* getSolver() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
404
405
      return solver; 
    }
406

Thomas Witkowski's avatar
Thomas Witkowski committed
407
    /// Returns \ref marker.
408
    inline Marker *getMarker(int comp = 0) 
409
    { 
410
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
411
    }
412

Thomas Witkowski's avatar
Thomas Witkowski committed
413
    /// Returns \ref marker.
414
    inline vector<Marker*> getMarkers() 
415
    { 
416
      return marker; 
Thomas Witkowski's avatar
Thomas Witkowski committed
417
    }
418

Thomas Witkowski's avatar
Thomas Witkowski committed
419
    /// Returns the name of the problem
420
    inline virtual string getName() 
421
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
422
423
      return name; 
    }
424

Thomas Witkowski's avatar
Thomas Witkowski committed
425
    /// Returns \ref useGetBound.
426
427
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
428
429
      return useGetBound; 
    }
430

431
432
433
434
435
436
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

437
438
439
440
441
442
    /// Returns \ref deserialized;
    bool isDeserialized()
    {
      return deserialized;
    }

443
444
445
446
447
448
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
449
    /// Sets \ref estimator.
450
    inline void setEstimator(vector<Estimator*> est) 
451
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
452
453
      estimator = est; 
    }
454

Thomas Witkowski's avatar
Thomas Witkowski committed
455
    /// Sets the FE space for the given component.
456
    inline void setFeSpace(FiniteElemSpace *feSpace, int comp = 0) 
457
    {
458
      feSpaces[comp] = feSpace;
Thomas Witkowski's avatar
Thomas Witkowski committed
459
    }
460

Thomas Witkowski's avatar
Thomas Witkowski committed
461
    /// Sets \ref estimator.
462
    inline void setEstimator(Estimator* est, int comp = 0) 
463
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
464
465
      estimator[comp] = est; 
    }
466

Thomas Witkowski's avatar
Thomas Witkowski committed
467
    /// Sets \ref marker.
468
    inline void setMarker(Marker* mark, int comp = 0) 
469
    { 
470
      marker[comp] = mark; 
Thomas Witkowski's avatar
Thomas Witkowski committed
471
    }
472

Thomas Witkowski's avatar
Thomas Witkowski committed
473
    /// Sets \ref solver.
474
475
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
476
477
      solver = sol; 
    }
478

Thomas Witkowski's avatar
Thomas Witkowski committed
479
    ///
480
    inline void setAssembleMatrixOnlyOnce(int i = 0, int j = 0, bool value = true) 
481
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
482
      assembleMatrixOnlyOnce[i][j] = value;
483
484
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
485
    ///
486
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
487
488
			     int component) 
    {
489
490
491
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
492
    ///
493
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int i = 0) 
494
    {
495
      return exactSolutionFcts[i];
496
497
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
498
    ///
499
500
    void setComputeExactError(bool v) 
    {
501
502
503
      computeExactError = v;
    }

504
505
506
507
508
509
    /// Sets \ref writeAsmInfo;
    void setWriteAsmInfo(bool b)
    {
      writeAsmInfo = b;
    }

510
511
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
512
513
514
515
    /** \brief
     * Outputs the mesh of the given component, but the values are taken from the 
     * residual error estimator. 
     */
516
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, string name);
517

Thomas Witkowski's avatar
Thomas Witkowski committed
518
    /// Function that implements the serialization procedure.
519
    virtual void serialize(ostream &out);
520

Thomas Witkowski's avatar
Thomas Witkowski committed
521
    /// Function that implements the deserialization procedure.
522
    virtual void deserialize(istream &in);
523

Thomas Witkowski's avatar
Thomas Witkowski committed
524
525

    /// Returns \ref fileWriters.
526
    vector<FileWriterInterface*>& getFileWriterList() 
527
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
528
529
      return fileWriters;
    }
530

Thomas Witkowski's avatar
Thomas Witkowski committed
531
532
533
534
535
536
537
  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);

538
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
539
540
    
    /// Name of this problem.
541
    string name;
542

Thomas Witkowski's avatar
Thomas Witkowski committed
543
    /// Number of problem components
544
    int nComponents;
545
546

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
547
548
549
     * 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.
550
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
551
552
553
    int nMeshes;

    /// FE spaces of this problem.
554
    vector<FiniteElemSpace*> feSpaces;
555

Thomas Witkowski's avatar
Thomas Witkowski committed
556
    /// Meshes of this problem.
557
    vector<Mesh*> meshes;
558

Thomas Witkowski's avatar
Thomas Witkowski committed
559
    /// Pointer to the fe spaces for the different problem components
560
    vector<FiniteElemSpace*> componentSpaces;
561

Thomas Witkowski's avatar
Thomas Witkowski committed
562
    /// Pointer to the meshes for the different problem components
563
    vector<Mesh*> componentMeshes;
564
565

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
566
567
568
     * 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.
569
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
570
571
572
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
573
    vector<Marker*> marker;
574

Thomas Witkowski's avatar
Thomas Witkowski committed
575
    /// Estimator of this problem. Used in \ref estimate().
576
    vector<Estimator*> estimator;
577

Thomas Witkowski's avatar
Thomas Witkowski committed
578
    /// Linear solver of this problem. Used in \ref solve().
579
    OEMSolver *solver;
580

Thomas Witkowski's avatar
Thomas Witkowski committed
581
582
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
583

Thomas Witkowski's avatar
Thomas Witkowski committed
584
585
    /// System vector for the right hand side 
    SystemVector *rhs;
586

Thomas Witkowski's avatar
Thomas Witkowski committed
587
588
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
589

590
591
592
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

593
594
595
596
597
598
599
    /** \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.
     */
600
    vector<vector<bool> > assembleMatrixOnlyOnce;
601
602
603

    /** \brief
     * If [i][j] of this field is set to true, the corresponding DOFMatrix of
Thomas Witkowski's avatar
Thomas Witkowski committed
604
     * the systemMatrix has been assembled at least once. This field is used
605
606
607
     * to determine, if assembling of a matrix can be ommitted, if it is set
     * to be assembled only once.
     */
608
    vector<vector<bool> > assembledMatrix;
609

Thomas Witkowski's avatar
Thomas Witkowski committed
610
611
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
612

Thomas Witkowski's avatar
Thomas Witkowski committed
613
    /// Writes the meshes and solution after the adaption loop.
614
    vector<FileWriterInterface*> fileWriters;
615
616
617
618
619
620

    /** \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
621
    RefinementManager *refinementManager;
622
623
624
625
626
627

    /** \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
628
    CoarseningManager *coarseningManager;
629
  
Thomas Witkowski's avatar
Thomas Witkowski committed
630
631
    /// Info level.
    int info;
632

633
634
635
    /// If true, the stationary problem was deserialized from some serialization file.
    bool deserialized;

636
637
638
639
640
    /** \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.
     */
641
    vector<AbstractFunction<double, WorldVector<double> >*> exactSolutionFcts;
642
643
644
645
646
647

    /** \brief
     * If true, the error is not estimated but computed from the exact solution
     * defined by \ref exactSolutionFcts.
     */
    bool computeExactError;
648
649
650
651
652
653
654
    
    /** \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;
655

656
657
    /// If true, AMDiS prints information about the assembling procedure to the screen.
    bool writeAsmInfo;
658

659
    map<Operator*, vector<OperatorPos> > operators;
660

661
    map<Operator*, Flag> opFlags;
662
663
664
665
  };
}

#endif