Methods
Index
PhysicalMeshes.assignmeshPhysicalMeshes.assignparticlePhysicalMeshes.centerPhysicalMeshes.centroidPhysicalMeshes.circumcenterPhysicalMeshes.exteriorPhysicalMeshes.incirclePhysicalMeshes.inspherePhysicalMeshes.interiorPhysicalMeshes.lenPhysicalMeshes.midpointPhysicalMeshes.orientPhysicalMeshes.orientationPhysicalParticles.areaPhysicalParticles.volume
Basic geometry
PhysicalMeshes.len — Functionlen(line::AbstractLine) -> Any
Length of line
len(t::AbstractTriangle) -> Any
Circumference of the triangle
PhysicalParticles.area — Functionarea(polygon::Polygon2D) -> Any
Compute the unsigned area of a 2D polygon using the shoelace formula. The polygon is split into triangles anchored at the first vertex for numerical robustness.
area(c::AbstractCube2D) -> Any
Signed area of 2D cube
area(t::AbstractTriangle2D) -> Any
Unsigned area of triangle
area(t::AbstractTriangle3D) -> Any
PhysicalParticles.volume — Functionvolume(c::AbstractCube3D) -> Any
Signed volume of 3D cube
volume(t::PhysicalMeshes.AbstractTetrahedron) -> Any
Unsigned volume of tetrahedron
PhysicalMeshes.center — Functioncenter(line::AbstractLine) -> Any
Average position of line vertices.
PhysicalMeshes.centroid — Functioncentroid(line::AbstractLine) -> Any
Average position of line vertices.
centroid(t::AbstractTriangle) -> Any
Averaged position center of triangle
centroid(t::PhysicalMeshes.AbstractTetrahedron) -> Any
Averaged position center of the tetrahedron
PhysicalMeshes.midpoint — Functionmidpoint(line::AbstractLine) -> Any
Average position of line vertices.
PhysicalMeshes.orient — Functionorient(
a::PhysicalParticles.AbstractPoint2D,
b::PhysicalParticles.AbstractPoint2D,
c::PhysicalParticles.AbstractPoint2D
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}
Computes the 2D orientation. The result is also a rough approximation of twice the signed area. Returns zero when the three points are collinear.
orient(
a::PhysicalParticles.AbstractPoint3D,
b::PhysicalParticles.AbstractPoint3D,
c::PhysicalParticles.AbstractPoint3D
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}
Computes the 3D orientation of the triangle (a, b, c) and returns the normal vector whose magnitude is twice the signed area. For collinear points the returned vector has zero magnitude.
orient(
a::PhysicalParticles.AbstractPoint3D,
b::PhysicalParticles.AbstractPoint3D,
c::PhysicalParticles.AbstractPoint3D,
d::PhysicalParticles.AbstractPoint3D
) -> Any
Computes the 3D orient. The result is a rough approximation of six times the signed volume of the tetrahedron (a, b, c, d). The value is zero when the four points are coplanar.
orient(
t::AbstractTriangle
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}
Orientation vector of triangle (return a PVector). See also orientation
orient(t::PhysicalMeshes.AbstractTetrahedron) -> Any
- Return a positive number if positively oriented.
- Return a negative number if negatively oriented.
- Return zero if not oriented (indicating the tetrahedron has zero volume)
PhysicalMeshes.orientation — Functionorientation(
t::AbstractTriangle2D
) -> Union{NegativelyOriented, PositivelyOriented, UnOriented}
Orientation of triangle. Return a trait (NegativelyOriented, PositivelyOriented, or UnOriented)
orientation(
t::PhysicalMeshes.AbstractTetrahedron
) -> Union{NegativelyOriented, PositivelyOriented, UnOriented}
Orientation of tetrahedron. Return a trait (NegativelyOriented, PositivelyOriented, or UnOriented)
PhysicalMeshes.circumcenter — Functioncircumcenter(
a::PhysicalParticles.AbstractPoint2D,
b::PhysicalParticles.AbstractPoint2D,
c::PhysicalParticles.AbstractPoint2D
) -> PhysicalParticles.PVector2D
Compute the circumcenter of three 2D points.
Throws an ArgumentError if the three points are collinear (no unique circumcenter exists).
circumcenter(
a::PhysicalParticles.AbstractPoint3D,
b::PhysicalParticles.AbstractPoint3D,
c::PhysicalParticles.AbstractPoint3D
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}
Compute the circumcenter of three 3D points.
Throws an ArgumentError if the three points are collinear (no unique circumcenter exists).
circumcenter(
a::PhysicalParticles.AbstractPoint3D,
b::PhysicalParticles.AbstractPoint3D,
c::PhysicalParticles.AbstractPoint3D,
d::PhysicalParticles.AbstractPoint3D
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}
Compute the circumcenter of four 3D points (the center of the circumscribed sphere of a tetrahedron).
Throws an ArgumentError if the four points are coplanar (no unique circumcenter exists).
circumcenter(
t::AbstractTriangle
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}
Return the circumcenter of triangle (as a PVector or PVector2D)
circumcenter(
t::PhysicalMeshes.AbstractTetrahedron
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}
Return the circumsphere center of tetrahedron
Predicates
PhysicalMeshes.incircle — Functionincircle(
t::AbstractTriangle2D,
p::PhysicalParticles.AbstractPoint2D
) -> Union{Exterior, Interior, OnEdge}
Test whether a point locates inside the circumcircle of triangle. Return a trait (Interior, Exterior, or OnEdge)
PhysicalMeshes.insphere — Functioninsphere(
t::PhysicalMeshes.AbstractTetrahedron,
p::PhysicalParticles.AbstractPoint3D
) -> Union{Exterior, Interior, OnEdge}
Test whether a point locates inside the circumsphere center of tetrahedron. Return a trait (Interior, Exterior, or OnEdge)
PhysicalMeshes.interior — Functioninterior(s::Sphere, p) -> Bool
Return true if the distance of p from s.center is smaller than s.radius. Otherwise (>=), return false.
interior(
c::Cube2D,
p::PhysicalParticles.AbstractPoint2D
) -> Bool
Return true if p is inside the cube. Otherwise (including on the edge), return false.
interior(
c::Cube,
p::PhysicalParticles.AbstractPoint3D
) -> Bool
Return true if p is inside the cube. Otherwise (including on the edge), return false.
PhysicalMeshes.exterior — Functionexterior(s::Sphere, p) -> Bool
Return true if the distance of p from s.center is larger than s.radius. Otherwise (<=), return false.
exterior(
c::Cube2D,
p::PhysicalParticles.AbstractPoint2D
) -> Bool
Return true if p is outside the cube. Otherwise (including on the edge), return false.
exterior(
c::Cube,
p::PhysicalParticles.AbstractPoint3D
) -> Bool
Return true if p is outside the cube. Otherwise (including on the edge), return false.
Mesh
Missing docstring for particle2mesh. Check Documenter's build log for details.
PhysicalMeshes.assignmesh — Functionassignmesh(
particles::StructArrays.StructArray,
mesh::MeshCartesianStatic,
symbolParticle::Symbol,
symbolMesh::Symbol
) -> Any
Assign mesh data by mass assignment shemes
Example
assignmesh(data, m, :Mass, :rho)Missing docstring for mesh2particle. Check Documenter's build log for details.
PhysicalMeshes.assignparticle — Functionassignparticle(
particles::StructArrays.StructArray,
mesh::MeshCartesianStatic,
symbolParticle::Symbol,
symbolMesh::Symbol
) -> Any
Assign particle data by inverse mass assignment.
Examples
assignparticle(data, m, :Acc, :acc)