ProblemVec.h 17.8 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
42
43
44

namespace AMDiS {

  class ProblemVec : public ProblemStatBase,
		     public StandardProblemIteration
  {
45
  protected:
46
47
48
49
50
51
    // 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;

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

Thomas Witkowski's avatar
Thomas Witkowski committed
77
78
      assembleMatrixOnlyOnce.resize(nComponents);
      assembledMatrix.resize(nComponents);
79
      for (int i = 0; i < nComponents; i++) {
Thomas Witkowski's avatar
Thomas Witkowski committed
80
81
	assembleMatrixOnlyOnce[i].resize(nComponents);
	assembledMatrix[i].resize(nComponents);
82
	for (int j = 0; j < nComponents; j++) {
Thomas Witkowski's avatar
Thomas Witkowski committed
83
84
	  assembleMatrixOnlyOnce[i][j] = false;
	  assembledMatrix[i][j] = false;
85
86
	}
      }
87
88

      exactSolutionFcts.resize(nComponents);
Thomas Witkowski's avatar
Thomas Witkowski committed
89
    }
90

Thomas Witkowski's avatar
Thomas Witkowski committed
91
92
    /// Destructor
    virtual ~ProblemVec() {}
93

Thomas Witkowski's avatar
Thomas Witkowski committed
94
    /// Initialisation of the problem.
95
96
97
98
99
    virtual void initialize(Flag initFlag,
			    ProblemVec *adoptProblem = NULL,
			    Flag adoptFlag = INIT_NOTHING);


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

Thomas Witkowski's avatar
Thomas Witkowski committed
103
    /// Used in \ref initialize().
104
    virtual void createFeSpace(DOFAdmin *admin);
105

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

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

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

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

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

121
122
123
124
    /** \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.
     */
125
126
127
128
129
130
    virtual void doOtherStuff();

    /** \brief
     * Implementation of ProblemStatBase::solve(). Deligates the solving
     * of problems system to \ref solver.
     */
131
    virtual void solve(AdaptInfo *adaptInfo, bool fixedMatrix = false);
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160

    /** \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
161
    virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
162
163
164
165
166

    /** \brief
     * Implementation of ProblemStatBase::buildBeforeCoarsen().
     * Does nothing here.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
167
    virtual void buildBeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
168
169
170

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

178
179
    bool dualMeshTraverseRequired();

180
181
    void dualAssemble(AdaptInfo *adaptInfo, Flag flag, 
		      bool asmMatrix = true, bool asmVector = true);
182

183
184
185
    void createPrecon();


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

Thomas Witkowski's avatar
Thomas Witkowski committed
199
    /// Implementation of ProblemStatBase::getNumComponents()
200
201
    virtual int getNumComponents() 
    { 
202
      return nComponents; 
Thomas Witkowski's avatar
Thomas Witkowski committed
203
    }
204
205
206
207
208

    /** \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.
     */
209
210
    virtual ProblemStatBase *getProblem(int number = 0) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
211
      return this; 
Thomas Witkowski's avatar
Thomas Witkowski committed
212
    }
213

214
    /// Writes output files. TODO: Make obsolete.
215
216
    void writeFiles(AdaptInfo *adaptInfo, bool force);

217
218
219
    /// Writes output files.
    void writeFiles(AdaptInfo &adaptInfo, bool force);

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

223
    /// Adds an operator to \ref A.
224
    void addMatrixOperator(Operator *op, int i, int j,
225
226
			   double *factor = NULL, double *estFactor = NULL);

227
    /// Adds an operator to \ref A.
228
229
    void addMatrixOperator(Operator &op, int i, int j,
			   double *factor = NULL, double *estFactor = NULL);
230

231
    /// Adds an operator to \ref rhs.
232
    void addVectorOperator(Operator *op, int i,
233
234
			   double *factor = NULL, double *estFactor = NULL);

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

239
240
    /// Adds a Dirichlet boundary condition, where the rhs is given by an 
    /// abstract function.
241
    virtual void addDirichletBC(BoundaryType type, int row, int col,
242
243
				AbstractFunction<double, WorldVector<double> > *b);

244
245
    /// Adds a Dirichlet boundary condition, where the rhs is given by a DOF
    /// vector.
246
247
248
    virtual void addDirichletBC(BoundaryType type, int row, int col,
				DOFVector<double> *vec);

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

