Phyth v0.1.0
A dimensional safe C++ header-only mechanics and electromagnetics simulation library.
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Phyth::Mechanics::SurfaceForce Class Reference

Uniform surface traction on a rectangular patch. More...

#include <SurfaceForce.hpp>

Inheritance diagram for Phyth::Mechanics::SurfaceForce:
Inheritance graph
[legend]
Collaboration diagram for Phyth::Mechanics::SurfaceForce:
Collaboration graph
[legend]

Public Member Functions

 SurfaceForce (const Vector3< Quantity< Meter > > &center, const Vector3< Scalar > &u_axis, const Vector3< Scalar > &v_axis, const Quantity< Meter > width, const Quantity< Meter > height, const Vector3< Quantity< Pascal > > &traction, const IsotropicMaterial &material) noexcept
 Construct a rectangular surface traction.
 
Matrix3x3< Quantity< Pascal > > GetStressAt (const Vector3< Quantity< Meter > > &point) const override
 Compute stress tensor at a point using numerical integration.
 
Vector3< Quantity< Newton > > GetForceAt (const Vector3< Quantity< Meter > > &point) const override
 Get the force vector at a point.
 
Vector3< Quantity< Newton > > GetTotalForce () const override
 Get the total force of this source.
 
Quantity< Meter > GetMinimumDistanceTo (const Vector3< Quantity< Meter > > &point) const override
 Get the minimum distance from a point to the rectangular surface.
 
Vector3< Quantity< Pascal > > GetTraction () const
 Get the traction vector.
 
void SetTraction (const Vector3< Quantity< Pascal > > &traction)
 Set the traction vector.
 
- Public Member Functions inherited from Phyth::Mechanics::ForceSource
virtual ~ForceSource ()=default
 
virtual Vector3< Quantity< NewtonPerMeterCubed > > GetBodyForceDensityAt (const Vector3< Quantity< Meter > > &point) const
 Get the body force density at a point.
 

Private Member Functions

Matrix3x3< Quantity< Pascal > > NumericalIntegrateStress (const Vector3< Quantity< Meter > > &point, const int nu, const int nv) const
 Numerical integration of stress over the surface.
 

Private Attributes

Vector3< Quantity< Meter > > center_
 
Vector3< Scalar > u_axis_
 
Vector3< Scalar > v_axis_
 
Quantity< Meter > width_
 
Quantity< Meter > height_
 
Vector3< Quantity< Pascal > > traction_
 
IsotropicMaterial material_
 

Detailed Description

Uniform surface traction on a rectangular patch.

SurfaceForce represents a traction distribution on a flat rectangular surface. The stress field is computed by numerical integration using the midpoint rule with configurable resolution.

Example:

auto u_axis = Vector3<Scalar>(1, 0, 0);
auto v_axis = Vector3<Scalar>(0, 1, 0);
auto stress = surface.GetStressAt(point);
Uniform surface traction on a rectangular patch.
constexpr bool is_unit_v
Definition Unit.hpp:79
3D vector with Quantity components
Definition Vector3.hpp:28

Definition at line 29 of file SurfaceForce.hpp.

Constructor & Destructor Documentation

◆ SurfaceForce()

Phyth::Mechanics::SurfaceForce::SurfaceForce ( const Vector3< Quantity< Meter > > &  center,
const Vector3< Scalar > &  u_axis,
const Vector3< Scalar > &  v_axis,
const Quantity< Meter >  width,
const Quantity< Meter >  height,
const Vector3< Quantity< Pascal > > &  traction,
const IsotropicMaterial &  material 
)
inlineexplicitnoexcept

Construct a rectangular surface traction.

Parameters
centerCenter of the rectangle
u_axisDirection of the width axis (unit vector)
v_axisDirection of the height axis (unit vector)
widthLength along u_axis
heightLength along v_axis
tractionUniform traction vector
materialMaterial properties

u_axis and v_axis must be orthogonal. This is checked at runtime.

Definition at line 44 of file SurfaceForce.hpp.

Member Function Documentation

