ProblemStat.h 19.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
/** \file ProblemStat.h */
22

23
24
#ifndef AMDIS_PROBLEM_STAT_H
#define AMDIS_PROBLEM_STAT_H
25

Thomas Witkowski's avatar
Thomas Witkowski committed
26
27
#include <vector>
#include <list>
28
#include "AMDiS_fwd.h"
29
#include "ProblemStatBase.h"
30
#include "Initfile.h"
31
32
33
#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
54
55
56
57
58
  /** \brief
   * This class defines the stationary problem definition in sequential
   * computations. For parallel computations, see 
   * \ref ParallelProblemStatBase.
   */
  class ProblemStatSeq : public ProblemStatBase,
			 public StandardProblemIteration
59
  {
60
  protected:
61
    // Defines a mapping type from dof indices to world coordinates.
62
    typedef map<DegreeOfFreedom, WorldVector<double> > DofToCoord;
63
64

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

67
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
68
    /// Constructor
69
    ProblemStatSeq(string nameStr,
70
		   ProblemIterationInterface *problemIteration = NULL);
71

Thomas Witkowski's avatar
Thomas Witkowski committed
72
    /// Destructor
73
    virtual ~ProblemStatSeq() {}
74

Thomas Witkowski's avatar
Thomas Witkowski committed
75
    /// Initialisation of the problem.
76
    virtual void initialize(Flag initFlag,
77
			    ProblemStatSeq *adoptProblem = NULL,
78
79
			    Flag adoptFlag = INIT_NOTHING);

Thomas Witkowski's avatar
Thomas Witkowski committed
80
    /// Used in \ref initialize().
81
82
    virtual void createMesh();

83
84
85
    /// Used in \ref initialize().
    virtual void createRefCoarseManager();

Thomas Witkowski's avatar
Thomas Witkowski committed
86
    /// Used in \ref initialize().
87
    virtual void createFeSpace(DOFAdmin *admin);
88

Thomas Witkowski's avatar
Thomas Witkowski committed
89
    /// Used in \ref initialize().
90
91
    virtual void createMatricesAndVectors();

Thomas Witkowski's avatar
Thomas Witkowski committed
92
    /// Used in \ref initialize().
93
94
    virtual void createSolver();

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

Thomas Witkowski's avatar
Thomas Witkowski committed
98
    /// Used in \ref initialize().
99
100
    virtual void createMarker();

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

104
105
    /// 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.
106
107
    virtual void doOtherStuff();

108
109
    /// Implementation of ProblemStatBase::solve(). Deligates the solving
    /// of problems system to \ref solver.
110
111
112
    void solve(AdaptInfo *adaptInfo,
	       bool createMatrixData = true,
	       bool storeMatrixData = false);
113

114
115
    /// Implementation of ProblemStatBase::estimate(). Deligates the estimation
    /// to \ref estimator.
116
117
    virtual void estimate(AdaptInfo *adaptInfo);

118
119
    /// Implementation of ProblemStatBase::markElements().
    /// Deligated to \ref adapt.
120
121
    virtual Flag markElements(AdaptInfo *adaptInfo);

122
123
    /// Implementation of ProblemStatBase::refineMesh(). Deligated to the
    /// RefinementManager of \ref adapt.
124
125
    virtual Flag refineMesh(AdaptInfo *adaptInfo);

126
127
    /// Implementation of ProblemStatBase::coarsenMesh(). Deligated to the
    /// CoarseningManager of \ref adapt.
128
129
    virtual Flag coarsenMesh(AdaptInfo *adaptInfo);

130
131
    /// Implementation of ProblemStatBase::buildBeforeRefine().
    /// Does nothing here.
Thomas Witkowski's avatar
Thomas Witkowski committed
132
    virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
133

134
135
    /// Implementation of ProblemStatBase::buildBeforeCoarsen().
    /// Does nothing here.
Thomas Witkowski's avatar
Thomas Witkowski committed
136
    virtual void buildBeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
137

138
139
140
    /// Implementation of ProblemStatBase::buildAfterCoarsen().
    /// Assembles \ref A and \ref rhs. With the last two parameters, assembling
    /// can be restricted to matrices or vectors only.
141
142
143
    virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
				   bool assembleMatrix = true,
				   bool assembleVector = true);
144

145
146
    void buildAfterCoarsen_sebastianMode(AdaptInfo *adaptInfo, Flag flag);

147
148
    bool dualMeshTraverseRequired();

149
150
    void dualAssemble(AdaptInfo *adaptInfo, Flag flag, 
		      bool asmMatrix = true, bool asmVector = true);
151

152
153
154
155
156
157
158
    /** \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
159
    /// Returns number of managed problems
160
161
    virtual int getNumProblems() 
    { 
162
      return 1; 
Thomas Witkowski's avatar
Thomas Witkowski committed
163
    }
164

Thomas Witkowski's avatar
Thomas Witkowski committed
165
    /// Implementation of ProblemStatBase::getNumComponents()
166
167
    virtual int getNumComponents() 
    { 
168
      return nComponents; 
Thomas Witkowski's avatar
Thomas Witkowski committed
169
    }
170
171
172
173
174

    /** \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.
     */
175
176
    virtual ProblemStatBase *getProblem(int number = 0) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
177
      return this; 
Thomas Witkowski's avatar
Thomas Witkowski committed
178
    }
179

180
    /// Writes output files. TODO: Make obsolete.
181
182
    void writeFiles(AdaptInfo *adaptInfo, bool force);

183
184
185
    /// Writes output files.
    void writeFiles(AdaptInfo &adaptInfo, bool force);

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

189
    /// Adds an operator to \ref A.
190
    void addMatrixOperator(Operator *op, int i, int j,
191
192
			   double *factor = NULL, double *estFactor = NULL);

193
    /// Adds an operator to \ref A.
194
195
    void addMatrixOperator(Operator &op, int i, int j,
			   double *factor = NULL, double *estFactor = NULL);
196

197
    /// Adds an operator to \ref rhs.
198
    void addVectorOperator(Operator *op, int i,
199
200
			   double *factor = NULL, double *estFactor = NULL);

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

205
206
    /// Adds a Dirichlet boundary condition, where the rhs is given by an 
    /// abstract function.
207
    virtual void addDirichletBC(BoundaryType type, int row, int col,
208
209
				AbstractFunction<double, WorldVector<double> > *b);

210
211
    /// Adds a Dirichlet boundary condition, where the rhs is given by a DOF
    /// vector.
212
213
214
    virtual void addDirichletBC(BoundaryType type, int row, int col,
				DOFVector<double> *vec);

215
216
    /// Adds a Neumann boundary condition, where the rhs is given by an
    /// abstract function.
217
218
219
    virtual void addNeumannBC(BoundaryType type, int row, int col, 
			      AbstractFunction<double, WorldVector<double> > *n);

220
221
222
223
224
225
    /// 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.
226
227
228
229
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    AbstractFunction<double, WorldVector<double> > *n,
			    AbstractFunction<double, WorldVector<double> > *r);

230
231
232
233
234
235
236
237
238
239
    /// 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);

240
    /// Adds a periodic boundary condition.
241
242
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
    /// add boundary operator to matrix side
    virtual void addBoundaryMatrixOperator(BoundaryType type, 
          Operator *op, int row, int col);

    virtual void addBoundaryMatrixOperator(BoundaryType type, 
          Operator &op, int row, int col)
    {
      addBoundaryMatrixOperator(type, &op, row, col);
    }

    /// add boundary operator to rhs (vector) side
    virtual void addBoundaryVectorOperator(BoundaryType type, 
          Operator *op, int row);

    virtual void addBoundaryVectorOperator(BoundaryType type, 
          Operator &op, int row)
    {
      addBoundaryVectorOperator(type, &op, row);
    }

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
    inline DOFVector<double>* getSolution(int i)
