Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer, es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Die Konto der externen Nutzer:innen sind über den Reiter "Standard" erreichbar. Die Administratoren

Dear Gitlab user, it is now possible to log in to our service using the ZIH login/LDAP. The accounts of external users can be accessed via the "Standard" tab. The administrators

ProblemStat.h 18.5 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 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 54 55 56 57
  /** \brief
   * This class defines the stationary problem definition in sequential
   * computations. For parallel computations, see 
   * \ref ParallelProblemStatBase.
   */
  class ProblemStatSeq : public ProblemStatBase,
			 public StandardProblemIteration
58
  {
59
  protected:
60
    // Defines a mapping type from dof indices to world coordinates.
61
    typedef map<DegreeOfFreedom, WorldVector<double> > DofToCoord;
62 63

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
91 92
      assembleMatrixOnlyOnce.resize(nComponents);
      assembledMatrix.resize(nComponents);
93
      for (int i = 0; i < nComponents; i++) {
Thomas Witkowski's avatar
Thomas Witkowski committed
94 95
	assembleMatrixOnlyOnce[i].resize(nComponents);
	assembledMatrix[i].resize(nComponents);
96
	for (int j = 0; j < nComponents; j++) {
Thomas Witkowski's avatar
Thomas Witkowski committed
97 98
	  assembleMatrixOnlyOnce[i][j] = false;
	  assembledMatrix[i][j] = false;
99 100
	}
      }
101 102

      exactSolutionFcts.resize(nComponents);
Thomas Witkowski's avatar
Thomas Witkowski committed
103
    }
104

Thomas Witkowski's avatar
Thomas Witkowski committed
105
    /// Destructor
106
    virtual ~ProblemStatSeq() {}
107

Thomas Witkowski's avatar
Thomas Witkowski committed
108
    /// Initialisation of the problem.
109
    virtual void initialize(Flag initFlag,
110
			    ProblemStatSeq *adoptProblem = NULL,
111 112
			    Flag adoptFlag = INIT_NOTHING);

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

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

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

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
131
    /// Used in \ref initialize().
132 133
    virtual void createFileWriter();

134 135 136 137
    /** \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.
     */
138 139 140 141 142 143
    virtual void doOtherStuff();

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

    /** \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
174
    virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
175 176 177 178 179

    /** \brief
     * Implementation of ProblemStatBase::buildBeforeCoarsen().
     * Does nothing here.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
180
    virtual void buildBeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
181 182 183

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

191 192
    void buildAfterCoarsen_sebastianMode(AdaptInfo *adaptInfo, Flag flag);

193 194
    bool dualMeshTraverseRequired();

195 196
    void dualAssemble(AdaptInfo *adaptInfo, Flag flag, 
		      bool asmMatrix = true, bool asmVector = true);
197

198 199 200
    void createPrecon();


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

Thomas Witkowski's avatar
Thomas Witkowski committed
214
    /// Implementation of ProblemStatBase::getNumComponents()
215 216
    virtual int getNumComponents() 
    { 
217
      return nComponents; 
Thomas Witkowski's avatar
Thomas Witkowski committed
218
    }
219 220 221 222 223

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

229
    /// Writes output files. TODO: Make obsolete.
230 231
    void writeFiles(AdaptInfo *adaptInfo, bool force);

232 233 234
    /// Writes output files.
    void writeFiles(AdaptInfo &adaptInfo, bool force);

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

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

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

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

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

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

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

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

269 270 271 272 273 274
    /// 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.
275 276 277 278
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    AbstractFunction<double, WorldVector<double> > *n,
			    AbstractFunction<double, WorldVector<double> > *r);

279 280 281 282 283 284 285 286 287 288
    /// 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);

289
    /// Adds a periodic boundary condition.
290 291
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

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

Thomas Witkowski's avatar
Thomas Witkowski committed
300 301

    ///
302 303 304 305
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
306 307 308 309 310
  
    /** \name getting methods
     * \{ 
     */

Thomas Witkowski's avatar
Thomas Witkowski committed
311
    /// Returns \ref solution.
312 313
    inline SystemVector* getSolution() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
314 315
      return solution; 
    }
316

317
    inline DOFVector<double>* getSolution(int i)
318 319 320 321
    {
      return solution->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
322
    /// Returns \ref rhs.
323
    inline SystemVector* getRhs() 
324
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
325 326
      return rhs; 
    }
327

328 329 330 331 332
    inline const DOFVector<double>* getRhsVector(int i = 0)
    {
      return rhs->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
333
    /// Returns \ref systemMatrix.
334 335
    inline Matrix<DOFMatrix*> *getSystemMatrix() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
336 337
      return systemMatrix; 
    }
338

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
354
    /// Returns \ref meshes
355
    inline vector<Mesh*> getMeshes() 
356
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
357 358
      return meshes; 
    }
359

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
375
    /// Returns \ref componentSpaces;
376
    inline vector<FiniteElemSpace*> getComponentFeSpaces() 
377
    {
378
      return componentSpaces;
379 380
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
381
    /// Returns \ref estimator.
382
    inline vector<Estimator*> getEstimators() 
383
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
384 385
      return estimator; 
    }
386

Thomas Witkowski's avatar
Thomas Witkowski committed
387
    /// Returns \ref estimator.
388
    inline Estimator* getEstimator(int comp = 0) 
389
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
390 391
      return estimator[comp]; 
    }
392

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

Thomas Witkowski's avatar
Thomas Witkowski committed
399
    /// Returns \ref refinementManager.
400
    inline CoarseningManager* getCoarseningManager(int comp = 0) 
401
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
402 403
      return coarseningManager; 
    }
