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

Concentrated force acting at a single point in an elastic medium. More...

#include <PointForce.hpp>

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

Public Member Functions

 PointForce (const Vector3< Quantity< Meter > > &position, const Vector3< Quantity< Newton > > &force, const IsotropicMaterial &material) noexcept
 Construct a point force.
 
Matrix3x3< Quantity< Pascal > > GetStressAt (const Vector3< Quantity< Meter > > &point) const override
 Compute stress tensor at a point.
 
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 force location.
 
Vector3< Quantity< Meter > > GetPosition () const
 Get the force location.
 
Vector3< Quantity< Newton > > GetForce () const
 Get the force 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 Attributes

Vector3< Quantity< Meter > > position_
 
Vector3< Quantity< Newton > > force_
 
IsotropicMaterial material_
 

Detailed Description

Concentrated force acting at a single point in an elastic medium.

Produces a stress field via Kelvin's solution (Green's function for an infinite elastic medium).

Formula: sigma_ij(vec_r) = - (1 / (8 * pi * (1 - nu))) * [ (1 - 2*nu) * (vec_F_i * vec_r_j + vec_F_j * vec_r_i - delta_ij * (vec_F dot vec_r)) / r^3

Example:

auto force = std::make_shared<PointForce>(
);
elastic_field.AddSource(force);
constexpr bool is_unit_v
Definition Unit.hpp:79

Definition at line 31 of file PointForce.hpp.

Constructor & Destructor Documentation

◆ PointForce()

Phyth::Mechanics::PointForce::PointForce ( const Vector3< Quantity< Meter > > &  position,
const Vector3< Quantity< Newton > > &  force,
const IsotropicMaterial &  material 
)
inlineexplicitnoexcept

Construct a point force.

Parameters
positionLocation of the point force
forceForce vector
materialMaterial properties (uses Poisson's ratio only)

Definition at line 40 of file PointForce.hpp.

Member Function Documentation

◆ GetForce()

Vector3< Quantity< Newton > > Phyth::Mechanics::PointForce::GetForce ( ) const
inline

Get the force vector.

Returns
Force vector.

Definition at line 156 of file PointForce.hpp.

◆ GetForceAt()

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

Get the force vector at a point.

Returns the force only at the exact force location, otherwise zero.

Parameters
pointPosition to evaluate.
Returns
Force vector at that point.

Implements Phyth::Mechanics::ForceSource.

Definition at line 112 of file PointForce.hpp.

◆ GetMinimumDistanceTo()

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

Get the minimum distance from a point to the force location.

Parameters
pointPosition to compute distance from.
Returns
Distance to the force location.

Implements Phyth::Mechanics::ForceSource.

Definition at line 136 of file PointForce.hpp.

◆ GetPosition()

Vector3< Quantity< Meter > > Phyth::Mechanics::PointForce::GetPosition ( ) const
inline

Get the force location.

Returns
Position of the point force.

Definition at line 147 of file PointForce.hpp.

◆ GetStressAt()

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

Compute stress tensor at a point.

Parameters
pointPosition to evaluate
Returns
Stress tensor in pascals
Exceptions
std::runtime_errorIf point is at the force location
Note
Sign convention: tension positive (positive stress = tensile).
If you prefer "compression positive", multiply the result by -1.

Implements Phyth::Mechanics::ForceSource.

Definition at line 56 of file PointForce.hpp.

◆ GetTotalForce()

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

Get the total force of this source.

Returns
Total force vector.

Implements Phyth::Mechanics::ForceSource.

Definition at line 126 of file PointForce.hpp.

Member Data Documentation

◆ force_

Vector3<Quantity<Newton> > Phyth::Mechanics::PointForce::force_
private

Definition at line 162 of file PointForce.hpp.

◆ material_

IsotropicMaterial Phyth::Mechanics::PointForce::material_
private

Definition at line 163 of file PointForce.hpp.

◆ position_

Vector3<Quantity<Meter> > Phyth::Mechanics::PointForce::position_
private

Definition at line 161 of file PointForce.hpp.


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