ProblemVec.h 18.4 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
44
45
46
47
48
  struct OperatorPos 
  {
    int row, col;
    double *factor, *estFactor;
    Flag operatorType;
  };

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

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

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

      exactSolutionFcts.resize(nComponents);
Thomas Witkowski's avatar
Thomas Witkowski committed
96
    }
97

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

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


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

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

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

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

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

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

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

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

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

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

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

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

185
186
    void buildAfterCoarsen_sebastianMode(AdaptInfo *adaptInfo, Flag flag);

187
188
    bool dualMeshTraverseRequired();

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

192
193
194
    void createPrecon();


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

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

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

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

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

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

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

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

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

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

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

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

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

263
264
265
266
267
268
    /// 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.
269
270
271
272
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    AbstractFunction<double, WorldVector<double> > *n,
			    AbstractFunction<double, WorldVector<double> > *r);

273
274
275
276
277
278
279
280
281
282
    /// 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);

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
294
295

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

441
442
443
444
445
446
    /** \} */

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

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

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

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

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

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

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

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

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

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

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

508
509
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
510
511
512
513
    /** \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
514
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, std::string name);
515

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
522
523

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

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

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

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
554
555
    /// Meshes of this problem.
    std::vector<Mesh*> meshes;
556

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

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

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

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

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

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

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

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

588
589
590
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

591
592
593
594
595
596
597
    /** \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
598
    std::vector< std::vector< bool > > assembleMatrixOnlyOnce;
599
600
601

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

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

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

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

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

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

634
635
636
637
638
639
640
641
642
643
644
645
    /** \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;
646
647
648
649
650
651
652
    
    /** \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;
653

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

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

    std::map<Operator*, Flag> opFlags;
660
661
662
663
  };
}

#endif