◆ GetForceAt()

Vector3< Quantity< Newton > > Phyth::Mechanics::SurfaceForce::GetForceAt ( const Vector3< Quantity< Meter > > &  point) const
inlineoverridevirtual

Get the force vector at a point.

Surface force is distributed, so returns zero at any single point.

Implements Phyth::Mechanics::ForceSource.

Definition at line 80 of file SurfaceForce.hpp.

◆ GetMinimumDistanceTo()

Quantity< Meter > Phyth::Mechanics::SurfaceForce::GetMinimumDistanceTo ( const Vector3< Quantity< Meter > > &  point) const
inlineoverridevirtual

Get the minimum distance from a point to the rectangular surface.

Parameters
pointPosition to compute distance from
Returns
Distance to the closest point on the surface

Implements Phyth::Mechanics::ForceSource.

Definition at line 101 of file SurfaceForce.hpp.

◆ GetStressAt()

Matrix3x3< Quantity< Pascal > > Phyth::Mechanics::SurfaceForce::GetStressAt ( const Vector3< Quantity< Meter > > &  point) const
inlineoverridevirtual

Compute stress tensor at a point using numerical integration.

Parameters
pointPosition to evaluate
Returns
Stress tensor in pascals

Implements Phyth::Mechanics::ForceSource.

Definition at line 69 of file SurfaceForce.hpp.

◆ GetTotalForce()

Vector3< Quantity< Newton > > Phyth::Mechanics::SurfaceForce::GetTotalForce ( ) const
inlineoverridevirtual

Get the total force of this source.

Returns
traction * area

Implements Phyth::Mechanics::ForceSource.

Definition at line 91 of file SurfaceForce.hpp.

◆ GetTraction()

Vector3< Quantity< Pascal > > Phyth::Mechanics::SurfaceForce::GetTraction ( ) const
inline

Get the traction vector.

Definition at line 118 of file SurfaceForce.hpp.

◆ NumericalIntegrateStress()

Matrix3x3< Quantity< Pascal > > Phyth::Mechanics::SurfaceForce::NumericalIntegrateStress ( const Vector3< Quantity< Meter > > &  point,
const int  nu,
const int  nv 
) const
inlineprivate

Numerical integration of stress over the surface.

Uses the midpoint rule with nu * nv segments. Each segment contributes dsigma = Kelvin(dF) where dF = traction * dA.

Parameters
pointEvaluation point
nuNumber of segments along u axis
nvNumber of segments along v axis
Returns
Stress tensor in pascals

Definition at line 147 of file SurfaceForce.hpp.

◆ SetTraction()

void Phyth::Mechanics::SurfaceForce::SetTraction ( const Vector3< Quantity< Pascal > > &  traction)
inline

Set the traction vector.

Definition at line 125 of file SurfaceForce.hpp.

Member Data Documentation

◆ center_

Vector3<Quantity<Meter> > Phyth::Mechanics::SurfaceForce::center_
private

Definition at line 130 of file SurfaceForce.hpp.

◆ height_

Quantity<Meter> Phyth::Mechanics::SurfaceForce::height_
private

Definition at line 132 of file SurfaceForce.hpp.

◆ material_

IsotropicMaterial Phyth::Mechanics::SurfaceForce::material_
private

Definition at line 134 of file SurfaceForce.hpp.

◆ traction_

Vector3<Quantity<Pascal> > Phyth::Mechanics::SurfaceForce::traction_
private

Definition at line 133 of file SurfaceForce.hpp.

◆ u_axis_

Vector3<Scalar> Phyth::Mechanics::SurfaceForce::u_axis_
private

Definition at line 131 of file SurfaceForce.hpp.

◆ v_axis_

Vector3<Scalar> Phyth::Mechanics::SurfaceForce::v_axis_
private

Definition at line 131 of file SurfaceForce.hpp.

◆ width_

Quantity<Meter> Phyth::Mechanics::SurfaceForce::width_
private

Definition at line 132 of file SurfaceForce.hpp.


The documentation for this class was generated from the following file: