ProblemVec.h 18.1 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
265
266
267
268
269
270
271
272
273
    /// 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);

274
    /// Adds a periodic boundary condition.
275
276
    virtual void addPeriodicBC(BoundaryType type, int row, int col);

Thomas Witkowski's avatar
Thomas Witkowski committed
277
278
279
280
    /** \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
281
282
    void assembleOnOneMesh(FiniteElemSpace *feSpace, 
			   Flag assembleFlag,
Thomas Witkowski's avatar
Thomas Witkowski committed
283
284
			   DOFMatrix *matrix, DOFVector<double> *vector);

Thomas Witkowski's avatar
Thomas Witkowski committed
285
286

    ///
287
288
289
290
    void assembleBoundaryConditions(DOFVector<double> *rhs,
				    DOFVector<double> *solution,
				    Mesh *mesh,
				    Flag assembleFlag);
291
292
293
294
295
  
    /** \name getting methods
     * \{ 
     */

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

302
303
304
305
306
    inline const DOFVector<double>* getSolutionVector(int i = 0)
    {
      return solution->getDOFVector(i);
    }

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
318
    /// Returns \ref systemMatrix.
319
320
    inline Matrix<DOFMatrix*> *getSystemMatrix() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
321
322
      return systemMatrix; 
    }
323

Thomas Witkowski's avatar
Thomas Witkowski committed
324
    /// Returns a pointer to the corresponding DOFMatrix.
325
326
    inline DOFMatrix* getSystemMatrix(int row, int col) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
327
328
329
330
      return (*systemMatrix)[row][col];
    }

    /// Returns mesh of given component
331
    inline Mesh* getMesh(int comp = 0) 
332
    {
333
      FUNCNAME("ProblemVec::getMesh()");
Thomas Witkowski's avatar
Thomas Witkowski committed
334
      TEST_EXIT(comp < static_cast<int>(componentMeshes.size()) && comp >= 0)
335
	("invalid component number\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
336
      return componentMeshes[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
337
    }
338

Thomas Witkowski's avatar
Thomas Witkowski committed
339
    /// Returns \ref meshes
340
341
    inline std::vector<Mesh*> getMeshes() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
342
343
      return meshes; 
    }
344

Thomas Witkowski's avatar
Thomas Witkowski committed
345
    /// Returns \ref feSpace_.
346
    inline FiniteElemSpace* getFeSpace(int comp = 0) 
347
    { 
348
      FUNCNAME("ProblemVec::getFeSpace()");
349
      TEST_EXIT(comp < static_cast<int>(componentSpaces.size()) && comp >= 0)
350
	("invalid component number\n");
351
      return componentSpaces[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
352
    }
353

Thomas Witkowski's avatar
Thomas Witkowski committed
354
    /// Returns \ref feSpaces.
355
    inline std::vector<FiniteElemSpace*> getFeSpaces() 
356
    { 
357
      return feSpaces; 
Thomas Witkowski's avatar
Thomas Witkowski committed
358
    }
359

Thomas Witkowski's avatar
Thomas Witkowski committed
360
    /// Returns \ref componentSpaces;
361
    inline std::vector<FiniteElemSpace*> getComponentFeSpaces() 
362
    {
363
      return componentSpaces;
364
365
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
366
    /// Returns \ref estimator.
367
    inline std::vector<Estimator*> getEstimators() 
368
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
369
370
      return estimator; 
    }
371

Thomas Witkowski's avatar
Thomas Witkowski committed
372
    /// Returns \ref estimator.
373
    inline Estimator* getEstimator(int comp = 0) 
374
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
375
376
      return estimator[comp]; 
    }
377

Thomas Witkowski's avatar
Thomas Witkowski committed
378
    /// Returns \ref refinementManager.
379
    inline RefinementManager* getRefinementManager(int comp = 0) 
380
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
381
382
      return refinementManager; 
    }
383

Thomas Witkowski's avatar
Thomas Witkowski committed
384
    /// Returns \ref refinementManager.
385
    inline CoarseningManager* getCoarseningManager(int comp = 0) 
386
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
387
388
      return coarseningManager; 
    }
389

Thomas Witkowski's avatar
Thomas Witkowski committed
390
    /// Returns \ref solver.
391
392
    inline OEMSolver* getSolver() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
393
394
      return solver; 
    }
395

Thomas Witkowski's avatar
Thomas Witkowski committed
396
    /// Returns \ref marker.
397
    inline Marker *getMarker(int comp = 0) 
398
    { 
399
      return marker[comp]; 
Thomas Witkowski's avatar
Thomas Witkowski committed
400
    }
401

Thomas Witkowski's avatar
Thomas Witkowski committed
402
    /// Returns \ref marker.
403
    inline std::vector<Marker*> getMarkers() 
404
    { 
405
      return marker; 
Thomas Witkowski's avatar
Thomas Witkowski committed
406
    }
407

Thomas Witkowski's avatar
Thomas Witkowski committed
408
    /// Returns the name of the problem
Thomas Witkowski's avatar
Thomas Witkowski committed
409
    inline virtual std::string getName() 
410
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
411
412
      return name; 
    }
413

Thomas Witkowski's avatar
Thomas Witkowski committed
414
    /// Returns \ref useGetBound.
415
416
    inline bool getBoundUsed() 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
417
418
      return useGetBound; 
    }
419

420
421
422
423
424
425
    /// Returns \ref info.
    int getInfo()
    {
      return info;
    }

426
427
428
429
430
431
    /// Returns \ref deserialized;
    bool isDeserialized()
    {
      return deserialized;
    }

432
433
434
435
436
437
    /** \} */

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

Thomas Witkowski's avatar
Thomas Witkowski committed
438
    /// Sets \ref estimator.
439
440
    inline void setEstimator(std::vector<Estimator*> est) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
441
442
      estimator = est; 
    }
443

Thomas Witkowski's avatar
Thomas Witkowski committed
444
    /// Sets the FE space for the given component.
445
    inline void setFeSpace(FiniteElemSpace *feSpace, int comp = 0) 
446
    {
447
      feSpaces[comp] = feSpace;
Thomas Witkowski's avatar
Thomas Witkowski committed
448
    }
449

Thomas Witkowski's avatar
Thomas Witkowski committed
450
    /// Sets \ref estimator.
451
    inline void setEstimator(Estimator* est, int comp = 0) 
452
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
453
454
      estimator[comp] = est; 
    }
455

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

Thomas Witkowski's avatar
Thomas Witkowski committed
462
    /// Sets \ref solver.
463
464
    inline void setSolver(OEMSolver* sol) 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
465
466
      solver = sol; 
    }
467

Thomas Witkowski's avatar
Thomas Witkowski committed
468
    ///
469
    inline void setAssembleMatrixOnlyOnce(int i = 0, int j = 0, bool value = true) 
470
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
471
      assembleMatrixOnlyOnce[i][j] = value;
472
473
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
474
    ///
475
    void setExactSolutionFct(AbstractFunction<double, WorldVector<double> > *fct,
476
477
			     int component) 
    {
478
479
480
      exactSolutionFcts[component] = fct;
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
481
    ///
482
    AbstractFunction<double, WorldVector<double> > *getExactSolutionFct(int i = 0) 
483
    {
484
      return exactSolutionFcts[i];
485
486
    }

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

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

499
500
    /** \} */

Thomas Witkowski's avatar
Thomas Witkowski committed
501
502
503
504
    /** \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
505
    void writeResidualMesh(int comp, AdaptInfo *adaptInfo, std::string name);
506

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
513
514

    /// Returns \ref fileWriters.
515
516
    std::vector<FileWriterInterface*>& getFileWriterList() 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
517
518
      return fileWriters;
    }
519

Thomas Witkowski's avatar
Thomas Witkowski committed
520
521
522
523
524
525
526
  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);

527
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
528
529
530
    
    /// Name of this problem.
    std::string name;
531

Thomas Witkowski's avatar
Thomas Witkowski committed
532
    /// Number of problem components
533
    int nComponents;
534
535

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
536
537
538
     * 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.
539
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
540
541
542
    int nMeshes;

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

Thomas Witkowski's avatar
Thomas Witkowski committed
545
546
    /// Meshes of this problem.
    std::vector<Mesh*> meshes;
547

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

Thomas Witkowski's avatar
Thomas Witkowski committed
551
    /// Pointer to the meshes for the different problem components
Thomas Witkowski's avatar
Thomas Witkowski committed
552
    std::vector<Mesh*> componentMeshes;
553
554

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
555
556
557
     * 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.
558
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
559
560
561
    ComponentTraverseInfo traverseInfo;
    
    /// Responsible for element marking.
562
    std::vector<Marker*> marker;
563

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

Thomas Witkowski's avatar
Thomas Witkowski committed
567
    /// Linear solver of this problem. Used in \ref solve().
568
    OEMSolver *solver;
569

Thomas Witkowski's avatar
Thomas Witkowski committed
570
571
    /// System vector  storing the calculated solution of the problem.
    SystemVector *solution;
572

Thomas Witkowski's avatar
Thomas Witkowski committed
573
574
    /// System vector for the right hand side 
    SystemVector *rhs;
575

Thomas Witkowski's avatar
Thomas Witkowski committed
576
577
    /// System matrix
    Matrix<DOFMatrix*> *systemMatrix;
578

579
580
581
    /// Composed system matrix
    SolverMatrix<Matrix<DOFMatrix*> > solverMatrix;

582
583
584
585
586
587
588
    /** \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
589
    std::vector< std::vector< bool > > assembleMatrixOnlyOnce;
590
591
592

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

Thomas Witkowski's avatar
Thomas Witkowski committed
599
600
    /// Determines whether domain boundaries should be considered at assembling.
    bool useGetBound;
601

Thomas Witkowski's avatar
Thomas Witkowski committed
602
603
    /// Writes the meshes and solution after the adaption loop.
    std::vector<FileWriterInterface*> fileWriters;
604
605
606
607
608
609

    /** \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
610
    RefinementManager *refinementManager;
611
612
613
614
615
616

    /** \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
617
    CoarseningManager *coarseningManager;
618
  
Thomas Witkowski's avatar
Thomas Witkowski committed
619
620
    /// Info level.
    int info;
621

622
623
624
    /// If true, the stationary problem was deserialized from some serialization file.
    bool deserialized;

625
626
627
628
629
630
631
632
633
634
635
636
    /** \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;
637
638
639
640
641
642
643
    
    /** \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;
644

645
646
    /// If true, AMDiS prints information about the assembling procedure to the screen.
    bool writeAsmInfo;
647
648
649
650
  };
}

#endif