254
255
256
257
258
259
    /// 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.
260
261
262
263
    virtual void addRobinBC(BoundaryType type, int row, int col, 
			    AbstractFunction<double, WorldVector<double> > *n,
			    AbstractFunction<double, WorldVector<double> > *r);

264
    /// Adds a periodic boundary condition.
265
266
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

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

Thomas Witkowski's avatar
Thomas Witkowski committed
275
276

    ///
277
278
279
280
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
281
282
283
284
285
  
    /** \name getting methods
     * \{ 
     */

Thomas Witkowski's avatar
Thomas Witkowski committed
286
    /// Returns \ref solution.
287
288
    inline SystemVector* getSolution() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
289
290
      return solution; 
    }
291

292
293
294
295
296
    inline const DOFVector<double>* getSolutionVector(int i = 0)
    {
      return solution->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
297
    /// Returns \ref rhs.
298
    inline SystemVector* getRhs() 
299
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
300
301
      return rhs; 
    }
302

303
304
305
306
307
    inline const DOFVector<double>* getRhsVector(int i = 0)
    {
      return rhs->getDOFVector(i);
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
308
    /// Returns \ref systemMatrix.
309
310
    inline Matrix<DOFMatrix*> *getSystemMatrix() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
311
312
      return systemMatrix; 
    }
313

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
329
    /// Returns \ref meshes
330
331
    inline std::vector<Mesh*> getMeshes() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
332
333
      return meshes; 
    }
334

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

Thomas Witkowski's avatar
Thomas Witkowski committed
344
    /// Returns \ref feSpaces.
345
    inline std::vector<FiniteElemSpace*> getFeSpaces() 
346
    { 
347
      return feSpaces; 
Thomas Witkowski's avatar
Thomas Witkowski committed
348
    }
349

Thomas Witkowski's avatar
Thomas Witkowski committed
350
    /// Returns \ref componentSpaces;
351
    inline std::vector<FiniteElemSpace*> getComponentFeSpaces() 
352
    {
353
      return componentSpaces;
354
355
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
356
    /// Returns \ref estimator.
357
    inline std::vector<Estimator*> getEstimators() 
358
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
359
360
      return estimator; 
    }
361

Thomas Witkowski's avatar
Thomas Witkowski committed
362
    /// Returns \ref estimator.
363
    inline Estimator* getEstimator(int comp = 0) 
364
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
365
366
      return estimator[comp]; 
    }
367

Thomas Witkowski's avatar
Thomas Witkowski committed
368
    /// Returns \ref refinementManager.
369
    inline RefinementManager* getRefinementManager(int comp = 0) 
370
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
371
372
      return refinementManager; 
    }
373

Thomas Witkowski's avatar
Thomas Witkowski committed
374
    /// Returns \ref refinementManager.
375
    inline CoarseningManager* getCoarseningManager(int comp = 0) 
376
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
377
378
      return coarseningManager; 
    }
379

Thomas Witkowski's avatar
Thomas Witkowski committed
380
    /// Returns \ref solver.
381
382
    inline OEMSolver* getSolver() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
383
384
      return solver; 
    }
385

Thomas Witkowski's avatar
Thomas Witkowski committed
386
    /// Returns \ref marker.
387
    inline Marker *getMarker(int comp = 0) 
388
    { 
389
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
390
    }
391

Thomas Witkowski's avatar
Thomas Witkowski committed
392
    /// Returns \ref marker.
393
    inline std::vector<Marker*> getMarkers() 
394
    { 
395
      return marker; 
Thomas Witkowski's avatar
Thomas Witkowski committed
396
    }
397

Thomas Witkowski's avatar
Thomas Witkowski committed
398
    /// Returns the name of the problem
Thomas Witkowski's avatar
Thomas Witkowski committed
399
    inline virtual std::string getName() 
400
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
401
402
      return name; 
    }
403

Thomas Witkowski's avatar
Thomas Witkowski committed
404
    /// Returns \ref useGetBound.
405
406
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
407
408
      return useGetBound; 
    }
409

410
411
412
413
414
415
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

416
417
418
419
420
421
    /// Returns \ref deserialized;
    bool isDeserialized()
    {
      return deserialized;
    }

422
423
424
425
426
427
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
428
    /// Sets \ref estimator.
429
430
    inline void setEstimator(std::vector<Estimator*> est) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
