adaptiveModels.hh

Go to the documentation of this file.
1 
7 #ifndef adaptiveModels_hh
8 #define adaptiveModels_hh
9 
10 #include "hp2D/spacePreBuilder.hh"
11 #include "models.hh"
12 #include "toolbox/inputParam.hh"
13 
14 namespace concepts {
15 
16  // forward declaration
17  class InputAdaptiveModels;
18 
19  // ******************************************************** AdaptiveModels **
20 
21  template<class F, uint dim>
22  class AdaptiveModel : public Model<F> {
23  public:
24  enum subdivTypes { NONE = 0, X = 1, Y = 2};
25 
26  AdaptiveModel(const std::string problemName) : Model<F>(problemName) {}
34  void rebuildMesh(const uint l = 0, const uint p = 1,
35  const uint g = 0, const uint subdiv = X | Y);
37  private:
38  virtual void rebuildMesh_(const uint l = 0, const uint p = 1,
39  const uint g = 0, const uint subdiv = X | Y) = 0;
40  };
41 
42  // *************************************************** InputAdaptiveModels **
43 
50  public:
56  virtual std::ostream& letters(std::ostream& os) const;
58  virtual std::ostream& arguments(std::ostream& os) const;
60  virtual std::ostream& description(std::ostream& os) const;
65  virtual int input(int opt, const char* optarg);
66  protected:
67  virtual std::ostream& info(std::ostream& os) const;
68  };
69 
70 
71 } // namespace concepts
72 
73 namespace hp2D {
74 
75  // ******************************************************** AdaptiveModels **
76 
77  template<class F>
78  class AdaptiveModel : public concepts::AdaptiveModel<F,2> {
79  public:
81  AdaptiveModel(const std::string problemName, const uint geomRefAttr = 100);
82  protected:
83  enum subdivTypes { NONE = 0, X = 1, Y = 2};
85  virtual void rebuildMesh_(const uint l = 0, const uint p = 1,
86  const uint g = 0, const uint subdiv = X | Y);
87  virtual concepts::Mesh& mesh_() { return prebuild_().mesh(); }
89  virtual hpFull& prebuild_() = 0;
91  const uint geomRefAttr_;
92  };
93 
94 } // namespace hp2D
95 
96 #endif // adaptiveModels_hh
virtual hpFull & prebuild_()=0
Space Prebuilder.
Base class for a model.
Definition: models.hh:55
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
void rebuildMesh(const uint l=0, const uint p=1, const uint g=0, const uint subdiv=X|Y)
Rebuilds only the mesh and sets the polynomial degrees.
virtual std::ostream & description(std::ostream &os) const
Returns description for help.
Holds parameters in hashes.
Definition: inputOutput.hh:75
Helper class for building 2D hp-FEM spaces (space pre builder).
Abstract class for carrying information, which helps for reading input parameters from command line.
Definition: inputParam.hh:24
void rebuildMesh(concepts::InputAdaptiveModels &input)
AdaptiveModel(const std::string problemName)
virtual concepts::Mesh2 & mesh() const
Returns mesh.
Helps for reading input parameters for single solving with AdaptiveModels.
virtual concepts::Mesh & mesh_()
Mesh.
2D hp-FEM for H1-conforming elements.
virtual void rebuildMesh_(const uint l=0, const uint p=1, const uint g=0, const uint subdiv=X|Y)
Rebuilds only the mesh and sets the polynomial degrees.
AdaptiveModel(const std::string problemName, const uint geomRefAttr=100)
Constructor.
virtual std::ostream & letters(std::ostream &os) const
Return letters for the arguments.
const uint geomRefAttr_
Attribute of vertices or edges for geometric refinement.
virtual std::ostream & arguments(std::ostream &os) const
Returns argument list as string.
virtual void rebuildMesh_(const uint l=0, const uint p=1, const uint g=0, const uint subdiv=X|Y)=0
An abstract class for meshes.
Definition: mesh.hh:76
InputAdaptiveModels(concepts::InOutParameters &input, const uint p=1)
Constructor.
virtual int input(int opt, const char *optarg)
Process an argument and sets input parameter, if found.
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich