16 #ifndef __H2D_WEAKFORM_H
17 #define __H2D_WEAKFORM_H
19 #include "../function/solution.h"
35 template<
typename Scalar>
class DiscreteProblem;
36 template<
typename Scalar>
class DiscreteProblemLinear;
38 template<
typename Scalar>
class Space;
44 template<
typename T>
class Func;
45 template<
typename T>
class Geom;
47 template<
typename Scalar>
class Form;
74 template<
typename Scalar>
75 class HERMES_API WeakForm :
public Hermes::Mixins::IntegrableWithGlobalOrder,
public Hermes::Mixins::Loggable
83 WeakForm(
unsigned int neq = 1,
bool mat_free =
false);
89 void add_matrix_form(MatrixFormVol<Scalar>* mfv);
92 void add_matrix_form_surf(MatrixFormSurf<Scalar>* mfs);
95 void add_matrix_form_DG(MatrixFormDG<Scalar>* mfDG);
98 void add_vector_form(VectorFormVol<Scalar>* vfv);
101 void add_vector_form_surf(VectorFormSurf<Scalar>* vfs);
104 void add_vector_form_DG(VectorFormDG<Scalar>* vfDG);
109 bool is_matrix_free()
const {
return is_matfree; }
112 void set_current_time(
double time);
113 void set_current_time_step(
double time_step);
115 virtual double get_current_time()
const;
116 virtual double get_current_time_step()
const;
118 Hermes::vector<Form<Scalar> *> get_forms()
const;
120 Hermes::vector<MatrixFormVol<Scalar> *> get_mfvol()
const;
121 Hermes::vector<MatrixFormSurf<Scalar> *> get_mfsurf()
const;
122 Hermes::vector<MatrixFormDG<Scalar> *> get_mfDG()
const;
124 Hermes::vector<VectorFormVol<Scalar> *> get_vfvol()
const;
125 Hermes::vector<VectorFormSurf<Scalar> *> get_vfsurf()
const;
126 Hermes::vector<VectorFormDG<Scalar> *> get_vfDG()
const;
132 void set_ext(MeshFunction<Scalar>* ext);
133 void set_ext(Hermes::vector<MeshFunction<Scalar>*> ext);
134 Hermes::vector<MeshFunction<Scalar>*> get_ext()
const;
136 virtual WeakForm* clone()
const;
140 Hermes::vector<MeshFunction<Scalar>*>
ext;
143 double current_time_step;
150 Hermes::vector<Form<Scalar> *>
forms;
153 Hermes::vector<MatrixFormVol<Scalar> *>
mfvol;
156 Hermes::vector<MatrixFormSurf<Scalar> *>
mfsurf;
159 Hermes::vector<MatrixFormDG<Scalar> *>
mfDG;
162 Hermes::vector<VectorFormVol<Scalar> *>
vfvol;
165 Hermes::vector<VectorFormSurf<Scalar> *>
vfsurf;
168 Hermes::vector<VectorFormDG<Scalar> *>
vfDG;
170 bool** get_blocks(
bool force_diagonal_blocks)
const;
176 friend class Hermes::Preconditioners::Precond<Scalar>;
178 bool warned_nonOverride;
191 template<
typename Scalar>
192 class HERMES_API
Form
202 void set_areas(Hermes::vector<std::string> areas);
203 Hermes::vector<std::string> getAreas()
const;
210 Hermes::vector<MeshFunction<Scalar>*> get_ext()
const;
226 Hermes::vector<MeshFunction<Scalar>*>
ext;
230 void set_current_stage_time(
double time);
232 double get_current_stage_time()
const;
239 void setScalingFactor(
double scalingFactor);
240 void set_uExtOffset(
int u_ext_offset);
250 template<
typename Scalar>
261 unsigned int previous_iteration_space_index;
279 template<
typename Scalar>
295 template<
typename Scalar>
296 class HERMES_API MatrixFormSurf :
public MatrixForm<Scalar>
300 MatrixFormSurf(
unsigned int i,
unsigned int j);
302 virtual ~MatrixFormSurf();
304 virtual MatrixFormSurf* clone()
const;
308 template<
typename Scalar>
309 class HERMES_API MatrixFormDG :
public MatrixForm<Scalar>
313 MatrixFormDG(
unsigned int i,
unsigned int j);
315 virtual ~MatrixFormDG();
317 virtual MatrixFormDG* clone()
const;
321 template<
typename Scalar>
342 template<
typename Scalar>
355 template<
typename Scalar>
356 class VectorFormSurf :
public VectorForm<Scalar>
368 template<
typename Scalar>
369 class VectorFormDG :
public VectorForm<Scalar>