QUGaR 0.0.4
|
Class for storing an implicit domain reparameterization using Lagrange cells. More...
#include <impl_reparam_mesh.hpp>
Public Member Functions | |
ImplReparamMesh (int order) | |
Constructor. | |
void | generate_wirebasket (const std::vector< std::reference_wrapper< const ImplicitFunc< range > > > &impl_funcs, const BoundBox< range > &domain, const Tolerance &tol) |
Generates the wirebasket for all the cells of the current reparameterization. | |
void | generate_wirebasket (const std::vector< std::reference_wrapper< const ImplicitFunc< range > > > &impl_funcs, const std::vector< int > &cell_ids, const BoundBox< range > &domain, const Tolerance &tol) |
Generates the wirebasket for the given cell_ids of the current reparameterization. | |
template<int dim_aux = dim> requires (dim_aux == dim && range == dim) | |
void | orient_cells_positively () |
Reorients the cells in the mesh to ensure they are oriented positively. | |
template<int dim_aux = dim> requires (dim_aux == dim && range == dim) | |
void | orient_cells_positively (const std::vector< int > &cell_ids) |
Reorients the cells in the mesh to ensure they are oriented positively. | |
template<int dim_aux = dim> requires (dim_aux == dim && range == (dim + 1)) | |
void | orient_levelset_cells_positively (const std::vector< std::reference_wrapper< const ImplicitFunc< range > > > &impl_funcs) |
Reorients the levelset cells in the mesh to ensure their normal is an outer normal. | |
template<int dim_aux = dim> requires (dim_aux == dim && range == (dim + 1)) | |
void | orient_levelset_cells_positively (const std::vector< std::reference_wrapper< const ImplicitFunc< range > > > &impl_funcs, const std::vector< int > &cell_ids) |
Reorients the levelset cells in the mesh to ensure their normal is an outer normal. | |
template<int dim_aux = dim> requires (dim_aux == dim && range == (dim + 1)) | |
void | orient_facet_cells_positively (int local_facet_id) |
Orients the cells reparameterization a domain facet positively. | |
template<int dim_aux = dim> requires (dim_aux == dim && range == (dim + 1)) | |
void | orient_facet_cells_positively (int local_facet_id, const std::vector< int > &cell_ids) |
Orients the cells reparameterization a domain facet positively. | |
![]() | |
ReparamMesh (int order) | |
Constructor. | |
virtual | ~ReparamMesh ()=default |
Default virtual destructor. | |
void | merge (const ReparamMesh< dim, range > &mesh) |
Merges the given mesh into the current mesh. | |
template<int aux_dim = dim> requires (aux_dim == dim && dim == range) | |
void | add_full_cell (const BoundBox< dim > &domain, bool wirebasket) |
Adds a full cell to the mesh corresponding to the given domain. | |
template<int aux_dim = dim> requires (aux_dim == dim && dim == range) | |
void | add_full_cells (const CartGridTP< dim > &grid, const std::vector< int > &cell_ids, bool wirebasket) |
Adds full cells to the mesh corresponding to the grid. | |
bool | use_Chebyshev () const |
Determines whether the Chebyshev nodes are used, or equally spaced nodes. | |
void | insert_cell_point (const Point< range > &point, int cell_id, int pt_id) |
This method sets the given point point , with index pt_id , to the cell designed by cell_id . | |
void | merge_coincident_points (const Tolerance &tol) |
Merges coincident points in the reparameterization up to tolerance. | |
void | scale_points (const std::vector< int > &point_ids, const BoundBox< range > &old_domain, const BoundBox< range > &new_domain) |
Scales points from an old domain to a new domain. | |
void | scale_points (const BoundBox< range > &old_domain, const BoundBox< range > &new_domain) |
Scales points from an old domain to a new domain. | |
const std::vector< Point< range > > & | get_points () const |
Retrieves the points the reparameterization points. | |
const std::vector< std::size_t > & | get_connectivity () const |
Retrieves the reparameterization connectivity. | |
const std::vector< std::size_t > & | get_wires_connectivity () const |
Retrieves the wirebasket reparameterization connectivity. | |
int | get_order () const |
Retrieves the reparameterization's order. | |
std::size_t | get_num_cells () const |
Retrieves the number of reparameterization cells. | |
std::size_t | get_num_points () const |
Retrieves the number of points. | |
std::size_t | get_num_points_per_cell () const |
Retrieves the number of points per cell, that depends on the reparameterization order. | |
void | write_VTK_file (const std::string &filename) const |
Writes the reparameterization data to a VTK file. | |
void | permute_cell_directions (std::size_t cell_id) |
Permutes the directions of the given cell. | |
void | reserve_cells (std::size_t n_new_cells) |
Reserves memory for a specified number of cells. | |
int | allocate_cells (std::size_t n_new_cells) |
Allocates memory for a specified number of cells. | |
Private Member Functions | |
void | generate_wirebasket (const std::vector< int > &cell_ids, const BoundBox< range > &domain, const Tolerance &tol, const std::function< bool(const Point< range > &)> &check_face, const std::function< bool(const Point< range > &)> &check_internal) |
Generates the wirebasket for the current reparameterization. | |
template<int dim_aux = dim> requires (dim_aux == dim && range == (dim + 1)) | |
void | orient_levelset_cells_positively (const std::vector< int > &cell_ids, const std::function< Point< range >(const Point< range > &)> &outer_normal_computer) |
Reorients the levelset cells in the mesh to ensure their normal is an outer normal. | |
Additional Inherited Members | |
![]() | |
static bool | use_Chebyshev (int order) |
Determines whether the Chebyshev nodes are used, or equally spaced nodes. | |
![]() | |
static const int | chebyshev_order = 7 |
![]() | |
template<int sub_dim> | |
bool | check_edge_in_subdomain (const std::vector< std::size_t > &edge_points_ids, const BoundBox< range > &domain, const Tolerance &tol) const |
Checks if a reparameterization cell's edge belongs to a subentity of a domain . | |
bool | check_subentity_degenerate (const std::vector< std::size_t > &points_ids, const Tolerance &tol) const |
Checks if a reparameterization cell's sub-entity is degenerate (it has zero length). | |
template<int aux_dim = dim> requires (aux_dim == dim && 1 < dim) | |
std::vector< std::size_t > | get_edge_points (int cell_id, int edge_id) const |
Gets the ids of the points of an edge of a reparameterization cell. | |
void | sort_edge_points (std::span< std::size_t > edge_points_ids) const |
Sorts the given edge points by their IDs. | |
void | sort_wirebasket_edges () |
void | purge_duplicate_wirebasket_edges () |
![]() | |
int | order_ |
Reparameterization order (number of points per direction). | |
std::vector< Point< range > > | points_ |
Vector of points. | |
std::vector< std::size_t > | connectivity_ |
Cells' connectivity. | |
std::vector< std::size_t > | wires_connectivity_ |
Cells wires' connectivity. | |
Class for storing an implicit domain reparameterization using Lagrange cells.
This reparameterization is non-conforming (it may contain hanging nodes), but is intended to be used for visualization purposes.
It stores the cells as a list of point and the connectivity. It also stores the connectivity for the wirebasket of the reparameterization.
dim | Parametric dimension of the reparameterization. |
range | Range (or physical dimension) of the reparameterization. |
|
explicit |
Constructor.
order | Reparameterization order (number of points per direction). |
|
private |
Generates the wirebasket for the current reparameterization.
cell_ids | List of cells ids to be considered for extracting the wirebasket. |
domain | Domain (bounding box) to which the reparameterization corresponds. |
tol | Tolerance to be used if points belong to the wirebasket. |
check_face | Function returning true if an edge in a domain's face must be included in the wirebasket. |
check_internal | Function returning true if an edge that does not correspond to neither a face nor an edge of domain must be included in the wirebasket. |
void qugar::impl::ImplReparamMesh< dim, range >::generate_wirebasket | ( | const std::vector< std::reference_wrapper< const ImplicitFunc< range > > > & | impl_funcs, |
const BoundBox< range > & | domain, | ||
const Tolerance & | tol ) |
Generates the wirebasket for all the cells of the current reparameterization.
impl_funcs | Implicit functions defining the domain. |
domain | Domain (bounding box) to which the reparameterization corresponds. |
tol | Tolerance to be used if points belong to the wirebasket. |
void qugar::impl::ImplReparamMesh< dim, range >::generate_wirebasket | ( | const std::vector< std::reference_wrapper< const ImplicitFunc< range > > > & | impl_funcs, |
const std::vector< int > & | cell_ids, | ||
const BoundBox< range > & | domain, | ||
const Tolerance & | tol ) |
Generates the wirebasket for the given cell_ids
of the current reparameterization.
impl_funcs | List of implicit functions defining the domain. |
cell_ids | List of cells ids to be considered for extracting the wirebasket. |
domain | Domain (bounding box) to which the reparameterization corresponds. |
tol | Tolerance to be used if points belong to the wirebasket. |
void qugar::impl::ImplReparamMesh< dim, range >::orient_cells_positively | ( | ) |
Reorients the cells in the mesh to ensure they are oriented positively.
This function modifies the orientation of the cells (by modifying its connectivity) in the mesh so that all cells have a positive orientation.
Positive orientation is considered the one such that determinant of the Jacobian (evaluated at the cell's mid-point) is positive.
This is typically required for consistency in computational geometry and finite element methods, where the orientation of cells can affect the results of calculations.
void qugar::impl::ImplReparamMesh< dim, range >::orient_cells_positively | ( | const std::vector< int > & | cell_ids | ) |
Reorients the cells in the mesh to ensure they are oriented positively.
This function modifies the orientation of the cells (by modifying its connectivity) in the mesh so that all cells have a positive orientation.
Positive orientation is considered the one such that determinant of the Jacobian (evaluated at the cell's mid-point) is positive.
This is typically required for consistency in computational geometry and finite element methods, where the orientation of cells can affect the results of calculations.
cell_ids | List of cells ids to be considered for reorientation. |
void qugar::impl::ImplReparamMesh< dim, range >::orient_facet_cells_positively | ( | int | local_facet_id | ) |
Orients the cells reparameterization a domain facet positively.
This function ensures that the cells reparameterizing a facet are oriented positively according to the specified local facet ID of a hyperrectangular domain. I.e., the cells normals are oriented towards the exterior of the domain.
local_facet_id | The local ID of the facet to be oriented positively. |
void qugar::impl::ImplReparamMesh< dim, range >::orient_facet_cells_positively | ( | int | local_facet_id, |
const std::vector< int > & | cell_ids ) |
Orients the cells reparameterization a domain facet positively.
This function ensures that the cells reparameterizing a facet are oriented positively according to the specified local facet ID of a hyperrectangular domain. I.e., the cells normals are oriented towards the exterior of the domain.
local_facet_id | The local ID of the facet to be oriented positively. |
cell_ids | List of cells ids to be considered for reorientation. |
|
private |
Reorients the levelset cells in the mesh to ensure their normal is an outer normal.
This function modifies the orientation of the levelset cells (by modifying its connectivity) in the mesh so that all cells have a positive orientation.
Positive orientation is considered the one such that the cell normal (evaluated at the cell's mid-point) goes along the normal provided by the given function at that point. I.e., the dot product between both normals is positive.
This is typically required for consistency in computational geometry and finite element methods, where the orientation of cells can affect the results of calculations.
cell_ids | List of cells ids to be considered for reorientation. |
outer_normal_computer | Function providing the expected outer normal (to compare with) at a given point. |
void qugar::impl::ImplReparamMesh< dim, range >::orient_levelset_cells_positively | ( | const std::vector< std::reference_wrapper< const ImplicitFunc< range > > > & | impl_funcs | ) |
Reorients the levelset cells in the mesh to ensure their normal is an outer normal.
This function modifies the orientation of the levelset cells (by modifying its connectivity) in the mesh so that all cells have a positive orientation.
Positive orientation is considered the one such that the cell normal (evaluated at the cell's mid-point) goes along the normal provided by the given implicit functions at that point. I.e., the dot product between both normals is positive.
Among all the provided functions, the one whose value at the mid-point is minimum is chosen for evaluating its normals.
This is typically required for consistency in computational geometry and finite element methods, where the orientation of cells can affect the results of calculations.
impl_funcs | List of functions that define the implicit domain and according to which the orientation is computed. |
void qugar::impl::ImplReparamMesh< dim, range >::orient_levelset_cells_positively | ( | const std::vector< std::reference_wrapper< const ImplicitFunc< range > > > & | impl_funcs, |
const std::vector< int > & | cell_ids ) |
Reorients the levelset cells in the mesh to ensure their normal is an outer normal.
This function modifies the orientation of the levelset cells (by modifying its connectivity) in the mesh so that all cells have a positive orientation.
Positive orientation is considered the one such that the cell normal (evaluated at the cell's mid-point) goes along the normal provided by the given implicit functions at that point. I.e., the dot product between both normals is positive.
Among all the provided functions, the one whose value at the mid-point is minimum is chosen for evaluating its normals.
This is typically required for consistency in computational geometry and finite element methods, where the orientation of cells can affect the results of calculations.
impl_funcs | List of functions that define the implicit domain and according to which the orientation is computed. |
cell_ids | List of cells ids to be considered for reorientation. |