Methods

Index

Basic geometry

PhysicalParticles.areaFunction
area(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.

source
area(c::AbstractCube2D) -> Any

Signed area of 2D cube

source
area(t::AbstractTriangle2D) -> Any

Unsigned area of triangle

source
area(t::AbstractTriangle3D) -> Any
source
PhysicalParticles.volumeFunction
volume(c::AbstractCube3D) -> Any

Signed volume of 3D cube

source
volume(t::PhysicalMeshes.AbstractTetrahedron) -> Any

Unsigned volume of tetrahedron

source
PhysicalMeshes.centroidFunction
centroid(line::AbstractLine) -> Any

Average position of line vertices.

source
centroid(t::AbstractTriangle) -> Any

Averaged position center of triangle

source
centroid(t::PhysicalMeshes.AbstractTetrahedron) -> Any

Averaged position center of the tetrahedron

source
PhysicalMeshes.orientFunction
orient(
    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.

source
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.

source
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.

source
orient(
    t::AbstractTriangle
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}

Orientation vector of triangle (return a PVector). See also orientation

source
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)
source
PhysicalMeshes.orientationFunction
orientation(
    t::AbstractTriangle2D
) -> Union{NegativelyOriented, PositivelyOriented, UnOriented}

Orientation of triangle. Return a trait (NegativelyOriented, PositivelyOriented, or UnOriented)

source
orientation(
    t::PhysicalMeshes.AbstractTetrahedron
) -> Union{NegativelyOriented, PositivelyOriented, UnOriented}

Orientation of tetrahedron. Return a trait (NegativelyOriented, PositivelyOriented, or UnOriented)

source
PhysicalMeshes.circumcenterFunction
circumcenter(
    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).

source
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).

source
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).

source
circumcenter(
    t::AbstractTriangle
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}

Return the circumcenter of triangle (as a PVector or PVector2D)

source
circumcenter(
    t::PhysicalMeshes.AbstractTetrahedron
) -> Union{PhysicalParticles.PVector, PhysicalParticles.PVector2D}

Return the circumsphere center of tetrahedron

source

Predicates

PhysicalMeshes.incircleFunction
incircle(
    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)

source
PhysicalMeshes.insphereFunction
insphere(
    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)

source
PhysicalMeshes.interiorFunction
interior(s::Sphere, p) -> Bool

Return true if the distance of p from s.center is smaller than s.radius. Otherwise (>=), return false.

source
interior(
    c::Cube2D,
    p::PhysicalParticles.AbstractPoint2D
) -> Bool

Return true if p is inside the cube. Otherwise (including on the edge), return false.

source
interior(
    c::Cube,
    p::PhysicalParticles.AbstractPoint3D
) -> Bool

Return true if p is inside the cube. Otherwise (including on the edge), return false.

source
PhysicalMeshes.exteriorFunction
exterior(s::Sphere, p) -> Bool

Return true if the distance of p from s.center is larger than s.radius. Otherwise (<=), return false.

source
exterior(
    c::Cube2D,
    p::PhysicalParticles.AbstractPoint2D
) -> Bool

Return true if p is outside the cube. Otherwise (including on the edge), return false.

source
exterior(
    c::Cube,
    p::PhysicalParticles.AbstractPoint3D
) -> Bool

Return true if p is outside the cube. Otherwise (including on the edge), return false.

source

Mesh

Missing docstring.

Missing docstring for particle2mesh. Check Documenter's build log for details.

PhysicalMeshes.assignmeshFunction
assignmesh(
    particles::StructArrays.StructArray,
    mesh::MeshCartesianStatic,
    symbolParticle::Symbol,
    symbolMesh::Symbol
) -> Any

Assign mesh data by mass assignment shemes

Example

assignmesh(data, m, :Mass, :rho)
source
Missing docstring.

Missing docstring for mesh2particle. Check Documenter's build log for details.

PhysicalMeshes.assignparticleFunction
assignparticle(
    particles::StructArrays.StructArray,
    mesh::MeshCartesianStatic,
    symbolParticle::Symbol,
    symbolMesh::Symbol
) -> Any

Assign particle data by inverse mass assignment.

Examples

assignparticle(data, m, :Acc, :acc)
source