431
432
      estimator = est; 
    }
433

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

Thomas Witkowski's avatar
Thomas Witkowski committed
440
    /// Sets \ref estimator.
441
    inline void setEstimator(Estimator* est, int comp = 0) 
442
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
443
444
      estimator[comp] = est; 
    }
445

Thomas Witkowski's avatar
Thomas Witkowski committed
446
    /// Sets \ref marker.
447
    inline void setMarker(Marker* mark, int comp = 0) 
448
    { 
449
      marker[comp] = mark; 
Thomas Witkowski's avatar
Thomas Witkowski committed
450
    }
451

Thomas Witkowski's avatar
Thomas Witkowski committed
452
    /// Sets \ref solver.
453
454
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
455
456
      solver = sol; 
    }
457

Thomas Witkowski's avatar
Thomas Witkowski committed
458
    ///
459
    inline void setAssembleMatrixOnlyOnce(int i = 0, int j = 0, bool value = true) 
460
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
461
      assembleMatrixOnlyOnce[i][j] = value;
462
463
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
464
    ///
465
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
466
467
			     int component) 
    {
468
469
470
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
471
    ///
472
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int i = 0) 
473
    {
474
      return exactSolutionFcts[i];
475
476
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
477
    ///
478
479
    void setComputeExactError(bool v) 
    {
480
481
482
      computeExactError = v;
    }

483
484
485
486
487
488
    /// Sets \ref writeAsmInfo;
    void setWriteAsmInfo(bool b)
    {
      writeAsmInfo = b;
    }

489
490
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
491
492
493
494
    /** \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
495
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, std::string name);
496

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
503
504

    /// Returns \ref fileWriters.
505
506
    std::vector<FileWriterInterface*>& getFileWriterList() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
507
508
      return fileWriters;
    }
509

Thomas Witkowski's avatar
Thomas Witkowski committed
510
511
512
513
514
515
516
  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);

517
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
518
519
520
    
    /// Name of this problem.
    std::string name;
521

Thomas Witkowski's avatar
Thomas Witkowski committed
522
    /// Number of problem components
523
    int nComponents;
524
525

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
526
527
528
     * 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.
529
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
530
531
532
    int nMeshes;

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

Thomas Witkowski's avatar
Thomas Witkowski committed
535
536
    /// Meshes of this problem.
    std::vector<Mesh*> meshes;
537

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

Thomas Witkowski's avatar
Thomas Witkowski committed
541
    /// Pointer to the meshes for the different problem components
Thomas Witkowski's avatar
Thomas Witkowski committed
542
    std::vector<Mesh*> componentMeshes;
543
544

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
545
546
547
     * 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.
548
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
549
550
551
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
552
    std::vector<Marker*> marker;
553

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

Thomas Witkowski's avatar
Thomas Witkowski committed
557
    /// Linear solver of this problem. Used in \ref solve().
558
    OEMSolver *solver;
559

Thomas Witkowski's avatar
Thomas Witkowski committed
560
561
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
562

Thomas Witkowski's avatar
Thomas Witkowski committed
563
564
    /// System vector for the right hand side 
    SystemVector *rhs;
565

Thomas Witkowski's avatar
Thomas Witkowski committed
566
567
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
568

569
570
571
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

572
573
574
575
576
577
578
    /** \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
579
    std::vector< std::vector< bool > > assembleMatrixOnlyOnce;
580
581
582

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

Thomas Witkowski's avatar
Thomas Witkowski committed
589
590
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
591

Thomas Witkowski's avatar
Thomas Witkowski committed
592
593
    /// Writes the meshes and solution after the adaption loop.
    std::vector<FileWriterInterface*> fileWriters;
594
595
596
597
598
599

    /** \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
600
    RefinementManager *refinementManager;
601
602
603
604
605
606

    /** \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
607
    CoarseningManager *coarseningManager;
608
  
Thomas Witkowski's avatar
Thomas Witkowski committed
609
610
    /// Info level.
    int info;
611

612
613
614
    /// If true, the stationary problem was deserialized from some serialization file.
    bool deserialized;

615
616
617
618
619
620
621
622
623
624
625
626
    /** \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;
627
628
629
630
631
632
633
    
    /** \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;
634

635
636
    /// If true, AMDiS prints information about the assembling procedure to the screen.
    bool writeAsmInfo;
637
638
639
640
  };
}

#endif