QUGaR 0.0.4
Loading...
Searching...
No Matches
cut_quadrature.hpp
Go to the documentation of this file.
1// --------------------------------------------------------------------------
2//
3// Copyright (C) 2025-present by Pablo Antolin
4//
5// This file is part of the QUGaR library.
6//
7// SPDX-License-Identifier: MIT
8//
9// --------------------------------------------------------------------------
10
11#ifndef QUGAR_LIBRARY_CUT_QUADRATURE_HPP
12#define QUGAR_LIBRARY_CUT_QUADRATURE_HPP
13
20
21
22#include <qugar/point.hpp>
23#include <qugar/types.hpp>
25
26#include <cstddef>
27#include <memory>
28#include <vector>
29
30
31namespace qugar {
32
33enum ImmersedStatus : std::uint8_t { cut, full, empty };
34
35template<int dim> struct CutCellsQuad
36{
38 std::vector<int> cells;
40 std::vector<int> n_pts_per_cell;
41
43 std::vector<Point<dim>> points;
45 std::vector<real> weights;
46
47 void reserve(const int n_cells, const int n_tot_pts);
48};
49
50template<int dim> struct CutIsoBoundsQuad
51{
53 std::vector<int> cells;
55 std::vector<int> local_facet_ids;
57 std::vector<int> n_pts_per_facet;
58
60 std::vector<Point<dim>> points;
62 std::vector<real> weights;
63
64 void reserve(const int n_cells, const int n_tot_pts);
65};
66
67template<int dim> struct CutUnfBoundsQuad
68{
70 std::vector<int> cells;
72 std::vector<int> n_pts_per_cell;
73
75 std::vector<Point<dim>> points;
77 std::vector<real> weights;
79 std::vector<Point<dim>> normals;
80
81 void reserve(const int n_cells, const int n_tot_pts);
82};
83
84template<int dim>
85std::shared_ptr<const CutCellsQuad<dim>>
86 create_quadrature(const UnfittedDomain<dim> &unf_domain, const std::vector<int> &cells, int n_pts_dir);
87
88template<int dim>
89std::shared_ptr<const CutUnfBoundsQuad<dim>>
90 create_unfitted_bound_quadrature(const UnfittedDomain<dim> &unf_domain, const std::vector<int> &cells, int n_pts_dir);
91
92template<int dim>
93std::shared_ptr<const CutIsoBoundsQuad<dim - 1>> create_facets_quadrature(const UnfittedDomain<dim> &unf_domain,
94 const std::vector<int> &cells,
95 const std::vector<int> &facets,
96 int n_pts_dir);
97
98
99}// namespace qugar
100
101#endif// QUGAR_LIBRARY_CUT_QUADRATURE_HPP
Definition unfitted_domain.hpp:49
QUGaR's main namespace.
Definition affine_transf.hpp:28
std::shared_ptr< const CutIsoBoundsQuad< dim - 1 > > create_facets_quadrature(const UnfittedDomain< dim > &unf_domain, const std::vector< int > &cells, const std::vector< int > &facets, int n_pts_dir)
ImmersedStatus
Definition cut_quadrature.hpp:33
@ cut
Definition cut_quadrature.hpp:33
@ empty
Definition cut_quadrature.hpp:33
@ full
Definition cut_quadrature.hpp:33
std::shared_ptr< const CutUnfBoundsQuad< dim > > create_unfitted_bound_quadrature(const UnfittedDomain< dim > &unf_domain, const std::vector< int > &cells, int n_pts_dir)
std::shared_ptr< const CutCellsQuad< dim > > create_quadrature(const UnfittedDomain< dim > &unf_domain, const std::vector< int > &cells, int n_pts_dir)
Definition and implementation of Point class.
Definition cut_quadrature.hpp:36
std::vector< int > n_pts_per_cell
List of number of quadrature points per cut cell.
Definition cut_quadrature.hpp:40
std::vector< int > cells
List of cut cells.
Definition cut_quadrature.hpp:38
std::vector< real > weights
Vector of weights.
Definition cut_quadrature.hpp:45
std::vector< Point< dim > > points
Vector of points.
Definition cut_quadrature.hpp:43
void reserve(const int n_cells, const int n_tot_pts)
Definition cut_quadrature.hpp:51
std::vector< int > local_facet_ids
List of (local) facet ids associated to the vector cells.
Definition cut_quadrature.hpp:55
void reserve(const int n_cells, const int n_tot_pts)
std::vector< Point< dim > > points
Vector of points.
Definition cut_quadrature.hpp:60
std::vector< int > n_pts_per_facet
List of number of quadrature points per cut facet.
Definition cut_quadrature.hpp:57
std::vector< real > weights
Vector of weights.
Definition cut_quadrature.hpp:62
std::vector< int > cells
List of cut cells.
Definition cut_quadrature.hpp:53
Definition cut_quadrature.hpp:68
std::vector< Point< dim > > points
Vector of points.
Definition cut_quadrature.hpp:75
std::vector< real > weights
Vector of weights.
Definition cut_quadrature.hpp:77
std::vector< Point< dim > > normals
Vector of normals.
Definition cut_quadrature.hpp:79
std::vector< int > n_pts_per_cell
List of number of quadrature points per cut cell.
Definition cut_quadrature.hpp:72
void reserve(const int n_cells, const int n_tot_pts)
std::vector< int > cells
List of cut cells.
Definition cut_quadrature.hpp:70
Declaration of types.
Declaration of of UnfittedDomain class.