289
290
291
292
    {
      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
    inline DOFVector<double>* getRhsVector(int i = 0)
300
301
302
303
    {
      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("ProblemStatSeq::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
    inline vector<Mesh*> getMeshes() 
327
    {
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("ProblemStatSeq::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 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 vector<FiniteElemSpace*> getComponentFeSpaces() 
348
    {
349
      return componentSpaces;
350
351
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
352
    /// Returns \ref estimator.
353
    inline 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 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
395
    inline virtual 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
    /// Returns \ref deserialized;
    bool isDeserialized()
    {
      return deserialized;
    }

418
419
420
421
422
423
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
424
    /// Sets \ref estimator.
425
    inline void setEstimator(vector<Estimator*> est) 
426
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
427
428
      estimator = est; 
    }
429

Thomas Witkowski's avatar
Thomas Witkowski committed
430
    /// Sets the FE space for the given component.
431
    inline void setFeSpace(FiniteElemSpace *feSpace, int comp = 0) 
432
    {
433
      feSpaces[comp] = feSpace;
Thomas Witkowski's avatar
Thomas Witkowski committed
434
    }
435

436
437
438
439
440
441
442
443
444
445
    void setComponentSpace(int comp, FiniteElemSpace *feSpace)
    {
      if (static_cast<int>(componentSpaces.size()) < nComponents)
        componentSpaces.resize(nComponents);
      TEST_EXIT(comp >= 0 && comp < nComponents)
        ("Component number not in feasable range!");

      componentSpaces[comp] = feSpace;
    }
    
Thomas Witkowski's avatar
Thomas Witkowski committed
446
    /// Sets \ref estimator.
447
    inline void setEstimator(Estimator* est, int comp = 0) 
448
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
449
450
      estimator[comp] = est; 
    }
451

Thomas Witkowski's avatar
Thomas Witkowski committed
452
    /// Sets \ref marker.
453
    inline void setMarker(Marker* mark, int comp = 0) 
454
    { 
455
      marker[comp] = mark; 
Thomas Witkowski's avatar
Thomas Witkowski committed
456
    }
457

Thomas Witkowski's avatar
Thomas Witkowski committed
458
    /// Sets \ref solver.
459
460
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
461
462
      solver = sol; 
    }
463

Thomas Witkowski's avatar
Thomas Witkowski committed
464
    ///
465
    inline void setAssembleMatrixOnlyOnce(int i = 0, int j = 0, bool value = true) 
466
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
467
      assembleMatrixOnlyOnce[i][j] = value;
468
469
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
470
    ///
471
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
472
473
			     int component) 
    {
474
475
476
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
477
    ///
478
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int i = 0) 
479
    {
480
      return exactSolutionFcts[i];
481
482
    }

483
484
485
486
487
488
    ///
    vector< AbstractFunction<double, WorldVector<double> >* > getExactSolutionFcts() 
    {
      return exactSolutionFcts;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
489
    ///
490
491
    void setComputeExactError(bool v) 
    {
492
493
494
      computeExactError = v;
    }

495
496
497
498
499
500
    /// Sets \ref writeAsmInfo;
    void setWriteAsmInfo(bool b)
    {
      writeAsmInfo = b;
    }

501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
    void setMeshes(vector<Mesh*> meshes_)
    {
      meshes = meshes_;
      nMeshes = static_cast<int>(meshes.size());
    }

    void setComponentMesh(int comp, Mesh* mesh)
    {
      if (static_cast<int>(componentMeshes.size()) < nComponents)
        componentMeshes.resize(nComponents);
      TEST_EXIT(comp >= 0 && comp < nComponents)
        ("Component number not in feasable range!");

      componentMeshes[comp] = mesh;
    }

    void setRefinementManager(RefinementManager *ref)
    {
      refinementManager = ref;
    }

    void setCoarseningManager(CoarseningManager *coarse)
    {
      coarseningManager = coarse;
    }
526
527
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
528
529
530
531
    /** \brief
     * Outputs the mesh of the given component, but the values are taken from the 
     * residual error estimator. 
     */
532
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, string name);
533

Thomas Witkowski's avatar
Thomas Witkowski committed
534
    /// Function that implements the serialization procedure.
535
    virtual void serialize(ostream &out);
536

Thomas Witkowski's avatar
Thomas Witkowski committed
537
    /// Function that implements the deserialization procedure.
538
    virtual void deserialize(istream &in);
539

Thomas Witkowski's avatar
Thomas Witkowski committed
540
541

    /// Returns \ref fileWriters.
542
    vector<FileWriterInterface*>& getFileWriterList() 
543
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
544
545
      return fileWriters;
    }
546

Thomas Witkowski's avatar
Thomas Witkowski committed
547
548
549
550
551
552
553
  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);

554
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
555
556
    
    /// Name of this problem.
557
    string name;
558

Thomas Witkowski's avatar
Thomas Witkowski committed
559
    /// Number of problem components
560
    int nComponents;
561

562
563
564
565
    /// Stores the names for all components. Is used for naming the solution
    /// vectors, \ref solution.
    vector<string> componentNames;

566
    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
567
568
569
     * 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.
570
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
571
572
573
    int nMeshes;

    /// FE spaces of this problem.
574
    vector<FiniteElemSpace*> feSpaces;
575

Thomas Witkowski's avatar
Thomas Witkowski committed
576
    /// Meshes of this problem.
577
    vector<Mesh*> meshes;
578

Thomas Witkowski's avatar
Thomas Witkowski committed
579
    /// Pointer to the fe spaces for the different problem components
580
    vector<FiniteElemSpace*> componentSpaces;
581

Thomas Witkowski's avatar
Thomas Witkowski committed
582
    /// Pointer to the meshes for the different problem components
583
    vector<Mesh*> componentMeshes;
584
585

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
586
587
588
     * 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.
589
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
590
591
592
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
593
    vector<Marker*> marker;
594

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

Thomas Witkowski's avatar
Thomas Witkowski committed
598
    /// Linear solver of this problem. Used in \ref solve().
599
    OEMSolver *solver;
600

Thomas Witkowski's avatar
Thomas Witkowski committed
601
602
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
603

Thomas Witkowski's avatar
Thomas Witkowski committed
604
605
    /// System vector for the right hand side 
    SystemVector *rhs;
606

Thomas Witkowski's avatar
Thomas Witkowski committed
607
608
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
609

610
611
612
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

613
614
615
616
617
618
619
    /** \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.
     */
620
    vector<vector<bool> > assembleMatrixOnlyOnce;
621
622
623

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

Thomas Witkowski's avatar
Thomas Witkowski committed
630
631
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
632

Thomas Witkowski's avatar
Thomas Witkowski committed
633
    /// Writes the meshes and solution after the adaption loop.
634
    vector<FileWriterInterface*> fileWriters;
635
636
637
638
639
640

    /** \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
641
    RefinementManager *refinementManager;
642
643
644
645
646
647

    /** \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
648
    CoarseningManager *coarseningManager;
649
  
Thomas Witkowski's avatar
Thomas Witkowski committed
650
651
    /// Info level.
    int info;
652

653
654
655
    /// If true, the stationary problem was deserialized from some serialization file.
    bool deserialized;

656
657
658
659
660
    /** \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.
     */
661
    vector<AbstractFunction<double, WorldVector<double> >*> exactSolutionFcts;
662
663
664
665
666
667

    /** \brief
     * If true, the error is not estimated but computed from the exact solution
     * defined by \ref exactSolutionFcts.
     */
    bool computeExactError;
668
669
670
671
672
673
674
    
    /** \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;
675

676
677
    /// If true, AMDiS prints information about the assembling procedure to the screen.
    bool writeAsmInfo;
678

679
    map<Operator*, vector<OperatorPos> > operators;
680

681
    map<Operator*, Flag> opFlags;
682
  };
683
684
685
686

#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
  typedef ProblemStatSeq ProblemStat;
#endif
687
688
689
}

#endif