404

Thomas Witkowski's avatar
Thomas Witkowski committed
405
    /// Returns \ref solver.
406 407
    inline OEMSolver* getSolver() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
408 409
      return solver; 
    }
410

Thomas Witkowski's avatar
Thomas Witkowski committed
411
    /// Returns \ref marker.
412
    inline Marker *getMarker(int comp = 0) 
413
    { 
414
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
415
    }
416

Thomas Witkowski's avatar
Thomas Witkowski committed
417
    /// Returns \ref marker.
418
    inline vector<Marker*> getMarkers() 
419
    { 
420
      return marker; 
Thomas Witkowski's avatar
Thomas Witkowski committed
421
    }
422

Thomas Witkowski's avatar
Thomas Witkowski committed
423
    /// Returns the name of the problem
424
    inline virtual string getName() 
425
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
426 427
      return name; 
    }
428

Thomas Witkowski's avatar
Thomas Witkowski committed
429
    /// Returns \ref useGetBound.
430 431
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
432 433
      return useGetBound; 
    }
434

435 436 437 438 439 440
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

441 442 443 444 445 446
    /// Returns \ref deserialized;
    bool isDeserialized()
    {
      return deserialized;
    }

447 448 449 450 451 452
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
453
    /// Sets \ref estimator.
454
    inline void setEstimator(vector<Estimator*> est) 
455
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
456 457
      estimator = est; 
    }
458

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
477
    /// Sets \ref solver.
478 479
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
480 481
      solver = sol; 
    }
482

Thomas Witkowski's avatar
Thomas Witkowski committed
483
    ///
484
    inline void setAssembleMatrixOnlyOnce(int i = 0, int j = 0, bool value = true) 
485
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
486
      assembleMatrixOnlyOnce[i][j] = value;
487 488
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
489
    ///
490
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
491 492
			     int component) 
    {
493 494 495
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
496
    ///
497
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int i = 0) 
498
    {
499
      return exactSolutionFcts[i];
500 501
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
502
    ///
503 504
    void setComputeExactError(bool v) 
    {
505 506 507
      computeExactError = v;
    }

508 509 510 511 512 513
    /// Sets \ref writeAsmInfo;
    void setWriteAsmInfo(bool b)
    {
      writeAsmInfo = b;
    }

514 515
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
522
    /// Function that implements the serialization procedure.
523
    virtual void serialize(ostream &out);
524

Thomas Witkowski's avatar
Thomas Witkowski committed
525
    /// Function that implements the deserialization procedure.
526
    virtual void deserialize(istream &in);
527

Thomas Witkowski's avatar
Thomas Witkowski committed
528 529

    /// Returns \ref fileWriters.
530
    vector<FileWriterInterface*>& getFileWriterList() 
531
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
532 533
      return fileWriters;
    }
534

Thomas Witkowski's avatar
Thomas Witkowski committed
535 536 537 538 539 540 541
  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);

542
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
543 544
    
    /// Name of this problem.
545
    string name;
546

Thomas Witkowski's avatar
Thomas Witkowski committed
547
    /// Number of problem components
548
    int nComponents;
549 550

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
551 552 553
     * 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.
554
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
555 556 557
    int nMeshes;

    /// FE spaces of this problem.
558
    vector<FiniteElemSpace*> feSpaces;
559

Thomas Witkowski's avatar
Thomas Witkowski committed
560
    /// Meshes of this problem.
561
    vector<Mesh*> meshes;
562

Thomas Witkowski's avatar
Thomas Witkowski committed
563
    /// Pointer to the fe spaces for the different problem components
564
    vector<FiniteElemSpace*> componentSpaces;
565

Thomas Witkowski's avatar
Thomas Witkowski committed
566
    /// Pointer to the meshes for the different problem components
567
    vector<Mesh*> componentMeshes;
568 569

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
582
    /// Linear solver of this problem. Used in \ref solve().
583
    OEMSolver *solver;
584

Thomas Witkowski's avatar
Thomas Witkowski committed
585 586
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
587

Thomas Witkowski's avatar
Thomas Witkowski committed
588 589
    /// System vector for the right hand side 
    SystemVector *rhs;
590

Thomas Witkowski's avatar
Thomas Witkowski committed
591 592
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
593

594 595 596
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

597 598 599 600 601 602 603
    /** \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.
     */
604
    vector<vector<bool> > assembleMatrixOnlyOnce;
605 606 607

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

Thomas Witkowski's avatar
Thomas Witkowski committed
614 615
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
616

Thomas Witkowski's avatar
Thomas Witkowski committed
617
    /// Writes the meshes and solution after the adaption loop.
618
    vector<FileWriterInterface*> fileWriters;
619 620 621 622 623 624

    /** \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
625
    RefinementManager *refinementManager;
626 627 628 629 630 631

    /** \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
632
    CoarseningManager *coarseningManager;
633
  
Thomas Witkowski's avatar
Thomas Witkowski committed
634 635
    /// Info level.
    int info;
636

637 638 639
    /// If true, the stationary problem was deserialized from some serialization file.
    bool deserialized;

640 641 642 643 644
    /** \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.
     */
645
    vector<AbstractFunction<double, WorldVector<double> >*> exactSolutionFcts;
646 647 648 649 650 651

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

660 661
    /// If true, AMDiS prints information about the assembling procedure to the screen.
    bool writeAsmInfo;
662

663
    map<Operator*, vector<OperatorPos> > operators;
664

665
    map<Operator*, Flag> opFlags;
666
  };
667 668 669 670

#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
  typedef ProblemStatSeq ProblemStat;
#endif
671 672 673
}

#endif