hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
refinement.hpp
Go to the documentation of this file.
1#pragma once
9
10#include <span>
11#include <vector>
12
13#include "hpfem/core/types.hpp"
15
16namespace hpfem::adaptivity {
17
21[[nodiscard]] std::vector<int> p_refine(std::span<const int> orders, std::span<const Index> marked,
22 int increment = 1, int max_order = 0);
23
25struct HpStep {
27 std::vector<int> orders;
28};
29
39template <int Dim>
40[[nodiscard]] HpStep hp_refine(mesh::AdaptiveMesh<Dim>& mesh, std::span<const int> orders,
41 std::span<const Index> h_marked, std::span<const Index> p_marked,
42 int increment = 1, int max_order = 0, bool spread_p = true);
43
45[[nodiscard]] mesh::RefinementStep identity_step(Index num_cells);
46
52template <int Dim>
53std::vector<mesh::RefinementStep> refine_at_points(mesh::AdaptiveMesh<Dim>& mesh,
54 std::span<const Point<Dim>> points, int levels,
55 Real tolerance = 1e-9);
56
57extern template std::vector<mesh::RefinementStep> refine_at_points<2>(mesh::AdaptiveMesh<2>&,
58 std::span<const Point<2>>,
59 int, Real);
60extern template std::vector<mesh::RefinementStep> refine_at_points<3>(mesh::AdaptiveMesh<3>&,
61 std::span<const Point<3>>,
62 int, Real);
63extern template HpStep hp_refine<2>(mesh::AdaptiveMesh<2>&, std::span<const int>,
64 std::span<const Index>, std::span<const Index>, int, int, bool);
65extern template HpStep hp_refine<3>(mesh::AdaptiveMesh<3>&, std::span<const int>,
66 std::span<const Index>, std::span<const Index>, int, int, bool);
67
68} // namespace hpfem::adaptivity
Definition adaptive_mesh.hpp:66
Definition axisymmetric_estimator.hpp:39
HpStep hp_refine(mesh::AdaptiveMesh< Dim > &mesh, std::span< const int > orders, std::span< const Index > h_marked, std::span< const Index > p_marked, int increment=1, int max_order=0, bool spread_p=true)
template HpStep hp_refine< 3 >(mesh::AdaptiveMesh< 3 > &, std::span< const int >, std::span< const Index >, std::span< const Index >, int, int, bool)
template HpStep hp_refine< 2 >(mesh::AdaptiveMesh< 2 > &, std::span< const int >, std::span< const Index >, std::span< const Index >, int, int, bool)
std::vector< int > p_refine(std::span< const int > orders, std::span< const Index > marked, int increment=1, int max_order=0)
template std::vector< mesh::RefinementStep > refine_at_points< 3 >(mesh::AdaptiveMesh< 3 > &, std::span< const Point< 3 > >, int, Real)
std::vector< mesh::RefinementStep > refine_at_points(mesh::AdaptiveMesh< Dim > &mesh, std::span< const Point< Dim > > points, int levels, Real tolerance=1e-9)
template std::vector< mesh::RefinementStep > refine_at_points< 2 >(mesh::AdaptiveMesh< 2 > &, std::span< const Point< 2 > >, int, Real)
mesh::RefinementStep identity_step(Index num_cells)
The step relating a mesh to itself (pure p-refinement), for assembly::prolongate.
double Real
Definition types.hpp:15
Eigen::Matrix< Real, Dim, 1 > Point
Definition types.hpp:27
std::int64_t Index
global indices (DoFs, entities)
Definition types.hpp:17
Result of an hp-refinement step: the mesh relation and the orders of the new cells.
Definition refinement.hpp:25
mesh::RefinementStep step
Definition refinement.hpp:26
std::vector< int > orders
Definition refinement.hpp:27
Definition adaptive_mesh.hpp:26