Developer Documentation
Note that these functions could be removed or change in behavior between minor version changes! Use and dispatch on these with care!
FerriteViz.num_vertices
— FunctionTotal number of vertices
FerriteViz.vertices
— FunctionGet the vertices represented as a list of coordinates of a cell.
Details
TODO refactor into Ferrite core.
FerriteViz.transfer_quadrature_face_to_cell
— Functiontransfer_quadrature_face_to_cell(point::AbstractVector, cell::Ferrite.AbstractCell{3,N,4}, face::Int)
Mapping from 2D triangle to 3D face of a tetrahedon.
transfer_quadrature_face_to_cell(point::AbstractVector, cell::Ferrite.AbstractCell{3,N,6}, face::Int)
Mapping from 2D quadrilateral to 3D face of a hexahedron.
FerriteViz.decompose!
— Methoddecompose!(coord_offset, coord_matrix, ref_coord_matrix, triangle_offset, triangle_matrix, grid, cell::Union{Ferrite.AbstractCell{2,N,3}, Ferrite.AbstractCell{3,3,1}})
Decompose a triangle into a coordinates and a triangle index list to disconnect it properly. Guarantees to preserve orderings and orientations.
FerriteViz.decompose!
— Methoddecompose!(coord_offset, coord_matrix::Vector{Point{space_dim,T}}, ref_coord_matrix, triangle_offset, triangle_matrix, grid, cell::Union{Ferrite.AbstractCell{2,N,4}, Ferrite.AbstractCell{3,4,1}})
Decompose a quadrilateral into a coordinates and a triangle index list to disconnect it properly. Guarantees to preserve orderings and orientations.
Details
This function takes a CCW ordered quadrilateral, i.e.
4-------3
| |
| |
| |
| |
| |
1-------2
and creates the decomposition
4-------3
| \ C / |
| \ / |
|D 5 B|
| / \ |
| / A \ |
1-------2
where A=(1,2,5),B=(2,3,5),C=(3,4,5),D=(4,1,5) are the generated triangles in this order.
FerriteViz.decompose!
— Methoddecompose!(coord_offset, coord_matrix, ref_coord_matrix, triangle_offset, triangle_matrix, grid, cell::Ferrite.AbstractCell{3,N,M})
Decompose volumetric objects via their faces.
FerriteViz.transfer_solution
— Functiontransfer_solution(plotter::MakiePlotter{dim,DH,T}, u::Vector; field_idx::Int=1, process::Function=FerriteViz.postprocess) where {dim,DH<:Ferrite.AbstractDofHandler,T}
Transfer the solution of a plotter to the tessellated mesh in dim
.
Details
TODO: Refactor. This is peak inefficiency.
FerriteViz.postprocess
— Functionpostprocess(node_values::Vector{T}) -> T
Takes the nodal dof vector and maps it either to the scalar or to the euclidean norm (in the vectorial case)
FerriteViz._tensorsjl_gradient_accessor
— Function_tensorsjl_gradient_accessor(v::Tensors.Vec, field_dim_idx::Int, spatial_dim_idx::Int)
This is a helper to access the correct value in Tensors.jl entities, because the gradient index is the outermost one.
FerriteViz.linear_face_cell
— Functionlinear_face_cell(cell::Ferrite.Cell, local_face_idx::Int)
Get the geometrically linear face of a given cell.
This may extracts the face spanned by the vertices, not the actual face!