The Open FUSION Toolkit 1.0.0-8905cc5
Modeling tools for plasma and fusion research and engineering
|
CAD utility functions and class definition for reconstruction of rational bezier CAD objects.
This module supports internal refinement of T3D generated meshes while maintaining the true CAD boundary. Refinement uses MINPACK to minimize the weighted sum of distances between constraint points with the point constrained to the CAD object.
Data Types | |
type | cad_curve |
CAD curve class. More... | |
interface | cad_dummy_eval |
Map the parametric possition on an entity to physical coordinates. More... | |
interface | cad_dummy_find |
Find the parametric representation of a boundary point in CAD representation. More... | |
type | cad_entity |
CAD entity class. More... | |
type | cad_entity_ptr |
List of CAD entities. More... | |
type | cad_surf |
CAD surface class. More... | |
type | cad_vertex |
CAD vertex class. More... | |
Functions/Subroutines | |
real(r8) function, public | bernstein (x, i, j) |
Evaluates the bernstein polynomial. | |
subroutine | cad_cmid_error (m, n, uv, err, iflag) |
Evalute the error between a curve point and the current active points used in a 2 point minimization. | |
integer(i4) function, public | cad_curve_cast (self, source) |
Cast cad_entity to cad_curve. | |
subroutine | cad_curve_eval (self, pt, u, v) |
Map the parametric possition on a curve to physical coordinates. | |
subroutine | cad_curve_find (self, pt, u, v) |
Find the parametric representation of a boundary point in CAD representation on a curve. | |
subroutine | cad_curve_grid (self) |
Evalute a grid of points evenly spaced in parametric space. | |
subroutine, public | cad_curve_midpoint (self, pt, pt1, pt2, wt1, wt2, ierr) |
Compute the weighted midpoint of a curve edge. | |
subroutine | cad_curve_reflect (self, copy, tol, k) |
Reflect a curve object across a given plane. | |
subroutine | cad_curve_tang (self, tang, u) |
Compute unit tangent vector for a CAD curve at a given location. | |
subroutine | cad_scenter_error (m, n, uv, err, iflag) |
Evalute the error between a surface point and the current active points used in a 3 point minimization. | |
subroutine | cad_smid_error (m, n, uv, err, iflag) |
Evalute the error between a surface point and the current active points used in a 2 point minimization. | |
integer(i4) function, public | cad_surf_cast (self, source) |
Cast cad_entity to cad_surf. | |
subroutine, public | cad_surf_center (self, pt, pt1, pt2, pt3, wt1, wt2, wt3, ierr) |
Compute the weighted center point of a surface triangle. | |
subroutine | cad_surf_eval (self, pt, u, v) |
Map the parametric possition on a surface to physical coordinates. | |
subroutine | cad_surf_find (self, pt, u, v) |
Find the parametric representation of a boundary point in CAD representation on a surface. | |
subroutine | cad_surf_grid (self) |
Evalute a grid of points evenly spaced in parametric space. | |
subroutine, public | cad_surf_midpoint (self, pt, pt1, pt2, wt1, wt2, ierr) |
Compute the weighted midpoint of a surface edge. | |
subroutine | cad_surf_norm (self, norm, u, v) |
Compute unit normal vector for a CAD surface at a specified position. | |
subroutine | cad_surf_reflect (self, copy, tol, k) |
Reflect a surface object across a given plane. | |
subroutine | cad_vertex_eval (self, pt, u, v) |
Map parametric possition of a vertex to physical coordinates. | |
subroutine | cad_vertex_find (self, pt, u, v) |
Find the parametric representation of a boundary point in CAD representation on a vertex. | |
subroutine | cad_vertex_reflect (self, copy, tol, k) |
Reflect a vertex object across a given plane. | |
Variables | |
class(cad_curve), pointer | active_curve => NULL() |
Active curve for MINPACK fitting. | |
real(r8), dimension(3, 3) | active_endpts |
Active constraint points for MINPACK fitting. | |
class(cad_surf), pointer | active_surf => NULL() |
Active surface for MINPACK fitting. | |
real(r8), dimension(3) | active_wts |
Active constraint weights for MINPACK fitting. | |
integer(i4), parameter | cad_ngrid = 20 |
Number of grid points to use for object meshes. | |
real(r8) function, public bernstein | ( | real(r8), intent(in) | x, |
integer(i4), intent(in) | i, | ||
integer(i4), intent(in) | j | ||
) |
Evaluates the bernstein polynomial.
f(x) = \( B_{ij}(x) \)
[in] | x | Point to evaluate |
[in] | i | Polynomial degree |
[in] | j | Polynomial kind |
|
private |
Evalute the error between a curve point and the current active points used in a 2 point minimization.
[in] | m | Number of spatial dimensions (3) |
[in] | n | Number of parametric dimensions (2) |
[in] | uv | Parametric position [n] |
[out] | err | Error vector between current and desired point [3] |
[in,out] | iflag | Unused flag |
integer(i4) function, public cad_curve_cast | ( | class(cad_curve), intent(out), pointer | self, |
class(cad_entity), intent(in), target | source | ||
) |
Cast cad_entity to cad_curve.
[out] | self | Object of desired type, unassociated if cast fails |
[in] | source | Source object to cast |
|
private |
Map the parametric possition on a curve to physical coordinates.
[out] | pt | Position vector [3] |
[in] | u | Parametric coordinate 1 |
[in] | v | Parametric coordinate 2 (ignored) |
|
private |
Find the parametric representation of a boundary point in CAD representation on a curve.
[in] | pt | Position vector [3] |
[out] | u | Parametric coordinate 1 |
[out] | v | Parametric coordinate 2 (ignored) |
|
private |
Evalute a grid of points evenly spaced in parametric space.
subroutine, public cad_curve_midpoint | ( | class(cad_curve), intent(in), target | self, |
real(r8), dimension(3), intent(inout) | pt, | ||
real(r8), dimension(3), intent(in) | pt1, | ||
real(r8), dimension(3), intent(in) | pt2, | ||
real(r8), intent(in) | wt1, | ||
real(r8), intent(in) | wt2, | ||
integer(i4), intent(out) | ierr | ||
) |
Compute the weighted midpoint of a curve edge.
Locates the point on a given CAD curve which minimizes the weighted sum of distances to 2 constraint points.
\[ \sum_i w_i*(r_n - p_i)^2 \]
[in] | self | Curve object |
[in,out] | pt | Solution point [3] |
[in] | pt1 | Constraint point 1 [3] |
[in] | pt2 | Constraint point 2 [3] |
[in] | wt1 | Weight for constraint point 1 |
[in] | wt2 | Weight for constraint point 2 |
[out] | ierr | Error flag |
|
private |
Reflect a curve object across a given plane.
[in] | self | Source object to copy |
[out] | copy | Reflected copy of the source curve |
[in] | tol | Minimum distance from plane |
[in] | k | Coordinate index for the reflection plane |
|
private |
Compute unit tangent vector for a CAD curve at a given location.
[out] | tang | Curve tangent unit vector [3] |
[in] | u | Parametric coordinate |
|
private |
Evalute the error between a surface point and the current active points used in a 3 point minimization.
[in] | m | Number of spatial dimensions (3) |
[in] | n | Number of parametric dimensions (2) |
[in] | uv | Parametric possition [n] |
[out] | err | Error vector between current and desired point [3] |
[in,out] | iflag | Unused flag |
|
private |
Evalute the error between a surface point and the current active points used in a 2 point minimization.
[in] | m | Number of spatial dimensions (3) |
[in] | n | Number of parametric dimensions (2) |
[in] | uv | Parametric possition [n] |
[out] | err | Error vector between current and desired point [3] |
[in,out] | iflag | Unused flag |
integer(i4) function, public cad_surf_cast | ( | class(cad_surf), intent(out), pointer | self, |
class(cad_entity), intent(in), target | source | ||
) |
Cast cad_entity to cad_surf.
[out] | self | Object of desired type, unassociated if cast fails |
[in] | source | Source object to cast |
subroutine, public cad_surf_center | ( | class(cad_surf), intent(in), target | self, |
real(r8), dimension(3), intent(inout) | pt, | ||
real(r8), dimension(3), intent(in) | pt1, | ||
real(r8), dimension(3), intent(in) | pt2, | ||
real(r8), dimension(3), intent(in) | pt3, | ||
real(r8), intent(in) | wt1, | ||
real(r8), intent(in) | wt2, | ||
real(r8), intent(in) | wt3, | ||
integer(i4), intent(out) | ierr | ||
) |
Compute the weighted center point of a surface triangle.
Locates the point on a given CAD surface which minimizes the weighted sum of distances to 3 constraint points.
\[ \sum_i w_i*(r_n - p_i)^2 \]
[in] | self | Surface object |
[in,out] | pt | Solution point [3] |
[in] | pt1 | Constraint point 1 [3] |
[in] | pt2 | Constraint point 2 [3] |
[in] | pt3 | Constraint point 3 [3] |
[in] | wt1 | Weight for constraint point 1 |
[in] | wt2 | Weight for constraint point 2 |
[in] | wt3 | Weight for constraint point 3 |
[out] | ierr | Error flag |
|
private |
Map the parametric possition on a surface to physical coordinates.
[out] | pt | Position vector [3] |
[in] | u | Parametric coordinate 1 |
[in] | v | Parametric coordinate 2 |
|
private |
Find the parametric representation of a boundary point in CAD representation on a surface.
[in] | pt | Position vector [3] |
[out] | u | Parametric coordinate 1 |
[out] | v | Parametric coordinate 2 |
|
private |
Evalute a grid of points evenly spaced in parametric space.
subroutine, public cad_surf_midpoint | ( | class(cad_surf), intent(in), target | self, |
real(r8), dimension(3), intent(inout) | pt, | ||
real(r8), dimension(3), intent(in) | pt1, | ||
real(r8), dimension(3), intent(in) | pt2, | ||
real(r8), intent(in) | wt1, | ||
real(r8), intent(in) | wt2, | ||
integer(i4), intent(out) | ierr | ||
) |
Compute the weighted midpoint of a surface edge.
Locates the point on a given CAD surface which minimizes the weighted sum of distances to 2 constraint points.
\[ \sum_i w_i*(r_n - p_i)^2 \]
[in] | self | Surface object |
[in,out] | pt | Solution point [3] |
[in] | pt1 | Constraint point 1 [3] |
[in] | pt2 | Constraint point 2 [3] |
[in] | wt1 | Weight for constraint point 1 |
[in] | wt2 | Weight for constraint point 2 |
[out] | ierr | Error flag |
|
private |
Compute unit normal vector for a CAD surface at a specified position.
[out] | norm | Surface normal unit vector [3] |
[in] | u | Parametric coordinate 1 |
[in] | v | Parametric coordinate 2 |
|
private |
Reflect a surface object across a given plane.
[in] | self | Source surface to copy |
[out] | copy | Reflected copy of the source surface |
[in] | tol | Minimum distance from plane |
[in] | k | Coordinate index for the reflection plane |
|
private |
Map parametric possition of a vertex to physical coordinates.
[out] | pt | Position vector [3] |
[in] | u | Parametric coordinate 1 (ignored) |
[in] | v | Parametric coordinate 2 (ignored) |
|
private |
Find the parametric representation of a boundary point in CAD representation on a vertex.
[in] | pt | Position vector [3] |
[out] | u | Parametric coordinate 1 (ignored) |
[out] | v | Parametric coordinate 2 (ignored) |
|
private |
Reflect a vertex object across a given plane.
[in] | self | Source object to copy |
[out] | copy | Reflected copy of the source vertex |
[in] | tol | Minimum distance from plane |
[in] | k | Coordinate index for the reflection plane |
|
private |
Active curve for MINPACK fitting.
|
private |
Active constraint points for MINPACK fitting.
|
private |
Active surface for MINPACK fitting.
|
private |
Active constraint weights for MINPACK fitting.
integer(i4), parameter cad_ngrid = 20 |
Number of grid points to use for object meshes.