Class documentation of Concepts

Loading...
Searching...
No Matches
Maxwell2D_E.hh
Go to the documentation of this file.
1
7#ifndef Maxwell2D_E_hh
8#define Maxwell2D_E_hh
9
10#include "adaptiveModels.hh"
11#include "operator/sparseMatrix.hh"
13#include "formula/boundary.hh"
14#include "models/maxwell.hh"
17
18namespace hp2D {
19
20 using concepts::Real;
21 using concepts::Cmplx;
22
23 class InputMaxwell2D_E;
24
25 // *********************************************************** Maxwell2D_E **
26
32 class Maxwell2D_E : public AdaptiveModel<Cmplx>,
36 public:
38 enum solverType { SUPERLU = 0, BICGSTAB};
40 enum solverType type = SUPERLU, bool diagPrecond = true,
41 bool afterIter = false,
42 const Real eps = EPS0, const Real omega = OMEGA50,
43 const Real mu = MU0, const uint geomRefAttrib = 100);
45 const uint geomRefAttrib = 100);
46 virtual ~Maxwell2D_E() {}
48 virtual hp2D::hpAdaptiveSpaceHCurl& space() const { return *spc_; }
50 virtual Real dissipation();
52 virtual Real magnEnergy();
53 protected:
54 virtual std::ostream& info(std::ostream& os) const;
56 virtual hpFull& prebuild_() { return spc_->prebuild(); }
58 virtual const std::string mshAbbr_() { return geom_.meshAbbreviation(); }
59 private:
61 void constructor_();
62
66 std::unique_ptr<hp2D::hpAdaptiveSpaceHCurl> spc_;
68 std::unique_ptr<concepts::BoundaryConditions> bc_;
69
71 enum solverType type_;
73 bool diagPrecond_;
75 bool afterIter_, statusAfterIter_;
77 std::unique_ptr<concepts::Vector<Cmplx> > residual_;
79 std::unique_ptr<Real> residualNorm_;
81 std::unique_ptr<concepts::SparseMatrix<Cmplx> > S_;
83 std::unique_ptr<concepts::SparseMatrix<Real> > A_, M_eddy_, M_wave_;
84 // load vector
85 std::unique_ptr<concepts::Vector<Cmplx> > rhs_;
87 const Real eps_;
89 const Real omega_;
91 const Real mu_;
93 virtual void solve_();
95 void matrices_();
97 void rotrotMatrix_();
99 void identityMatrix_();
101 void linearform_();
103 std::unique_ptr<Real> dissipation_;
105 std::unique_ptr<Real> magnEnergy_;
107 double solvetime_, matrixtime_, spacetime_;
108 };
109
110 // ****************************************************** InputMaxwell2D_E **
111
117 public:
123 virtual std::ostream& letters(std::ostream& os) const;
125 virtual std::ostream& arguments(std::ostream& os) const;
127 virtual std::ostream& description(std::ostream& os) const;
132 virtual int input(int opt, const char* optarg);
134 enum Maxwell2D_E::solverType type() const { return type_; }
137 return bType_;
138 }
140 bool solving() const { return solving_; }
141 protected:
142 virtual std::ostream& info(std::ostream& os) const;
143 private:
147 enum Maxwell2D_E::solverType type_;
149 bool solving_;
150 };
151
152} // namespace hp2D
153
154namespace concepts {
155
156 // *************************************** ModelControl<hp2D::Maxwell2D_E> **
157
158 template<>
159 class ModelControl<hp2D::Maxwell2D_E> :
160 public ModelControlBase<Model<Cmplx> > {
161 public:
163 ModelControl(hp2D::Maxwell2D_E& model);
164 virtual ~ModelControl() {}
165
166 virtual hp2D::Maxwell2D_E& model() {
167 return static_cast<hp2D::Maxwell2D_E&>(model_);
168 }
169 virtual const hp2D::Maxwell2D_E& model() const {
170 return static_cast<const hp2D::Maxwell2D_E&>(model_);
171 }
173 virtual void matrices();
175 void solverType(enum hp2D::Maxwell2D_E::solverType type,
176 bool diagPrecond);
178 virtual Real solve();
180 void storeMatricesToMatlab(const std::string matrixFile) const;
182 hp2D::hpFull& prebuild() { return model().prebuild_(); }
183 protected:
184 virtual std::ostream& info(std::ostream& os) const;
185 };
186
187} // namespace concepts
188
189#endif // Maxwell2D_E_hh
const boundaryType bType() const
Returns boundary type.
Definition maxwell.hh:33
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual F & model()
Returns the model.
Definition models.hh:102
enum Maxwell2D_E::solverType type() const
Returns solver.
virtual int input(int opt, const char *optarg)
virtual std::ostream & arguments(std::ostream &os) const
Returns argument list as string.
InputMaxwell2D_E(concepts::InOutParameters &input)
Constructor.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
bool solving() const
Returns true, if model should be solved.
virtual std::ostream & letters(std::ostream &os) const
enum concepts::MaxwellBoundary::boundaryType boundary() const
Returns type of boundary condition.
virtual std::ostream & description(std::ostream &os) const
Returns description for help.
solverType
Type of the solver.
virtual hp2D::hpAdaptiveSpaceHCurl & space() const
Returns the space.
virtual Real dissipation()
Return dissipation power loss.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Real magnEnergy()
Return magnetic energy.
virtual hpFull & prebuild_()
Space Prebuilder.
virtual const std::string mshAbbr_()
Mesh abbreviation string.
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320
std::complex< Real > Cmplx
Type for a complex number. It also depends on the setting of Real.
Definition typedefs.hh:42