QUGaR 0.0.4
Loading...
Searching...
No Matches
qugar::impl::ImplReparamMesh< dim, range > Class Template Reference

Class for storing an implicit domain reparameterization using Lagrange cells. More...

#include <impl_reparam_mesh.hpp>

Inheritance diagram for qugar::impl::ImplReparamMesh< dim, range >:
[legend]
Collaboration diagram for qugar::impl::ImplReparamMesh< dim, range >:
[legend]

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.
 
- Public Member Functions inherited from qugar::ReparamMesh< dim, range >
 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 Public Member Functions inherited from qugar::ReparamMesh< dim, range >
static bool use_Chebyshev (int order)
 Determines whether the Chebyshev nodes are used, or equally spaced nodes.
 
- Static Public Attributes inherited from qugar::ReparamMesh< dim, range >
static const int chebyshev_order = 7
 
- Protected Member Functions inherited from qugar::ReparamMesh< dim, range >
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 ()
 
- Protected Attributes inherited from qugar::ReparamMesh< dim, range >
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.
 

Detailed Description

template<int dim, int range>
class qugar::impl::ImplReparamMesh< dim, range >

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.

Template Parameters
dimParametric dimension of the reparameterization.
rangeRange (or physical dimension) of the reparameterization.

Constructor & Destructor Documentation

◆ ImplReparamMesh()

template<int dim, int range>
qugar::impl::ImplReparamMesh< dim, range >::ImplReparamMesh ( int order)
explicit

Constructor.

Parameters
orderReparameterization order (number of points per direction).

Member Function Documentation

◆ generate_wirebasket() [1/3]

template<int dim, int range>
void qugar::impl::ImplReparamMesh< dim, range >::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 )
private

Generates the wirebasket for the current reparameterization.

Parameters
cell_idsList of cells ids to be considered for extracting the wirebasket.
domainDomain (bounding box) to which the reparameterization corresponds.
tolTolerance to be used if points belong to the wirebasket.
check_faceFunction returning true if an edge in a domain's face must be included in the wirebasket.
check_internalFunction returning true if an edge that does not correspond to neither a face nor an edge of domain must be included in the wirebasket.

◆ generate_wirebasket() [2/3]

template<int dim, int range>
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.

Parameters
impl_funcsImplicit functions defining the domain.
domainDomain (bounding box) to which the reparameterization corresponds.
tolTolerance to be used if points belong to the wirebasket.

◆ generate_wirebasket() [3/3]

template<int dim, int range>
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.

Parameters
impl_funcsList of implicit functions defining the domain.
cell_idsList of cells ids to be considered for extracting the wirebasket.
domainDomain (bounding box) to which the reparameterization corresponds.
tolTolerance to be used if points belong to the wirebasket.

◆ orient_cells_positively() [1/2]

template<int dim, int range>
template<int dim_aux = dim>
requires (dim_aux == dim && range == dim)
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.

Note
The wirebasket connectivity is not modified at all.

◆ orient_cells_positively() [2/2]

template<int dim, int range>
template<int dim_aux = dim>
requires (dim_aux == dim && range == dim)
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.

Parameters
cell_idsList of cells ids to be considered for reorientation.
Note
The wirebasket connectivity is not modified at all.

◆ orient_facet_cells_positively() [1/2]

template<int dim, int range>
template<int dim_aux = dim>
requires (dim_aux == dim && range == (dim + 1))
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.

Parameters
local_facet_idThe local ID of the facet to be oriented positively.

◆ orient_facet_cells_positively() [2/2]

template<int dim, int range>
template<int dim_aux = dim>
requires (dim_aux == dim && range == (dim + 1))
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.

Parameters
local_facet_idThe local ID of the facet to be oriented positively.
cell_idsList of cells ids to be considered for reorientation.

◆ orient_levelset_cells_positively() [1/3]

template<int dim, int range>
template<int dim_aux = dim>
requires (dim_aux == dim && range == (dim + 1))
void qugar::impl::ImplReparamMesh< dim, range >::orient_levelset_cells_positively ( const std::vector< int > & cell_ids,
const std::function< Point< range >(const Point< range > &)> & outer_normal_computer )
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.

Parameters
cell_idsList of cells ids to be considered for reorientation.
outer_normal_computerFunction providing the expected outer normal (to compare with) at a given point.
Note
The wirebasket connectivity is not modified at all.

◆ orient_levelset_cells_positively() [2/3]

template<int dim, int range>
template<int dim_aux = dim>
requires (dim_aux == dim && range == (dim + 1))
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.

Parameters
impl_funcsList of functions that define the implicit domain and according to which the orientation is computed.
Note
The wirebasket connectivity is not modified at all.

◆ orient_levelset_cells_positively() [3/3]

template<int dim, int range>
template<int dim_aux = dim>
requires (dim_aux == dim && range == (dim + 1))
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.

Parameters
impl_funcsList of functions that define the implicit domain and according to which the orientation is computed.
cell_idsList of cells ids to be considered for reorientation.
Note
The wirebasket connectivity is not modified at all.

The documentation for this class was generated from the following files: