#include <HiReconstruction.hpp>
Public Member Functions | |
HiReconstruction (Core *impl, ParallelComm *comm=0, EntityHandle meshIn=0, int minpnts=5, bool recwhole=true) | |
~HiReconstruction () | |
ErrorCode | initialize (bool recwhole) |
ErrorCode | reconstruct3D_surf_geom (int degree, bool interp, bool safeguard, bool reset=false) |
Reconstruct a high order surface on given surface mesh. More... | |
ErrorCode | reconstruct3D_surf_geom (size_t npts, int *degrees, bool *interps, bool safeguard, bool reset=false) |
Reconstruct a high order surface on given surface mesh. More... | |
ErrorCode | reconstruct3D_curve_geom (int degree, bool interp, bool safeguard, bool reset=false) |
Reconstruct a high order curve on given curve mesh. More... | |
ErrorCode | reconstruct3D_curve_geom (size_t npts, int *degrees, bool *interps, bool safeguard, bool reset=false) |
Reconstruct a high order curve on given curve mesh. More... | |
ErrorCode | polyfit3d_walf_surf_vertex (const EntityHandle vid, const bool interp, int degree, int minpnts, const bool safeguard, const int ncoords, double *coords, int *degree_out, const int ncoeffs, double *coeffs) |
Construct vertex based polynomial fitting on a surface mesh. More... | |
ErrorCode | polyfit3d_walf_curve_vertex (const EntityHandle vid, const bool interp, int degree, int minpnts, const bool safeguard, const int ncoords, double *coords, int *degree_out, const int ncoeffs, double *coeffs) |
Construct vertex based polynomial fitting on a curve mesh. More... | |
ErrorCode | hiproj_walf_in_element (EntityHandle elem, const int nvpe, const int npts2fit, const double *naturalcoords2fit, double *newcoords) |
Perform high order projection of points in an element, using estimated geometry by reconstruction class. More... | |
ErrorCode | hiproj_walf_around_vertex (EntityHandle vid, const int npts2fit, const double *coords2fit, double *hiproj_new) |
Perform high order projection of points around a vertex, using estimated geometry by reconstruction class. More... | |
void | walf3d_surf_vertex_eval (const double *local_origin, const double *local_coords, const int local_deg, const double *local_coeffs, const bool interp, const int npts2fit, const double *coords2fit, double *hiproj_new) |
Perform high order projection of points around a center vertex, assume geometry is surface. More... | |
void | walf3d_curve_vertex_eval (const double *local_origin, const double *local_coords, const int local_deg, const double *local_coeffs, const bool interp, const int npts2fit, const double *coords2fit, double *hiproj_new) |
Perform high order projection of points around a center vertex, assume geometry is curve. More... | |
bool | get_fittings_data (EntityHandle vid, GEOMTYPE &geomtype, std::vector< double > &coords, int °ree_out, std::vector< double > &coeffs, bool &interp) |
Get interally stored fitting results. More... | |
Static Public Member Functions | |
static int | estimate_num_ghost_layers (int degree, bool interp=false) |
Protected Member Functions | |
HiReconstruction (const HiReconstruction &source) | |
HiReconstruction & | operator= (const HiReconstruction &right) |
int | estimate_num_rings (int degree, bool interp) |
ErrorCode | vertex_get_incident_elements (const EntityHandle &vid, const int elemdim, std::vector< EntityHandle > &adjents) |
Given a vertex, return the incident elements with dimension elemdim. More... | |
ErrorCode | obtain_nring_ngbvs (const EntityHandle vid, int ring, const int minpnts, Range &ngbvs) |
Get n-ring neighbor vertices, assuming curve/surface mesh, not volume mesh. More... | |
void | initialize_surf_geom (const int degree) |
void | initialize_surf_geom (const size_t npts, const int *degrees) |
void | initialize_3Dcurve_geom (const int degree) |
void | initialize_3Dcurve_geom (const size_t npts, const int *degrees) |
ErrorCode | average_vertex_normal (const EntityHandle vid, double *nrm) |
ErrorCode | compute_average_vertex_normals_surf () |
ErrorCode | get_normals_surf (const Range &vertsh, double *nrms) |
ErrorCode | average_vertex_tangent (const EntityHandle vid, double *tang) |
ErrorCode | compute_average_vertex_tangents_curve () |
ErrorCode | get_tangents_curve (const Range &vertsh, double *tangs) |
void | polyfit3d_surf_get_coeff (const int nverts, const double *ngbcors, const double *ngbnrms, int degree, const bool interp, const bool safeguard, const int ncoords, double *coords, const int ncoeffs, double *coeffs, int *degree_out, int *degree_pnt, int *degree_qr) |
Compute local coordinates system of a vertex, and perform vertex based polynomial fittings of local height function. More... | |
void | eval_vander_bivar_cmf (const int npts2fit, const double *us, const int ndim, double *bs, int degree, const double *ws, const bool interp, const bool safeguard, int *degree_out, int *degree_pnt, int *degree_qr) |
Form and solve Vandermonde system of bi-variables. More... | |
void | polyfit3d_curve_get_coeff (const int nverts, const double *ngbcors, const double *ngbtangs, int degree, const bool interp, const bool safeguard, const int ncoords, double *coords, const int ncoeffs, double *coeffs, int *degree_out) |
Compute local single variable coordinate system of a vertex, and perform vertex based polynomial fittings of three global coordinates axis. More... | |
void | eval_vander_univar_cmf (const int npts2fit, const double *us, const int ndim, double *bs, int degree, const double *ws, const bool interp, const bool safeguard, int *degree_out) |
Form and solve Vandermonde system of single-variables. More... | |
int | compute_weights (const int nrows, const int ncols, const double *us, const int nngbs, const double *ngbnrms, const int degree, const double toler, double *ws) |
Compute weights for points selected in weighted least square fittigns. More... | |
bool | check_barycentric_coords (const int nws, const double *naturalcoords) |
Check the correctness of barycentric coordination, wi>=0 and sum(wi)=1. More... | |
Protected Attributes | |
Core * | mbImpl |
ParallelComm * | pcomm |
HalfFacetRep * | ahf |
EntityHandle | _mesh2rec |
Range | _verts2rec |
Range | _inverts |
Range | _inedges |
Range | _infaces |
Range | _incells |
size_t | _nv2rec |
int | _MAXPNTS |
int | _MINPNTS |
double | _MINEPS |
bool | _hasderiv |
GEOMTYPE | _geom |
int | _dim |
bool | _hasfittings |
bool | _initfittings |
std::vector< double > | _local_coords |
std::vector< double > | _local_fit_coeffs |
std::vector< size_t > | _vertID2coeffID |
std::vector< int > | _degrees_out |
std::vector< bool > | _interps |
Definition at line 39 of file HiReconstruction.hpp.
moab::HiReconstruction::HiReconstruction | ( | Core * | impl, |
ParallelComm * | comm = 0 , |
||
EntityHandle | meshIn = 0 , |
||
int | minpnts = 5 , |
||
bool | recwhole = true |
||
) |
Definition at line 18 of file HiReconstruction.cpp.
References _dim, _hasderiv, _hasfittings, _MINEPS, moab::error(), ErrorCode, moab::ParallelComm::get_pcomm(), initialize(), MB_SUCCESS, mbImpl, and pcomm.
moab::HiReconstruction::~HiReconstruction | ( | ) |
Definition at line 42 of file HiReconstruction.cpp.
References ahf.
|
protected |
|
protected |
Save fitting results of a vertex into internal storage
vid | EntityHandle, a vertex in _mesh2rec, in _verts2rec |
coords | Pointer to double array, global coordinates of local uvw coordinate system axis directions |
degree_out | Integer, order of polynomial fittings for vid |
coeffs | Pointer to double array, coefficients of local polynomial fittings in monomial basis |
interp | Boolean, true = interpolation Compute area weighted average vertex normals for given vertex, assuming surface mesh For arbitrary polygon mesh, use incident two edges of each incident polygon of this vertex to form a triangle, then use these incident "triangles" to compute area weighted average vertex normals |
vid | EntityHandle, vertex in _mesh2rec, might be ghost vertex |
nrm | Pointer to 3-doubles array, preallocated by user |
Definition at line 841 of file HiReconstruction.cpp.
References moab::error(), ErrorCode, moab::Core::get_connectivity(), moab::Core::get_coords(), MB_CHK_ERR, MB_SET_ERR, mbImpl, moab::DGMSolver::vec_crossprod(), moab::DGMSolver::vec_linear_operation(), moab::DGMSolver::vec_normalize(), and vertex_get_incident_elements().
Referenced by compute_average_vertex_normals_surf(), and get_normals_surf().
|
protected |
Compute area weighted average vertex tangent vector for given vertex, assuming curve mesh Use incident two edges of vertex as estimatation of tangent vectors, weighted by length
vid | EntityHandle, vertex in _mesh2rec, might be ghost vertex |
tang | Pointer to 3-doubles array, preallocated by user |
Definition at line 943 of file HiReconstruction.cpp.
References moab::error(), ErrorCode, moab::Core::get_connectivity(), moab::Core::get_coords(), MB_CHK_ERR, MB_SET_ERR, mbImpl, moab::DGMSolver::vec_linear_operation(), moab::DGMSolver::vec_normalize(), and vertex_get_incident_elements().
Referenced by compute_average_vertex_tangents_curve(), and get_tangents_curve().
|
protected |
Check the correctness of barycentric coordination, wi>=0 and sum(wi)=1.
Definition at line 1593 of file HiReconstruction.cpp.
References _MINEPS, and moab::sum().
Referenced by hiproj_walf_in_element().
|
protected |
Compute weighted average vertex normals for all vertices in _verts2rec, not including ghost vertices, results are stored interally in _local_coords
Definition at line 887 of file HiReconstruction.cpp.
References _hasderiv, _local_coords, _nv2rec, _verts2rec, average_vertex_normal(), moab::Range::begin(), moab::Range::end(), moab::error(), ErrorCode, MB_CHK_ERR, and MB_SUCCESS.
Referenced by initialize(), and initialize_surf_geom().
|
protected |
Compute weighted average vertex tangent vectors for all vertices in _verts2rec, not including ghost vertices, results are stored interally in _local_coords
Definition at line 974 of file HiReconstruction.cpp.
References _hasderiv, _local_coords, _nv2rec, _verts2rec, average_vertex_tangent(), moab::Range::begin(), moab::Range::end(), moab::error(), ErrorCode, MB_CHK_ERR, and MB_SUCCESS.
Referenced by initialize(), and initialize_3Dcurve_geom().
|
protected |
Compute weights for points selected in weighted least square fittigns.
Definition at line 1544 of file HiReconstruction.cpp.
References _MAXPNTS, and moab::DGMSolver::vec_innerprod().
Referenced by polyfit3d_curve_get_coeff(), and polyfit3d_surf_get_coeff().
|
inlinestatic |
Definition at line 277 of file HiReconstruction.hpp.
|
protected |
Definition at line 653 of file HiReconstruction.cpp.
Referenced by polyfit3d_walf_curve_vertex(), and polyfit3d_walf_surf_vertex().
|
protected |
Form and solve Vandermonde system of bi-variables.
Definition at line 1176 of file HiReconstruction.cpp.
References moab::DGMSolver::backsolve(), moab::DGMSolver::backsolve_polyfit_safeguarded(), moab::DGMSolver::compute_qtransposeB(), moab::DGMSolver::gen_vander_multivar(), moab::DGMSolver::qr_polyfit_safeguarded(), and moab::DGMSolver::rescale_matrix().
Referenced by polyfit3d_surf_get_coeff().
|
protected |
Form and solve Vandermonde system of single-variables.
Definition at line 1434 of file HiReconstruction.cpp.
References moab::DGMSolver::backsolve(), moab::DGMSolver::backsolve_polyfit_safeguarded(), moab::DGMSolver::compute_qtransposeB(), moab::DGMSolver::gen_vander_multivar(), moab::DGMSolver::qr_polyfit_safeguarded(), and moab::DGMSolver::rescale_matrix().
Referenced by polyfit3d_curve_get_coeff().
bool moab::HiReconstruction::get_fittings_data | ( | EntityHandle | vid, |
GEOMTYPE & | geomtype, | ||
std::vector< double > & | coords, | ||
int & | degree_out, | ||
std::vector< double > & | coeffs, | ||
bool & | interp | ||
) |
Get interally stored fitting results.
Get fittings results of a vertex, stored internally, results will be writtend to user provided memory
vid | EntityHandle, a vertex in _verts2rec |
geomtype | GEOMTYPE, one of HISURFACE,HI3DCURVE,HI2DCURVE |
coords | vector, global coordinates of local uvw coordinate system axis directions will be appended to the end of coords |
degree_out | Reference to Integer, order of polynomial fittings for vid |
coeffs | vector, coefficients of local polynomial fittings in monomial basis will be appended to the end of coeffs |
interp | Reference to Boolean, true = interpolation |
Definition at line 607 of file HiReconstruction.cpp.
References _degrees_out, _geom, _hasfittings, _interps, _local_coords, _local_fit_coeffs, _vertID2coeffID, _verts2rec, moab::HI3DCURVE, moab::HISURFACE, and moab::Range::index().
|
protected |
Return the normals of given vertices in a Range, writing to preallocated memory If normals have been computed and stored, just access them If not, compute on the fly
vertsh | Range, EntityHandles of vertices |
nrms | Pointer of array of doubles, size = 3*vertsh.size() |
Definition at line 903 of file HiReconstruction.cpp.
References _hasderiv, _local_coords, _verts2rec, average_vertex_normal(), moab::Range::begin(), moab::Range::end(), moab::error(), ErrorCode, moab::Range::index(), MB_CHK_ERR, and MB_SUCCESS.
Referenced by polyfit3d_walf_surf_vertex().
|
protected |
Return the tangent vectors of given vertices in a Range, writing to preallocated memory If tangent vectors have been computed and stored, just access them If not, compute on the fly
vertsh | Range, EntityHandles of vertices |
tangs | Pointer of array of doubles, size = 3*vertsh.size() |
Definition at line 990 of file HiReconstruction.cpp.
References _hasderiv, _local_coords, _verts2rec, average_vertex_tangent(), moab::Range::begin(), moab::Range::end(), moab::error(), ErrorCode, moab::Range::index(), MB_CHK_ERR, and MB_SUCCESS.
Referenced by polyfit3d_walf_curve_vertex().
ErrorCode moab::HiReconstruction::hiproj_walf_around_vertex | ( | EntityHandle | vid, |
const int | npts2fit, | ||
const double * | coords2fit, | ||
double * | hiproj_new | ||
) |
Perform high order projection of points around a vertex, using estimated geometry by reconstruction class.
Given an vertex on the input mesh, and new points around this vertex, estimate their position in surface. This is done by first projecting input points onto the local uv-plane around this vertex and use the precomputed local fitting to estimate the ideal position of input points. The result will be returned to the user preallocated memory
vid | EntityHandle, the vertex around which to perform high order projection. |
npts2fit | Integer, number of points lying around vid to be fitted. |
coords2fit | Pointer to array of doubles, size=3*npts2fit, current coordinates of points to be projected. |
newcoords | Pointer to array of doubles, preallocated by user, size=3*npts2fit, estimated positions of input points. |
Definition at line 468 of file HiReconstruction.cpp.
References _degrees_out, _geom, _hasfittings, _interps, _local_coords, _local_fit_coeffs, _vertID2coeffID, _verts2rec, moab::error(), ErrorCode, moab::Core::get_coords(), moab::HI3DCURVE, moab::HISURFACE, moab::Range::index(), MB_CHK_ERR, MB_SET_ERR, mbImpl, walf3d_curve_vertex_eval(), and walf3d_surf_vertex_eval().
Referenced by hiproj_walf_in_element().
ErrorCode moab::HiReconstruction::hiproj_walf_in_element | ( | EntityHandle | elem, |
const int | nvpe, | ||
const int | npts2fit, | ||
const double * | naturalcoords2fit, | ||
double * | newcoords | ||
) |
Perform high order projection of points in an element, using estimated geometry by reconstruction class.
Given an element on the input mesh, and new points in this element, represented as natural coordinates in element, estimate their position in surface. This is done by weighted averaging of local fittings: for each vertex of this elment, a fitting has been computed and the new points could be projected by this fitting. The final result of projection is the weighted average of these projections, weights are chosen as the barycentric coordinates of the point in this element. The result will be returned to the user preallocated memory
elem | EntityHandle, the element on which to perform high order projection. |
nvpe | Integer, number of nodes of this element, triangle is 3, quad is four. |
npts2fit | Integer, number of points lying in elem to be projected. |
naturalcoords2fit | Pointer to array of doubles, size=nvpe*npts2fit, natural coordinates in elem of points to be projected. |
newcoords | Pointer to array of doubles, preallocated by user, size=3*npts2fit, estimated positions of input points. |
Definition at line 389 of file HiReconstruction.cpp.
References _hasfittings, _verts2rec, check_barycentric_coords(), moab::error(), ErrorCode, moab::Core::get_connectivity(), moab::Core::get_coords(), hiproj_walf_around_vertex(), moab::Range::index(), MB_CHK_ERR, MB_SET_ERR, and mbImpl.
ErrorCode moab::HiReconstruction::initialize | ( | bool | recwhole | ) |
Definition at line 51 of file HiReconstruction.cpp.
References _dim, _hasderiv, _incells, _inedges, _infaces, _inverts, _MAXPNTS, _mesh2rec, _nv2rec, _verts2rec, ahf, compute_average_vertex_normals_surf(), compute_average_vertex_tangents_curve(), moab::Range::empty(), moab::error(), ErrorCode, moab::ParallelComm::filter_pstatus(), moab::Core::get_entities_by_dimension(), moab::HalfFacetRep::initialize(), MB_CHK_ERR, MB_MEMORY_ALLOCATION_FAILED, MB_SET_ERR, mbImpl, pcomm, PSTATUS_GHOST, PSTATUS_NOT, and moab::Range::size().
Referenced by HiReconstruction().
|
protected |
Definition at line 780 of file HiReconstruction.cpp.
References _degrees_out, _hasderiv, _initfittings, _interps, _local_fit_coeffs, _nv2rec, _vertID2coeffID, and compute_average_vertex_tangents_curve().
Referenced by reconstruct3D_curve_geom().
|
protected |
Definition at line 802 of file HiReconstruction.cpp.
References _degrees_out, _hasderiv, _hasfittings, _initfittings, _interps, _local_fit_coeffs, _nv2rec, _vertID2coeffID, and compute_average_vertex_tangents_curve().
|
protected |
Initialize the storage for fitting results over _mesh2rec, curve/surface mesh Two options are provided: a) use uniform degree for all vertices b) use customized degrees for different vertices After calling of initializing functions, _initfitting is set to be true, the fitting result could be stored internally
Definition at line 734 of file HiReconstruction.cpp.
References _degrees_out, _hasderiv, _initfittings, _interps, _local_fit_coeffs, _nv2rec, _vertID2coeffID, and compute_average_vertex_normals_surf().
Referenced by reconstruct3D_surf_geom().
|
protected |
Definition at line 756 of file HiReconstruction.cpp.
References _degrees_out, _hasderiv, _initfittings, _interps, _local_fit_coeffs, _nv2rec, _vertID2coeffID, and compute_average_vertex_normals_surf().
|
protected |
Get n-ring neighbor vertices, assuming curve/surface mesh, not volume mesh.
Given a vertex, find its n-ring neighbor vertices including itself in _mesrh2rec. 1-ring neighbor vertices of a vertex are the vertices connected with this vertex with an edge n-ring vertices are obtained first get the 1-ring vertices and then get the 1-ring of these vertices, and so on
vid | EntityHandle, vertex around which to get n-ring vertices |
ring | Integer, number of rings |
minpnts | Integer, number of minimum vertices to obtain, if the input ring could not provide enough vertices, i.e. more than minpnts, then expand the number of rings |
ngbvs | Range, the n-ring vertices of vid, including vid. If too many points found, i.e. more than _MAXPNTS, then terminate early. |
Definition at line 672 of file HiReconstruction.cpp.
References _dim, _MAXPNTS, center(), moab::Range::end(), moab::error(), ErrorCode, moab::Range::find(), moab::Core::get_connectivity(), moab::Range::insert(), MB_CHK_ERR, mbImpl, moab::Range::size(), and vertex_get_incident_elements().
Referenced by polyfit3d_walf_curve_vertex(), and polyfit3d_walf_surf_vertex().
|
protected |
|
protected |
Compute local single variable coordinate system of a vertex, and perform vertex based polynomial fittings of three global coordinates axis.
This function take the first vertex of input as center, and build local u-line by estimating tangent vector Then other vertices form vectors originating from center and vectors then are projectd onto this u-plane to form three local height functions, one for each coordinates axis. Local fitting of these local height functions are performed in WLS sense, according if interpolation required or not.
nverts | Integer, number of vertices of input |
ngbcors | Pointer to array of doubles, size = 3*nverts, coordinates of input vertices, first will be center |
ngbtangs | Pointer to array of doubles, size = 3*nverts, vertex tangent vectors of input vertices |
degree | Integer, user specified fitting degree |
interp | Boolean, user input, interpolation or not |
safeguard | Boolean, true = use safeguarded numerical method in computing |
ncoords | Integer, size of *coords, should be 3, used for check |
coords | Pointer to array of doubles, preallocated memory for storing the glocal coordinates of local u axis direction |
ncoeffs | Integer, size of coeffs, should be 3(degree+1), used for check |
coeffs | Pointer to array of doubles, preallocated memory for storing coefficients of local fittings in monomial basis |
degree_out | Pointer to integer, order of resulted polynomial of fitting, could be downgraded due to numerical issues |
Definition at line 1318 of file HiReconstruction.cpp.
References _MINEPS, compute_weights(), eval_vander_univar_cmf(), moab::DGMSolver::vec_innerprod(), and moab::DGMSolver::vec_linear_operation().
Referenced by polyfit3d_walf_curve_vertex().
|
protected |
Compute local coordinates system of a vertex, and perform vertex based polynomial fittings of local height function.
This function take the first vertex of input as center, and build local uv-plane by estimating vertex normals and tangent planes Then other vertices forms vectors starting from center and then are projectd onto this uv-plane to form a local height function. Local fitting of this local height function is performed in WLS sense, according if interpolation required or not.
nverts | Integer, number of vertices of input |
ngbcors | Pointer to array of doubles, size = 3*nverts, coordinates of input vertices, first will be center |
ngbnrms | Pointer to array of doubles, size = 3*nverts, vertex normals of input vertices |
degree | Integer, user specified fitting degree |
interp | Boolean, user input, interpolation or not |
safeguard | Boolean, true = use safeguarded numerical method in computing |
ncoords | Integer, size of *coords, should be 9, used for check |
coords | Pointer to array of doubles, preallocated memory for storing the glocal coordinates of local uvw axis directions |
ncoeffs | Integer, size of *coeffs, should be (degree+2)(degree+1)/2, used for check |
coeffs | Pointer to array of doubles, preallocated memory for storing coefficients of local fittings in monomial basis |
degree_out | Pointer to integer, order of resulted polynomial of fitting, could be downgraded due to numerical issues |
degree_pnt | Pointer to integer, polynomial fitting order determined by stencil size/number of points |
degree_qr | Pointer to integer, polynomial fitting order determined by Vandermonde system condition number |
Definition at line 1033 of file HiReconstruction.cpp.
References _MINEPS, compute_weights(), eval_vander_bivar_cmf(), moab::DGMSolver::vec_crossprod(), moab::DGMSolver::vec_innerprod(), moab::DGMSolver::vec_linear_operation(), moab::DGMSolver::vec_normalize(), and moab::DGMSolver::vec_projoff().
Referenced by polyfit3d_walf_surf_vertex().
ErrorCode moab::HiReconstruction::polyfit3d_walf_curve_vertex | ( | const EntityHandle | vid, |
const bool | interp, | ||
int | degree, | ||
int | minpnts, | ||
const bool | safeguard, | ||
const int | ncoords, | ||
double * | coords, | ||
int * | degree_out, | ||
const int | ncoeffs, | ||
double * | coeffs | ||
) |
Construct vertex based polynomial fitting on a curve mesh.
Given a vertex on a curve mesh, construct three one-parameter local fittings for each coordinates axis around this vertex. Stencils around this vertex will be selected according to input degree and if data is noise. Local u-line, or the single parameter will be the estimated tangent line at this vertex. On each axis of xyz, a polynomial fitting will be performed according to user input. minpnts will be used to specify the minimum number allowed in the local stencil. The result will be returned to user by preallocated memory coords, degree_out, coeffs.
vid | EntityHandle, the fittings will be performed around this vertex. |
interp | Boolean, true=Interpolation, false=least square fitting. |
degree | Integer, order of polynomials used for local fittings. |
minpnts | Integer, the allowed minimum number of vertices in local stencil. If too small, the resulted fitting might be low order accurate. If too large, it may introduce overfitting. |
safeguard | Boolean, true=using safe guarded method in numerical computing. |
coords | Pointer to double, preallocated memory by user, should have at least 3 doubles; stores the global coordinates of local coordinate system u direction. |
degree_out | Pointer to integer, used to store the degree of resulted fitting |
coeffs,Pointer | to double, preallocated memory for coefficients of local fittings, should have at least 3*(degree+1) doubles. |
Definition at line 344 of file HiReconstruction.cpp.
References moab::error(), ErrorCode, estimate_num_rings(), moab::Core::get_coords(), get_tangents_curve(), moab::Range::index(), MB_CHK_ERR, mbImpl, obtain_nring_ngbvs(), polyfit3d_curve_get_coeff(), and moab::Range::size().
Referenced by reconstruct3D_curve_geom().
ErrorCode moab::HiReconstruction::polyfit3d_walf_surf_vertex | ( | const EntityHandle | vid, |
const bool | interp, | ||
int | degree, | ||
int | minpnts, | ||
const bool | safeguard, | ||
const int | ncoords, | ||
double * | coords, | ||
int * | degree_out, | ||
const int | ncoeffs, | ||
double * | coeffs | ||
) |
Construct vertex based polynomial fitting on a surface mesh.
Given a vertex on a surface mesh, construct a local fitting around this vertex. Stencils around this vertex will be selected according to input degree and if data is noise. Local uv-plane will be the estimated tangent plane at this vertex. minpnts will be used to specify the minimum number allowed in the local stencil. The result will be returned to user by preallocated memory coords, degree_out, coeffs.
vid | EntityHandle, the fitting will be performed around this vertex for the local height function over the uv-plane. |
interp | Boolean, true=Interpolation, false=least square fitting. |
degree | Integer, order of polynomials used for local fittings. |
minpnts | Integer, the allowed minimum number of vertices in local stencil. If too small, the resulted fitting might be low order accurate. If too large, it may introduce overfitting. |
safeguard | Boolean, true=using safe guarded method in numerical computing. |
coords | Pointer to double, preallocated memory by user, should have at least 9 doubles; stores the global coordinates of local coordinates system uvw directions. |
degree_out | Pointer to integer, used to store the degree of resulted fitting |
coeffs,Pointer | to double, preallocated memory for coefficients of local fittings, should have at least (degree+2)(degree+1)/2 doubles. |
Definition at line 294 of file HiReconstruction.cpp.
References _dim, moab::error(), ErrorCode, estimate_num_rings(), moab::Core::get_coords(), get_normals_surf(), moab::Range::index(), MB_CHK_ERR, mbImpl, obtain_nring_ngbvs(), polyfit3d_surf_get_coeff(), and moab::Range::size().
Referenced by reconstruct3D_surf_geom().
ErrorCode moab::HiReconstruction::reconstruct3D_curve_geom | ( | int | degree, |
bool | interp, | ||
bool | safeguard, | ||
bool | reset = false |
||
) |
Reconstruct a high order curve on given curve mesh.
Given a curve mesh, compute vertex based polynomail fittings for all vertices hosted by current processor. The vertex based fitting is done by perfoming three one-parameter fittings along each axis, i.e. x,y,z. The result will be stored interally for later usage of evalution.
degree | Integer, order of polynomials used for local fittings. |
interp | Boolean, true=Interpolation, false=least square fitting. |
safeguard | Boolean, true=using safe guarded method in numerical computing. |
reset | Boolean, reset=true will recompute the fittings based on user input and replace the existing one. |
Definition at line 221 of file HiReconstruction.cpp.
References _degrees_out, _dim, _geom, _hasfittings, _initfittings, _interps, _local_fit_coeffs, _MINPNTS, _vertID2coeffID, _verts2rec, moab::Range::begin(), moab::Range::end(), moab::error(), ErrorCode, moab::HI3DCURVE, moab::Range::index(), initialize_3Dcurve_geom(), MB_CHK_ERR, MB_SUCCESS, and polyfit3d_walf_curve_vertex().
ErrorCode moab::HiReconstruction::reconstruct3D_curve_geom | ( | size_t | npts, |
int * | degrees, | ||
bool * | interps, | ||
bool | safeguard, | ||
bool | reset = false |
||
) |
Reconstruct a high order curve on given curve mesh.
Given a curve mesh, compute vertex based polynomail fittings for all vertices hosted by current processor. The vertex based fitting is done by perfoming three one-parameter fittings along each axis, i.e. x,y,z. User could specify various degrees for different vertices. It assumes that the input degrees for vertices stored in the same order as that this class stores vertices: 1) reconstruction will be only performed at vertices hosted by current processor, thus input npts should match the number of hosted vertices. 2) all hosted vertices will be stored in a MOAB::Range object, degrees for all these vertices should be stored in degrees as the same order in the MOAB::Range object The result will be stored interally for later usage of evalution.
npts | Integer size of array pointed by degrees, used for check |
degrees | Integer arrray, order of polynomials for local fitting at all hosted vertices. |
interp | Boolean, true=Interpolation, false=least square fitting. |
safeguard | Boolean, true=using safe guarded method in numerical computing. |
reset | Boolean, reset=true will recompute the fittings based on user input and replace the existing one. |
Definition at line 253 of file HiReconstruction.cpp.
References _degrees_out, _dim, _geom, _hasfittings, _initfittings, _interps, _local_fit_coeffs, _MINPNTS, _nv2rec, _vertID2coeffID, _verts2rec, moab::Range::begin(), moab::Range::end(), moab::error(), ErrorCode, moab::HI3DCURVE, moab::Range::index(), initialize_3Dcurve_geom(), MB_CHK_ERR, MB_SET_ERR, MB_SUCCESS, and polyfit3d_walf_curve_vertex().
ErrorCode moab::HiReconstruction::reconstruct3D_surf_geom | ( | int | degree, |
bool | interp, | ||
bool | safeguard, | ||
bool | reset = false |
||
) |
Reconstruct a high order surface on given surface mesh.
Given a mesh, compute vertex based polynomial fittings for all vertices hosted by current processor. The result will be stored interally for later usage of evalution. The inputs are: a) degree, which is the order of polynomial used for vertex based fitting. b) interp, if it's true, then interpolation will be applied for local fitting, otherwise it's least square fitting. c) safeguard, specifies whether to use safeguarded numeric method. d) reset, if fittings have been computed and stored in current object, then reset=true will recompute the fittings based on user input and replace the existing one.
degree | Integer, order of polynomials used for local fittings. |
interp | Boolean, true=Interpolation, false=least square fitting. |
safeguard | Boolean, true=using safe guarded method in numerical computing. |
reset | Boolean, reset=true will recompute the fittings based on user input and replace the existing one. |
Definition at line 126 of file HiReconstruction.cpp.
References _degrees_out, _dim, _geom, _hasfittings, _initfittings, _interps, _local_coords, _local_fit_coeffs, _MINPNTS, _vertID2coeffID, _verts2rec, moab::Range::begin(), moab::Range::end(), moab::error(), ErrorCode, moab::HISURFACE, moab::Range::index(), initialize_surf_geom(), MB_CHK_ERR, MB_SUCCESS, and polyfit3d_walf_surf_vertex().
ErrorCode moab::HiReconstruction::reconstruct3D_surf_geom | ( | size_t | npts, |
int * | degrees, | ||
bool * | interps, | ||
bool | safeguard, | ||
bool | reset = false |
||
) |
Reconstruct a high order surface on given surface mesh.
Given a mesh, compute vertex based polynomial fittings for all vertices hosted by current processor. User could specify various degrees for different vertices. It assumes that the input degrees for vertices stored in the same order as that this class stores vertices: 1) reconstruction will be only performed at vertices hosted by current processor, thus input npts should match the number of hosted vertices. 2) all hosted vertices will be stored in a MOAB::Range object, degrees for all these vertices should be stored in degrees as the same order in the MOAB::Range object The result will be stored interally for later usage of evalution.
npts | Integer size of array pointed by degrees, used for check |
degrees | Integer arrray, order of polynomials for local fitting at all hosted vertices |
interp | Boolean, true=Interpolation, false=least square fitting. |
safeguard | Boolean, true=using safe guarded method in numerical computing. |
reset | Boolean, reset=true will recompute the fittings based on user input and replace the existing one. |
Definition at line 178 of file HiReconstruction.cpp.
References _degrees_out, _dim, _geom, _hasfittings, _initfittings, _interps, _local_coords, _local_fit_coeffs, _MINPNTS, _nv2rec, _vertID2coeffID, _verts2rec, moab::Range::begin(), moab::Range::end(), moab::error(), ErrorCode, moab::HISURFACE, moab::Range::index(), initialize_surf_geom(), MB_CHK_ERR, MB_SET_ERR, MB_SUCCESS, and polyfit3d_walf_surf_vertex().
|
protected |
Given a vertex, return the incident elements with dimension elemdim.
Wrapper of MOAB Core->get_adjacencies and HalfRep->get_up_adjacencies, depends on if USE_AHF is defined
vid | EntityHandle of vertex |
elemdim | Integer, dimension of elements incidented in vid |
adjents | vector<EntityHandle>, container which push incident elements in |
Definition at line 658 of file HiReconstruction.cpp.
References _dim, ahf, moab::error(), ErrorCode, moab::Core::get_adjacencies(), moab::HalfFacetRep::get_up_adjacencies(), MB_CHK_ERR, and mbImpl.
Referenced by average_vertex_normal(), average_vertex_tangent(), and obtain_nring_ngbvs().
void moab::HiReconstruction::walf3d_curve_vertex_eval | ( | const double * | local_origin, |
const double * | local_coords, | ||
const int | local_deg, | ||
const double * | local_coeffs, | ||
const bool | interp, | ||
const int | npts2fit, | ||
const double * | coords2fit, | ||
double * | hiproj_new | ||
) |
Perform high order projection of points around a center vertex, assume geometry is curve.
Given a vertex position and the local one-parameter fittings parameter around this vertex, estimate the ideal position of input position according to the local fittings. This is done by first projecting input points onto the local u-direction at this vertex and then use the value u as parameter for the three fittings, one for each coordinates axis of xyz. The result will be returned to user preallocated memory
local_origin | Pointer to 3 doubles, coordinates of the center vertex |
local_coords | Pointer to 3 doubles, global coordinates of direction of local u coordinate axis at center vertex |
local_deg | Integer, order of local polynomial fitting |
local_coeffs | Pointer to array of doubles, size=3*(local_deg+1), coefficients of three local polynomial fittings, in monomial basis. For each fitting, local_deg+1 parameters. |
interp | Boolean, true=local fitting is interpolation, false=local fitting is least square fitting |
npts2fit | Integer, number of points to be estimated, around the center vertices |
coords2fit | Pointer to array of doubles, size=3*npts2fit, current coordinates of points to be estimated |
hiproj_new | Pointer to array of doubles, size=3*npts2fit, memory preallocated by user to store the fitting/estimated positions of input points. |
Definition at line 569 of file HiReconstruction.cpp.
References moab::DGMSolver::vec_innerprod(), and moab::DGMSolver::vec_linear_operation().
Referenced by hiproj_walf_around_vertex().
void moab::HiReconstruction::walf3d_surf_vertex_eval | ( | const double * | local_origin, |
const double * | local_coords, | ||
const int | local_deg, | ||
const double * | local_coeffs, | ||
const bool | interp, | ||
const int | npts2fit, | ||
const double * | coords2fit, | ||
double * | hiproj_new | ||
) |
Perform high order projection of points around a center vertex, assume geometry is surface.
Given a vertex position and the local fitting parameter around this vertex, estimate the ideal position of input position according to the local fitting. This is done by first projecting input points onto the local uv-plane around this vertex and use the given fitting to estimate the ideal position of input points. The result will be returned to user preallocated memory
local_origin | Pointer to 3 doubles, coordinates of the center vertex |
local_coords | Pointer to 9 doubles, global coordinates of directions of local uvw coordinates axis at center vertex |
local_deg | Integer, order of local polynomial fitting |
local_coeffs | Pointer to array of doubles, size=(local_deg+2)(local_deg+1)/2, coefficients of local polynomial fittings, in monomial basis |
interp | Boolean, true=local fitting is interpolation, false=local fitting is least square fitting |
npts2fit | Integer, number of points to be estimated, around the center vertices |
coords2fit | Pointer to array of doubles, size=3*npts2fit, current coordinates of points to be estimated |
hiproj_new | Pointer to array of doubles, size=3*npts2fit, memory preallocated by user to store the fitting/estimated positions of input points. |
Definition at line 513 of file HiReconstruction.cpp.
References moab::DGMSolver::vec_innerprod().
Referenced by hiproj_walf_around_vertex().
|
protected |
Definition at line 312 of file HiReconstruction.hpp.
Referenced by get_fittings_data(), hiproj_walf_around_vertex(), initialize_3Dcurve_geom(), initialize_surf_geom(), reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 306 of file HiReconstruction.hpp.
Referenced by HiReconstruction(), initialize(), obtain_nring_ngbvs(), polyfit3d_walf_surf_vertex(), reconstruct3D_curve_geom(), reconstruct3D_surf_geom(), and vertex_get_incident_elements().
|
protected |
Definition at line 305 of file HiReconstruction.hpp.
Referenced by get_fittings_data(), hiproj_walf_around_vertex(), reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 303 of file HiReconstruction.hpp.
Referenced by compute_average_vertex_normals_surf(), compute_average_vertex_tangents_curve(), get_normals_surf(), get_tangents_curve(), HiReconstruction(), initialize(), initialize_3Dcurve_geom(), and initialize_surf_geom().
|
protected |
Definition at line 307 of file HiReconstruction.hpp.
Referenced by get_fittings_data(), hiproj_walf_around_vertex(), hiproj_walf_in_element(), HiReconstruction(), initialize_3Dcurve_geom(), reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 295 of file HiReconstruction.hpp.
Referenced by initialize().
|
protected |
Definition at line 295 of file HiReconstruction.hpp.
Referenced by initialize().
|
protected |
Definition at line 295 of file HiReconstruction.hpp.
Referenced by initialize().
|
protected |
Definition at line 308 of file HiReconstruction.hpp.
Referenced by initialize_3Dcurve_geom(), initialize_surf_geom(), reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 313 of file HiReconstruction.hpp.
Referenced by get_fittings_data(), hiproj_walf_around_vertex(), initialize_3Dcurve_geom(), initialize_surf_geom(), reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 295 of file HiReconstruction.hpp.
Referenced by initialize().
|
protected |
Definition at line 309 of file HiReconstruction.hpp.
Referenced by compute_average_vertex_normals_surf(), compute_average_vertex_tangents_curve(), get_fittings_data(), get_normals_surf(), get_tangents_curve(), hiproj_walf_around_vertex(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 310 of file HiReconstruction.hpp.
Referenced by get_fittings_data(), hiproj_walf_around_vertex(), initialize_3Dcurve_geom(), initialize_surf_geom(), reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 298 of file HiReconstruction.hpp.
Referenced by compute_weights(), initialize(), and obtain_nring_ngbvs().
|
protected |
Definition at line 292 of file HiReconstruction.hpp.
Referenced by initialize().
|
protected |
Definition at line 299 of file HiReconstruction.hpp.
Referenced by check_barycentric_coords(), HiReconstruction(), polyfit3d_curve_get_coeff(), and polyfit3d_surf_get_coeff().
|
protected |
Definition at line 298 of file HiReconstruction.hpp.
Referenced by reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 296 of file HiReconstruction.hpp.
Referenced by compute_average_vertex_normals_surf(), compute_average_vertex_tangents_curve(), initialize(), initialize_3Dcurve_geom(), initialize_surf_geom(), reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 311 of file HiReconstruction.hpp.
Referenced by get_fittings_data(), hiproj_walf_around_vertex(), initialize_3Dcurve_geom(), initialize_surf_geom(), reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 295 of file HiReconstruction.hpp.
Referenced by compute_average_vertex_normals_surf(), compute_average_vertex_tangents_curve(), get_fittings_data(), get_normals_surf(), get_tangents_curve(), hiproj_walf_around_vertex(), hiproj_walf_in_element(), initialize(), reconstruct3D_curve_geom(), and reconstruct3D_surf_geom().
|
protected |
Definition at line 286 of file HiReconstruction.hpp.
Referenced by initialize(), vertex_get_incident_elements(), and ~HiReconstruction().
|
protected |
Definition at line 284 of file HiReconstruction.hpp.
Referenced by average_vertex_normal(), average_vertex_tangent(), hiproj_walf_around_vertex(), hiproj_walf_in_element(), HiReconstruction(), initialize(), obtain_nring_ngbvs(), polyfit3d_walf_curve_vertex(), polyfit3d_walf_surf_vertex(), and vertex_get_incident_elements().
|
protected |
Definition at line 285 of file HiReconstruction.hpp.
Referenced by HiReconstruction(), and initialize().