1#ifndef PHYTH_VOLUME_FORCE_HPP
2#define PHYTH_VOLUME_FORCE_HPP
174 for (
int i = 0;
i <
nx; ++
i) {
175 for (
int j = 0;
j <
ny; ++
j) {
176 for (
int k = 0;
k <
nz; ++
k) {
195 for (
int m = 0;
m < 3; ++
m) {
196 for (
int n = 0;
n < 3; ++
n) {
Linear elastic isotropic material model.
Scalar GetPoissonRatio() const
Get Poisson's ratio.
Abstract base class for all force/traction distributions.
Uniform body force distributed over a rectangular box.
Vector3< Quantity< Newton > > GetTotalForce() const override
Get the total force of this source.
Matrix3x3< Quantity< Pascal > > NumericalIntegrateStress(const Vector3< Quantity< Meter > > &point, const int nx, const int ny, const int nz) const
Numerical integration of stress over the volume.
void SetForceDensity(const Vector3< Quantity< NewtonPerMeterCubed > > &force_density)
Set the force density vector.
Vector3< Quantity< NewtonPerMeterCubed > > force_density_
Vector3< Quantity< NewtonPerMeterCubed > > GetBodyForceDensityAt(const Vector3< Quantity< Meter > > &point) const override
Get the body force density at a point.
Vector3< Quantity< NewtonPerMeterCubed > > GetForceDensity() const
Get the force density vector.
Quantity< Meter > GetMinimumDistanceTo(const Vector3< Quantity< Meter > > &point) const override
Get the minimum distance from a point to the rectangular volume.
Matrix3x3< Quantity< Pascal > > GetStressAt(const Vector3< Quantity< Meter > > &point) const override
Compute stress tensor at a point using numerical integration.
Vector3< Quantity< Meter > > center_
IsotropicMaterial material_
Vector3< Quantity< Newton > > GetForceAt(const Vector3< Quantity< Meter > > &point) const override
Get the force vector at a point.
VolumeForce(const Vector3< Quantity< Meter > > ¢er, const Quantity< Meter > width, const Quantity< Meter > height, const Quantity< Meter > depth, const Vector3< Quantity< NewtonPerMeterCubed > > &force_density, const IsotropicMaterial &material) noexcept
Construct a rectangular volume force.
Quantity< Meter > height_
auto abs(Quantity< UnitT > q)
Absolute value of a quantity.
3x3 matrix with Quantity components
Physical quantity with a value and a compile-time unit.
3D vector with Quantity components
auto Length() const
Euclidean length (magnitude)