16 #ifndef __H2D_DISCRETE_PROBLEM_H
17 #define __H2D_DISCRETE_PROBLEM_H
19 #include "hermes_common.h"
20 #include "adapt/adapt.h"
23 #include "weakform/weakform.h"
24 #include "function/function.h"
26 #include "refinement_selectors/selector.h"
27 #include "exceptions.h"
34 class PrecalcShapeset;
45 void set_transformation(
unsigned int transformation);
48 unsigned int get_transformation();
52 unsigned int transformation;
62 template<
typename Scalar>
73 virtual bool isOkay()
const;
80 virtual void set_spaces(Hermes::vector<
const Space<Scalar>*> spaces);
99 virtual Hermes::vector<const Space<Scalar>*> get_spaces()
const;
102 int get_num_dofs()
const;
105 bool is_matrix_free()
const;
108 virtual void set_time(
double time);
109 virtual void set_time_step(
double time_step);
122 void assemble(Scalar* coeff_vec, SparseMatrix<Scalar>* mat, Vector<Scalar>* rhs = NULL,
123 bool force_diagonal_blocks =
false, Table* block_weights = NULL);
127 void assemble(Scalar* coeff_vec, Vector<Scalar>* rhs = NULL,
128 bool force_diagonal_blocks =
false, Table* block_weights = NULL);
132 virtual void assemble(SparseMatrix<Scalar>* mat, Vector<Scalar>* rhs = NULL,
bool force_diagonal_blocks =
false,
133 Table* block_weights = NULL);
138 void assemble(Vector<Scalar>* rhs = NULL,
bool force_diagonal_blocks =
false,
139 Table* block_weights = NULL);
143 static int init_geometry_points(
RefMap* reference_mapping,
int order,
Geom<double>*& geometry,
double*& jacobian_x_weights);
144 static int init_surface_geometry_points(
RefMap* reference_mapping,
int& order, Traverse::State* current_state,
Geom<double>*& geometry,
double*& jacobian_x_weights);
169 void create_sparse_structure();
170 void create_sparse_structure(SparseMatrix<Scalar>* mat, Vector<Scalar>* rhs = NULL);
173 inline void set_RK(
int original_spaces_count) { this->
RungeKutta =
true; RK_original_spaces_count = original_spaces_count; }
177 bool state_needs_recalculation(
AsmList<Scalar>** current_als, Traverse::State* current_state);
188 void adjust_order_to_refmaps(
Form<Scalar> *form,
int& order, Hermes::Ord* o,
RefMap** current_refmaps);
202 AsmList<Scalar>* current_als, Traverse::State* current_state,
int n_quadrature_points,
Geom<double>* geometry,
double* jacobian_x_weights);
215 bool is_up_to_date()
const;
221 Hermes::vector<const Space<Scalar>*>
spaces;
223 Hermes::vector<unsigned int> spaces_first_dofs;
262 Vector<Scalar>* current_rhs;
263 bool current_force_diagonal_blocks;
264 Table* current_block_weights;
287 double* jacobian_x_weights;
288 double** jacobian_x_weightsSurface;
289 int n_quadrature_points;
290 int* n_quadrature_pointsSurface;
292 int* asmlistSurfaceCnt;
295 std::map<uint64_t, CacheRecordPerSubIdx*>*** cache_records_sub_idx;
297 bool** cache_element_stored;
299 bool do_not_use_cache;
312 void assemble_DG_one_neighbor(
bool edge_processed,
unsigned int neighbor_i,
315 std::map<unsigned int, PrecalcShapeset *> npss, std::map<unsigned int, PrecalcShapeset *> nspss, std::map<unsigned int, RefMap *> nrefmap,
320 Traverse::State* current_state,
MatrixFormDG<Scalar>** current_mfDG, std::map<unsigned int, PrecalcShapeset*> npss,
321 std::map<unsigned int, PrecalcShapeset*> nspss, std::map<unsigned int, RefMap*> nrefmap, LightArray<
NeighborSearch<Scalar>*>& neighbor_searches);
325 Traverse::State* current_state,
VectorFormDG<Scalar>** current_vfDG, std::map<unsigned int, PrecalcShapeset*> nspss,
333 bool neighbor_supp_u,
bool neighbor_supp_v, LightArray<
NeighborSearch<Scalar>*>& neighbor_searches,
int neighbor_index_u);
338 bool neighbor_supp_u,
bool neighbor_supp_v,
358 int order,
unsigned int min_dg_mesh_seq);
361 bool init_neighbors(LightArray<
NeighborSearch<Scalar>*>& neighbor_searches, Traverse::State* current_state,
unsigned int min_dg_mesh_seq);
367 void insert_into_multimesh_tree(
NeighborNode* node,
unsigned int* transformations,
unsigned int transformation_count);
370 Hermes::vector<Hermes::vector<unsigned int>*> get_multimesh_neighbors_transformations(
NeighborNode* multimesh_tree);
373 void traverse_multimesh_tree(
NeighborNode* node, Hermes::vector<Hermes::vector<unsigned int>*>& running_transformations);
387 void traverse_multimesh_subtree(
NeighborNode* node, Hermes::vector<Hermes::vector<unsigned int>*>& running_central_transformations,