The Open FUSION Toolkit 1.0.0-8905cc5
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
Data Types | Functions/Subroutines | Variables
oft_quadmesh_type Module Reference

Detailed Description

Quadralateral boundary mesh definitions.

Author
Chris Hansen
Date
October 2018

Data Types

type  oft_quadmesh
 Quadralateral surface mesh type. More...
 

Functions/Subroutines

subroutine, public quad_2d_grid (order, xnodes, inodesp, inodese, inodesf)
 Needs docs.
 
pure real(r8) function, dimension(4) quad_get_bary (flog)
 Map from orthogonal logical coordinates to barycentric logical coordinates.
 
subroutine, public quad_grid_orient (oflag, order, finds)
 Needs docs.
 
subroutine quad_grid_orient_inv (oflag, order, finds)
 Needs docs.
 
real(r8) function, dimension(3) quadmesh_glogphys (self, cell, j, f)
 Compute the partial derivative of the physical coordinates with a specific logical coordinate.
 
subroutine quadmesh_hessian (self, cell, f, g2op, k)
 Compute the spatial hessian matrices for a given cell at a given logical position.
 
integer(i4) function quadmesh_in_cell (self, f, tol)
 Test if logical position lies within the base cell.
 
subroutine quadmesh_invert_face (self, cell)
 Turn cell "inside out", used to ensure consistent orientations.
 
subroutine quadmesh_jacinv (a, c, j)
 Invert a 2x2 matrix.
 
subroutine quadmesh_jacobian (self, cell, f, gop, j)
 Compute the spatial jacobian matrix and its determinant for a given cell at a given logical position.
 
subroutine quadmesh_load (self, filename, ascii)
 Load trimesh from transfer file.
 
real(r8) function, dimension(3) quadmesh_log2phys (self, cell, f)
 Map from logical to physical coordinates in a given cell.
 
subroutine quadmesh_norm (self, cell, f, n)
 Get unit normal for surface at a given point in a given cell.
 
subroutine quadmesh_phys2log (self, cell, pt, f)
 Map from physical to logical coordinates in a given cell.
 
subroutine quadmesh_quad_rule (self, order, quad_rule)
 Retrieve suitable quadrature rule for triangular mesh with given order.
 
subroutine quadmesh_save (self, filename, ascii)
 Save trimesh from transfer file.
 
subroutine quadmesh_set_order (self, order)
 Set maximum order of spatial mapping.
 
subroutine quadmesh_setup (self, cad_type, has_parent)
 Setup mesh with implementation specifics (cell_np, cell_ne, etc.)
 
subroutine quadmesh_tang (self, cell, f, t)
 Get tangent basis set for surface at a given point in a given cell.
 
subroutine quadmesh_tessellate (self, rtmp, lctmp, order)
 Tessellate mesh onto lagrange FE nodes of specified order (usually for plotting)
 
integer(i4) function, dimension(2) quadmesh_tessellated_sizes (self)
 Get sizes of arrays returned by trimesh_tessellate.
 
subroutine quadmesh_vlog (self, i, f)
 Get position in logical space of cell vertex i
 

Variables

integer(i4), dimension(2, 4), parameter inodes1p = RESHAPE((/ 1,1, 2,1, 2,2, 1,2/), (/2,4/))
 
integer(i4), dimension(2, 4), parameter inodes2e = RESHAPE((/ 2,1, 3,2, 2,3, 1,2/), (/2,4/))
 
integer(i4), dimension(2), parameter inodes2f = (/2,2/)
 
integer(i4), dimension(2, 4), parameter inodes2p = RESHAPE((/ 1,1, 3,1, 3,3, 1,3/), (/2,4/))
 
integer(i4), dimension(2, 4), parameter inodesp_base = RESHAPE((/ 0,0, 1,0, 1,1, 0,1/), (/2,4/))
 
integer(i4), dimension(4), parameter quad_bary_map = [-2,1,2,-1]
 
integer(i4), dimension(2, 4), parameter quad_ed =RESHAPE((/1,2, 2,3, 3,4, 4,1/), (/2,4/))
 Quad edge list.
 

Function/Subroutine Documentation

◆ quad_2d_grid()

subroutine, public quad_2d_grid ( integer(i4), intent(in)  order,
real(r8), dimension(:), intent(out), pointer  xnodes,
integer(i4), dimension(2,4), intent(out)  inodesp,
integer(i4), dimension(:,:,:), intent(out), pointer  inodese,
integer(i4), dimension(:,:), intent(out), pointer  inodesf 
)

Needs docs.

◆ quad_get_bary()

pure real(r8) function, dimension(4) quad_get_bary ( real(r8), dimension(:), intent(in)  flog)
private

Map from orthogonal logical coordinates to barycentric logical coordinates.

Parameters
[in]flogPosition in orthogonal logical coordinates [2]
Returns
Position in barycentric logical coordinates [4]

◆ quad_grid_orient()

subroutine, public quad_grid_orient ( integer(i4), intent(in)  oflag,
integer(i4), intent(in)  order,
integer(i4), dimension(:), intent(inout)  finds 
)

