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

Abstract base class for all force/traction distributions. More...

#include <ForceSource.hpp>

Inheritance diagram for Phyth::Mechanics::ForceSource:
Inheritance graph
[legend]

Public Member Functions

virtual ~ForceSource ()=default
 
virtual Matrix3x3< Quantity< Pascal > > GetStressAt (const Vector3< Quantity< Meter > > &point) const =0
 Compute the stress tensor at a point.
 
virtual Vector3< Quantity< Newton > > GetForceAt (const Vector3< Quantity< Meter > > &point) const =0
 Compute the force vector at a point.
 
virtual Vector3< Quantity< Newton > > GetTotalForce () const =0
 Get the total force of this source.
 
virtual Vector3< Quantity< NewtonPerMeterCubed > > GetBodyForceDensityAt (const Vector3< Quantity< Meter > > &point) const
 Get the body force density at a point.
 
virtual Quantity< Meter > GetMinimumDistanceTo (const Vector3< Quantity< Meter > > &point) const =0
 Get the minimum distance from a point to this force source.
 

Detailed Description

Abstract base class for all force/traction distributions.

ForceSource defines the interface for any mechanical loading that produces a stress field. Subclasses represent specific loading geometries such as point forces, surface tractions, body forces, or distributed loads.

The interface provides methods for computing:

Example: class PointForce : public ForceSource { // Implements GetStressAt, GetForceAt, GetTotalForce, // GetBodyForceDensityAt, GetMinimumDistanceTo };

Definition at line 31 of file ForceSource.hpp.

Constructor & Destructor Documentation

◆ ~ForceSource()

virtual Phyth::Mechanics::ForceSource::~ForceSource ( )
virtualdefault

Member Function Documentation

◆ GetBodyForceDensityAt()

virtual Vector3< Quantity< NewtonPerMeterCubed > > Phyth::Mechanics::ForceSource::GetBodyForceDensityAt ( const Vector3< Quantity< Meter > > &  point) const
inlinevirtual

Get the body force density at a point.

Parameters
pointPosition in 3D space (meters)
Returns
Body force density (N/m^3)

The default implementation returns zero for non-distributed sources (point forces, surface tractions). Subclasses for distributed sources (volume forces) should override this.

Reimplemented in Phyth::Mechanics::VolumeForce.

Definition at line 84 of file ForceSource.hpp.

◆ GetForceAt()

virtual Vector3< Quantity< Newton > > Phyth::Mechanics::ForceSource::GetForceAt ( const Vector3< Quantity< Meter > > &  point) const
pure virtual

Compute the force vector at a point.

Parameters
pointPosition in 3D space (meters)
Returns
Force vector (Newtons)

This provides a simplified view of the loading. For point forces, this returns the force at the point. For distributed loads, this may be zero (use GetBodyForceDensityAt instead).

Implemented in Phyth::Mechanics::PointForce, Phyth::Mechanics::SurfaceForce, and Phyth::Mechanics::VolumeForce.

◆ GetMinimumDistanceTo()

virtual Quantity< Meter > Phyth::Mechanics::ForceSource::GetMinimumDistanceTo ( const Vector3< Quantity< Meter > > &  point) const
pure virtual

Get the minimum distance from a point to this force source.

Parameters
pointPosition in 3D space (meters)
Returns
Minimum distance (meters)

This is used for regularization in field computations to avoid singularities. For point forces, this returns the distance to the point force location. For extended sources, this returns the distance to the nearest point on the source geometry.

Implemented in Phyth::Mechanics::PointForce, Phyth::Mechanics::SurfaceForce, and Phyth::Mechanics::VolumeForce.

◆ GetStressAt()

virtual Matrix3x3< Quantity< Pascal > > Phyth::Mechanics::ForceSource::GetStressAt ( const Vector3< Quantity< Meter > > &  point) const
pure virtual

Compute the stress tensor at a point.

Parameters
pointPosition in 3D space (meters)
Returns
Stress tensor σ (Pa) as a 3x3 matrix

This is the primary method for mechanics-EM coupling. For point forces, this uses Kelvin's solution. For distributed loads, this integrates over the source geometry.

Implemented in Phyth::Mechanics::PointForce, Phyth::Mechanics::SurfaceForce, and Phyth::Mechanics::VolumeForce.

◆ GetTotalForce()

virtual Vector3< Quantity< Newton > > Phyth::Mechanics::ForceSource::GetTotalForce ( ) const
pure virtual

Get the total force of this source.

Returns
Total force (Newtons) as a vector

For point forces, this is the force value itself. For distributed loads, this is the integral of body force density.

Implemented in Phyth::Mechanics::PointForce, Phyth::Mechanics::SurfaceForce, and Phyth::Mechanics::VolumeForce.


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