76 vector p0 = pMin, p1 = pMax;
77 p0[axis] =
min(
max(distances[i], pMin[axis]), pMax[axis]);
78 p1[axis] =
min(
max(distances[i + 1], pMin[axis]), pMax[axis]);
100 const vector pMin =
c() - L_/2;
101 const vector pMax =
c() + L_/2;
105 vector p0 = pMin, p1 = pMax;
106 p0[axis] =
min(
max(distances[i], pMin[axis]), pMax[axis]);
107 p1[axis] =
min(
max(distances[i + 1], pMin[axis]), pMax[axis]);
129 const vector pMin =
c() - L_/2;
130 const vector pMax =
c() + L_/2;
134 vector p0 = pMin, p1 = pMax;
135 p0[axis] =
min(
max(distances[i], pMin[axis]), pMax[axis]);
136 p1[axis] =
min(
max(distances[i + 1], pMin[axis]), pMax[axis]);
138 const vector d1 = p1 - p0;
150 result[i].xx() = d3.
x()*d1.
y()*d1.
z()*
rho;
151 result[i].xy() = d2.
x()*d2.
y()*d1.
z()*
rho;
152 result[i].xz() = d2.
x()*d1.
y()*d2.
z()*
rho;
153 result[i].yy() = d1.
x()*d3.
y()*d1.
z()*
rho;
154 result[i].yz() = d1.
x()*d2.
y()*d2.
z()*
rho;
155 result[i].zz() = d1.
x()*d1.
y()*d3.
z()*
rho;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Specialisation of rigidBody to construct a cuboid given the mass and lengths of the sides.
virtual tmp< vectorField > sectionMu1s(const direction axis, const scalarField &distances) const
Return the first moments of the sections of the body between.
virtual void write(Ostream &) const
Write.
virtual ~cuboid()
Destructor.
virtual tmp< symmTensorField > sectionMu2s(const direction axis, const scalarField &distances) const
Return the second moments of the sections of the body between.
virtual autoPtr< rigidBody > clone() const
Return clone of this cuboid.
cuboid(const word &name, const scalar m, const vector &c, const vector &L)
Construct from name, mass, centre of mass and lengths of the sides.
virtual tmp< scalarField > sectionMu0s(const direction axis, const scalarField &distances) const
Return the zeroth moments of the sections of the body between.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
addToRunTimeSelectionTable(rigidBody, cuboid, dictionary)
defineTypeNameAndDebug(cuboid, 0)
const dimensionedScalar c
Speed of light in a vacuum.
tmp< DimensionedField< Type, GeoMesh, Field > > cmptMultiply(const DimensionedField< Type, GeoMesh, PrimitiveField1 > &df1, const DimensionedField< Type, GeoMesh, PrimitiveField2 > &df2)
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Specialisations of Field<T> for scalar, vector and tensor.