Needs docs.

◆ quad_grid_orient_inv()

subroutine quad_grid_orient_inv ( integer(i4), intent(in)  oflag,
integer(i4), intent(in)  order,
integer(i4), dimension(:), intent(inout)  finds 
)
private

Needs docs.

◆ quadmesh_glogphys()

real(r8) function, dimension(3) quadmesh_glogphys ( class(oft_quadmesh), intent(in)  self,
integer, intent(in)  cell,
integer, intent(in)  j,
real(r8), dimension(3), intent(in)  f 
)
private

Compute the partial derivative of the physical coordinates with a specific logical coordinate.

Driver function calls mapping specific function depending on mesh order

Parameters
[in]selfMesh object
[in]cellIndex of cell for evaulation
[in]jNeeds docs
[in]fLogical coordinate in cell [4]
Returns
\( \frac{\partial r}{\partial f_k} \) [3]

◆ quadmesh_hessian()

subroutine quadmesh_hessian ( class(oft_quadmesh), intent(in)  self,
integer(i4), intent(in)  cell,
real(r8), dimension(:), intent(in)  f,
real(r8), dimension(:,:), intent(out)  g2op,
real(r8), dimension(:,:), intent(out)  k 
)
private

Compute the spatial hessian matrices for a given cell at a given logical position.

Warning
Not presently supported for quadrilateral meshes
Parameters
[in]selfMesh object
[in]cellIndex of cell for evaulation
[in]fLogical coordinate in cell [4]
[out]g2opSecond order Jacobian matrix \( (\frac{\partial x_i}{\partial \lambda_l} \frac{\partial x_j}{\partial \lambda_k})^{-1} \)
[out]kGradient correction matrix \( \frac{\partial^2 x_i}{\partial \lambda_k \partial \lambda_l}\) [10,3]

◆ quadmesh_in_cell()

integer(i4) function quadmesh_in_cell ( class(oft_quadmesh), intent(in)  self,
real(r8), dimension(:), intent(in)  f,
real(r8), intent(in)  tol 
)
private

Test if logical position lies within the base cell.

Returns
Position f is inside the base cell?
Parameters
[in]selfMesh object
[in]fLogical coordinate to evaluate
[in]tolTolerance for test

◆ quadmesh_invert_face()

subroutine quadmesh_invert_face ( class(oft_quadmesh), intent(inout)  self,
integer(i4), intent(in)  cell 
)
private

Turn cell "inside out", used to ensure consistent orientations.

Parameters
[in,out]selfMesh object
[in]cellMaximum order of spatial mapping

◆ quadmesh_jacinv()

subroutine quadmesh_jacinv ( real(r8), dimension(2,2), intent(in)  a,
real(r8), dimension(2,2), intent(out)  c,
real(r8), intent(out)  j 
)
private

Invert a 2x2 matrix.

Parameters
[in]aMatrix to invert
[out]c\( A^{-1} \)
[out]j|A|

◆ quadmesh_jacobian()

subroutine quadmesh_jacobian ( class(oft_quadmesh), intent(in)  self,
integer(i4), intent(in)  cell,
real(r8), dimension(:), intent(in)  f,
real(r8), dimension(:,:), intent(out)  gop,
real(r8), intent(out)  j 
)
private

Compute the spatial jacobian matrix and its determinant for a given cell at a given logical position.

Parameters
[in]selfMesh object
[in]cellIndex of cell for evaulation
[in]fLogical coordinate in cell [3]
[out]gopJacobian matrix \( (\frac{\partial x_i}{\partial \lambda_j})^{-1} \) [3,4]
[out]jJacobian of transformation from logical to physical coordinates

◆ quadmesh_load()

subroutine quadmesh_load ( class(oft_quadmesh), intent(inout)  self,
character(len=*), intent(in)  filename,
logical, intent(in), optional  ascii 
)
private

Load trimesh from transfer file.

Parameters
[in,out]selfMesh object
[in]filenameFile to load mesh from
[in]asciiMesh stored in ASCII format?

◆ quadmesh_log2phys()

real(r8) function, dimension(3) quadmesh_log2phys ( class(oft_quadmesh), intent(in)  self,
integer, intent(in)  cell,
real(r8), dimension(:), intent(in)  f 
)
private

Map from logical to physical coordinates in a given cell.

Parameters
[in]selfMesh object
[in]cellIndex of cell for evaulation
[in]fLogical coordinate in cell [4]
Returns
Physical position [3]

◆ quadmesh_norm()

subroutine quadmesh_norm ( class(oft_quadmesh), intent(in), target  self,
integer(i4), intent(in)  cell,
real(r8), dimension(:), intent(in)  f,
real(r8), dimension(3), intent(out)  n 
)
private

Get unit normal for surface at a given point in a given cell.

Parameters
[in]selfMesh object
[in]cellCell containing point
[in]fLogical coordinates in cell
[out]nUnit normal [3]

◆ quadmesh_phys2log()

