10#include <kernel/adjacency/graph.hpp>
11#include <kernel/space/dof_mapping_renderer.hpp>
12#include <kernel/lafem/null_matrix.hpp>
13#include <kernel/geometry/intern/coarse_fine_cell_mapping.hpp>
58 template<
typename TestSpace_,
typename TrialSpace_>
66 XASSERTM(test_dof_graph.get_num_nodes_domain() == trial_dof_graph.get_num_nodes_domain(),
"invalid test-/trial-space pair");
87 template<
typename Space_>
112 template<
typename TestSpace_,
typename TrialSpace_>
120 XASSERTM(test_dof_graph.get_num_nodes_domain() == trial_dof_graph.get_num_nodes_domain(),
"invalid test-/trial-space pair");
123 typedef typename TestSpace_::ShapeType ShapeType;
124 static constexpr Index shape_dim =
Index(ShapeType::dimension);
127 const auto& facet_at_shape = test_space.get_trafo().get_mesh().template get_index_set<shape_dim, shape_dim-1>();
157 template<
typename Space_>
164 typedef typename Space_::ShapeType ShapeType;
165 static constexpr Index shape_dim =
Index(ShapeType::dimension);
168 const auto& facet_at_shape = space.get_trafo().get_mesh().template get_index_set<shape_dim, shape_dim-1>();
195 template<
typename TestSpace_,
typename TrialSpace_>
203 XASSERTM(test_dof_graph.get_num_nodes_domain() == trial_dof_graph.get_num_nodes_domain(),
"invalid test-/trial-space pair");
206 typedef typename TestSpace_::ShapeType ShapeType;
207 static constexpr Index shape_dim =
Index(ShapeType::dimension);
210 const auto& facet_at_shape = test_space.get_trafo().get_mesh().template get_index_set<shape_dim, 0>();
240 template<
typename Space_>
247 typedef typename Space_::ShapeType ShapeType;
248 static constexpr Index shape_dim =
Index(ShapeType::dimension);
251 const auto& facet_at_shape = space.get_trafo().get_mesh().template get_index_set<shape_dim, 0>();
278 template<
typename Space_>
282 const Index n = space.get_num_dofs();
290 for(
Index i(0); i < n; ++i)
291 dom_ptr[i] = img_idx[i] = i;
315 template<
typename TestSpace_,
typename TrialSpace_,
typename TrialToTestAdjator_>
317 const TestSpace_& test_space,
318 const TrialSpace_& trial_space,
319 const TrialToTestAdjator_& trial2test_adjactor)
326 const Adjacency::Permutation& trial_perm = trial_space.get_trafo().get_mesh().get_mesh_permutation().get_perm();
327 const Adjacency::Permutation& test_inv_perm = test_space.get_trafo().get_mesh().get_mesh_permutation().get_inv_perm();
328 if(!trial_perm.
empty() || !test_inv_perm.
empty())
335 if(trial_perm.
empty())
338 permuted_graph = std::move(trial2test_graph);
341 else if(test_inv_perm.
empty())
351 permuted_graph =
Adjacency::Graph(trial2test_graph, trial_perm, test_inv_perm);
393 template<
typename FineTestSpace_,
typename CoarseTrialSpace_>
395 const FineTestSpace_& fine_space,
396 const CoarseTrialSpace_& coarse_space)
400 refine_adjactor(fine_space.get_trafo().get_mesh(), coarse_space.get_trafo().get_mesh());
415 template<
typename MatrixType_,
typename TestSpace_,
typename TrialSpace_>
417 const TestSpace_& test_space,
const TrialSpace_& trial_space)
423 template<
typename DT_,
typename IT_,
int BH_,
int BW_,
typename TestSpace_,
typename TrialSpace_>
426 const TestSpace_& test_space,
const TrialSpace_& trial_space)
429 matrix.
resize(test_space.get_num_dofs(), trial_space.get_num_dofs());
441 template<
typename MatrixType_,
typename Space_>
448 template<
typename DT_,
typename IT_,
int BH_,
int BW_,
typename Space_>
453 matrix.
resize(space.get_num_dofs(), space.get_num_dofs());
465 template<
typename MatrixType_,
typename TestSpace_,
typename TrialSpace_>
467 const TestSpace_& test_space,
const TrialSpace_& trial_space)
481 template<
typename MatrixType_,
typename Space_>
496 template<
typename MatrixType_,
typename TestSpace_,
typename TrialSpace_>
498 const TestSpace_& test_space,
const TrialSpace_& trial_space)
512 template<
typename MatrixType_,
typename Space_>
527 template<
typename MatrixType_,
typename Space_>
547 template<
typename MatrixType_,
typename TestSpace_,
typename TrialSpace_,
typename Trial2TestAdjactor_>
549 const TestSpace_& test_space,
const TrialSpace_& trial_space,
550 const Trial2TestAdjactor_& trial2test_adjactor)
569 template<
typename MatrixType_,
typename FineSpace_,
typename CoarseSpace_>
571 const FineSpace_& fine_space,
const CoarseSpace_& coarse_space)
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Adjacency Graph implementation.
Index * get_domain_ptr()
Returns the domain pointer array.
Index * get_image_idx()
Returns the image node index array.
void permute_indices(const Adjacency::Permutation &inv_perm)
Permutes the image indices.
bool empty() const
Checks whether the permutation is empty.
@ identity
create identity permutation
Symbolic Matrix and Graph assembler class.
static void assemble_matrix_std1(LAFEM::NullMatrix< DT_, IT_, BH_, BW_ > &matrix, const Space_ &space)
specialization for NullMatrix
static void assemble_matrix_std1(MatrixType_ &matrix, const Space_ &space)
Assembles a standard matrix structure from a single space.
static void assemble_matrix_ext_node1(MatrixType_ &matrix, const Space_ &space)
Assembles an extended-node matrix structure from a single space.
static void assemble_matrix_ext_facet2(MatrixType_ &matrix, const TestSpace_ &test_space, const TrialSpace_ &trial_space)
Assembles an extended-facet matrix structure from a test-trial-space pair.
static Adjacency::Graph assemble_graph_ext_facet2(const TestSpace_ &test_space, const TrialSpace_ &trial_space)
Assembles the extended-facet Dof-Adjacency graph for different test- and trial-spaces.
static void assemble_matrix_diag(MatrixType_ &matrix, const Space_ &space)
Assembles a diagonal matrix structure from a single space.
static Adjacency::Graph assemble_graph_2lvl(const FineTestSpace_ &fine_space, const CoarseTrialSpace_ &coarse_space)
Assembles the 2-level refinement Dof-Adjacency graph.
static void assemble_matrix_std2(LAFEM::NullMatrix< DT_, IT_, BH_, BW_ > &matrix, const TestSpace_ &test_space, const TrialSpace_ &trial_space)
specialization for NullMatrix
static Adjacency::Graph assemble_graph_std1(const Space_ &space)
Assembles the standard Dof-Adjacency graph for identical test- and trial-spaces.
static void assemble_matrix_ext_node2(MatrixType_ &matrix, const TestSpace_ &test_space, const TrialSpace_ &trial_space)
Assembles an extended-node matrix structure from a test-trial-space pair.
static Adjacency::Graph assemble_graph_ext_node1(const Space_ &space)
Assembles the extended-node Dof-Adjacency graph for identical test- and trial-spaces.
static Adjacency::Graph assemble_graph_diag(const Space_ &space)
Assembles the diagonal Dof-Adjacency graph for identical test- and trial-spaces.
static Adjacency::Graph assemble_graph_ext_facet1(const Space_ &space)
Assembles the extended-facet Dof-Adjacency graph for identical test- and trial-spaces.
static void assemble_matrix_ext_facet1(MatrixType_ &matrix, const Space_ &space)
Assembles an extended-facet matrix structure from a single space.
static Adjacency::Graph assemble_graph_ext_node2(const TestSpace_ &test_space, const TrialSpace_ &trial_space)
Assembles the extended-node Dof-Adjacency graph for different test- and trial-spaces.
static void assemble_matrix_std2(MatrixType_ &matrix, const TestSpace_ &test_space, const TrialSpace_ &trial_space)
Assembles a standard matrix structure from a test-trial-space pair.
static void assemble_matrix_intermesh(MatrixType_ &matrix, const TestSpace_ &test_space, const TrialSpace_ &trial_space, const Trial2TestAdjactor_ &trial2test_adjactor)
Assembles a matrix structure from a test-trial-mesh pair defined on different meshes.
static Adjacency::Graph assemble_graph_std2(const TestSpace_ &test_space, const TrialSpace_ &trial_space)
Assembles the standard Dof-Adjacency graph for different test- and trial-spaces.
static void assemble_matrix_2lvl(MatrixType_ &matrix, const FineSpace_ &fine_space, const CoarseSpace_ &coarse_space)
Assembles a 2-level matrix structure from a fine-coarse-space pair.
static Adjacency::Graph assemble_graph_intermesh(const TestSpace_ &test_space, const TrialSpace_ &trial_space, const TrialToTestAdjator_ &trial2test_adjactor)
Assembles the Dof-Adjacency graph where test and trial spaces are defined on different meshes.
A coarse cell to fine cell mapping class.
Null Matrix implementation.
void resize(Index rows_in, Index columns_in)
Resizes the matrix to different dimensions.
static Adjacency::Graph render(const Space_ &space)
Renders the dof-mapping of a space into an adjacency graph.
@ injectify_sorted
Render-Injectified mode, sort image indices.
@ transpose
Render-Transpose mode.
@ injectify_transpose
Render-Injectified-Transpose mode.
@ injectify
Render-Injectified mode.
@ as_is
Render-As-Is mode.
std::uint64_t Index
Index data type.