subroutine quadmesh_phys2log ( class(oft_quadmesh), intent(in)  self,
integer(i4), intent(in)  cell,
real(r8), dimension(3), intent(in)  pt,
real(r8), dimension(:), intent(out)  f 
)
private

Map from physical to logical coordinates in a given cell.

Parameters
[in]selfMesh object
[in]cellIndex of cell for evaulation
[in]ptPhysical position [3]
[out]fLogical coordinates within the cell [4]

◆ quadmesh_quad_rule()

subroutine quadmesh_quad_rule ( class(oft_quadmesh), intent(in)  self,
integer(i4), intent(in)  order,
type(oft_quad_type), intent(out)  quad_rule 
)
private

Retrieve suitable quadrature rule for triangular mesh with given order.

Parameters
[in]selfMesh object
[in]orderDesired order of quadrature rule
[out]quad_ruleResulting quadrature rule

◆ quadmesh_save()

subroutine quadmesh_save ( class(oft_quadmesh), intent(in)  self,
character(len=*), intent(in)  filename,
logical, intent(in), optional  ascii 
)
private

Save trimesh from transfer file.

Parameters
[in]selfMesh object
[in]filenameFile to save mesh to
[in]asciiSave file in ASCII format?

◆ quadmesh_set_order()

subroutine quadmesh_set_order ( class(oft_quadmesh), intent(inout)  self,
integer(i4), intent(in)  order 
)
private

Set maximum order of spatial mapping.

Parameters
[in,out]selfMesh object
[in]orderMaximum order of spatial mapping

◆ quadmesh_setup()

subroutine quadmesh_setup ( class(oft_quadmesh), intent(inout)  self,
integer(i4), intent(in)  cad_type,
logical, intent(in)  has_parent 
)
private

Setup mesh with implementation specifics (cell_np, cell_ne, etc.)

Parameters
[in,out]selfMesh object
[in]cad_typeCAD/mesh interface ID number
[in]has_parentIs this mesh the/a surface of a volume mesh?

◆ quadmesh_tang()

subroutine quadmesh_tang ( class(oft_quadmesh), intent(in), target  self,
integer(i4), intent(in)  cell,
real(r8), dimension(:), intent(in)  f,
real(r8), dimension(3,2), intent(out)  t 
)
private

Get tangent basis set for surface at a given point in a given cell.

Parameters
[in]selfMesh object
[in]cellCell containing point
[in]fLogical coordinates in cell
[out]tUnit tangent basis set [3,2]

◆ quadmesh_tessellate()

subroutine quadmesh_tessellate ( class(oft_quadmesh), intent(in)  self,
real(r8), dimension(:,:), intent(out), pointer  rtmp,
integer(i4), dimension(:,:), intent(out), pointer  lctmp,
integer(i4), intent(in)  order 
)
private

Tessellate mesh onto lagrange FE nodes of specified order (usually for plotting)

Note
The maximum tessellation order currently supported is 4 (may be lower for certain mesh types).
Warning
Cell lists are returned with zero based indexing
Parameters
[in]selfMesh object
[out]rtmpTessellated point list [3,:]
[out]lctmpTessellated cell list [selfncp,:]
[in]orderTessellation order

◆ quadmesh_tessellated_sizes()

integer(i4) function, dimension(2) quadmesh_tessellated_sizes ( class(oft_quadmesh), intent(in)  self)
private

Get sizes of arrays returned by trimesh_tessellate.

Parameters
[in]selfMesh object
Returns
Array sizes following tessellation [np_tess,nc_tess]

◆ quadmesh_vlog()

subroutine quadmesh_vlog ( class(oft_quadmesh), intent(in)  self,
integer(i4), intent(in)  i,
real(r8), dimension(:), intent(out)  f 
)
private

Get position in logical space of cell vertex i

Parameters
[in]selfMesh object
[in]iVertex to locate
[out]fLogical coordinates of vertex i

Variable Documentation

◆ inodes1p

integer(i4), dimension(2,4), parameter inodes1p = RESHAPE((/ 1,1, 2,1, 2,2, 1,2/), (/2,4/))
private

◆ inodes2e

integer(i4), dimension(2,4), parameter inodes2e = RESHAPE((/ 2,1, 3,2, 2,3, 1,2/), (/2,4/))
private

◆ inodes2f

integer(i4), dimension(2), parameter inodes2f = (/2,2/)
private

◆ inodes2p

integer(i4), dimension(2,4), parameter inodes2p = RESHAPE((/ 1,1, 3,1, 3,3, 1,3/), (/2,4/))
private

◆ inodesp_base

integer(i4), dimension(2,4), parameter inodesp_base = RESHAPE((/ 0,0, 1,0, 1,1, 0,1/), (/2,4/))
private

◆ quad_bary_map

integer(i4), dimension(4), parameter quad_bary_map = [-2,1,2,-1]
private

◆ quad_ed

integer(i4), dimension(2,4), parameter quad_ed =RESHAPE((/1,2, 2,3, 3,4, 4,1/), (/2,4/))

Quad edge list.