Public Member Functions |
| CVX_Material (float youngsModulus=1e6f, float density=1e3f) |
| Default Constructor.
|
| CVX_Material (rapidjson::Value &mat) |
| Constructs this CVX_Material object from a rapidjson parser node that contains valid "materials" sub-nodes.
|
| CVX_Material (const CVX_Material &vIn) |
| Destructor. Specified as virtual so we can just keep track of generic material pointers for voxel and link materials.
|
virtual CVX_Material & | operator= (const CVX_Material &vIn) |
| Equals operator.
|
void | clear () |
| Resets all material information to default.
|
const char * | lastError () const |
| Returns the last error encountered for this object.
|
void | setName (const char *name) |
| Adds an optional name to the material.
|
const char * | name () const |
| Returns the optional material name if one was specifed. Otherwise returns an empty string.
|
float | stress (float strain, float transverseStrainSum=0.0f, bool forceLinear=false) |
| returns the stress of the material model accounting for volumetric strain effects.
|
float | modulus (float strain) |
| returns the modulus (slope of the stress/strain curve) of the material model at the specified strain.
|
bool | isYielded (float strain) |
| Returns true if the specified strain is past the yield point (if one is specified).
|
bool | isFailed (float strain) |
| Returns true if the specified strain is past the failure point (if one is specified).
|
void | setColor (int red, int green, int blue, int alpha=255) |
| Sets the material color. Values from [0,255].
|
void | setRed (int red) |
| Sets the red channel of the material color.
|
void | setGreen (int green) |
| Sets the green channel of the material color.
|
void | setBlue (int blue) |
| Sets the blue channel of the material color.
|
void | setAlpha (int alpha) |
| Sets the alpha channel of the material color.
|
int | red () const |
| Returns the red channel of the material color [0,255] or -1 if unspecified.
|
int | green () const |
| Returns the green channel of the material color [0,255] or -1 if unspecified.
|
int | blue () const |
| Returns the blue channel of the material color [0,255] or -1 if unspecified.
|
int | alpha () const |
| Returns the alpha channel of the material color [0,255] or -1 if unspecified.
|
bool | setModel (int dataPointCount, float *pStrainValues, float *pStressValues) |
| Defines the physical material behavior with a series of true stress/strain data points.
|
bool | setModelLinear (float youngsModulus, float failureStress=-1) |
| Convenience function to quickly define a linear material.
|
bool | setModelBilinear (float youngsModulus, float plasticModulus, float yieldStress, float failureStress=-1) |
| Convenience function to quickly define a bilinear material.
|
bool | isModelLinear () const |
| Returns true if the material model is a simple linear behavior.
|
float | youngsModulus () const |
| Returns Youngs modulus in Pa.
|
float | yieldStress () const |
| Returns the yield stress in Pa or -1 if unspecified.
|
float | failureStress () const |
| Returns the failure stress in Pa or -1 if unspecified.
|
int | modelDataPoints () const |
| Returns the number of data points in the current material model data arrays.
|
const float * | modelDataStrain () const |
| Returns a pointer to the first strain value data point in a continuous array. The number of values can be determined from modelDataPoints(). The assumed first value of 0 is included.
|
const float * | modelDataStress () const |
| Returns a pointer to the first stress value data point in a continuous array. The number of values can be determined from modelDataPoints(). The assumed first value of 0 is included.
|
void | setPoissonsRatio (float poissonsRatio) |
| Defines Poisson's ratio for the material.
|
float | poissonsRatio () const |
| Returns the current Poissons ratio.
|
float | bulkModulus () const |
| Calculates the bulk modulus from Young's modulus and Poisson's ratio.
|
float | lamesFirstParameter () const |
| Calculates Lame's first parameter from Young's modulus and Poisson's ratio.
|
float | shearModulus () const |
| Calculates the shear modulus from Young's modulus and Poisson's ratio.
|
bool | isXyzIndependent () const |
| Returns true if poisson's ratio is zero - i.e. deformations in each dimension are independent of those in other dimensions.
|
void | setDensity (float density) |
| Defines the density for the material in Kg/m^3.
|
float | density () const |
| Returns the current density.
|
void | setStaticFriction (float staticFrictionCoefficient) |
| Defines the coefficient of static friction.
|
float | staticFriction () const |
| Returns the current coefficient of static friction.
|
void | setKineticFriction (float kineticFrictionCoefficient) |
| Defines the coefficient of kinetic friction.
|
float | kineticFriction () const |
| Returns the current coefficient of kinetic friction.
|
void | setInternalDamping (float zeta) |
| Defines the internal material damping ratio. The effect is to damp out vibrations within a structure. zeta = mu/2 (mu = loss factor) = 1/(2Q) (Q = amplification factor). High values of zeta may lead to simulation instability. Recommended value: 1.0.
|
float | internalDamping () const |
| Returns the internal material damping ratio.
|
void | setGlobalDamping (float zeta) |
| Defines the viscous damping of any voxels using this material relative to ground (no motion). Translation C (damping coefficient) is calculated according to zeta*2*sqrt(m*k) where k=E*nomSize. Rotational damping coefficient is similarly calculated High values relative to 1.0 may cause simulation instability.
|
float | globalDamping () const |
| Returns the global material damping ratio.
|
void | setCollisionDamping (float zeta) |
| Defines the material damping ratio for when this material collides with something. This gives some control over the elasticity of a collision. A value of zero results in a completely elastic collision.
|
float | collisionDamping () const |
| Returns the collision material damping ratio.
|
void | setExternalScaleFactor (Vec3D< double > factor) |
| Scales all voxels of this material by a specified factor in each dimension (1.0 is no scaling). This allows enables volumetric displacement-based actuation within a structure. As such, mass is unchanged when the external scale factor changes. Actual size is obtained by multiplying nominal size by the provided factor.
|
void | setExternalScaleFactor (double factor) |
| Convenience function to specify isotropic external scaling factor. See setExternalScaleFactor(Vec3D<> factor).
|
Vec3D< double > | externalScaleFactor () |
| Returns the current external scaling factor (unitless). See description of setExternalScaleFactor().
|
void | setCte (float cte) |
| Defines the coefficient of thermal expansion.
|
float | cte () const |
| Returns the current coefficient of thermal expansion per degree C.
|
Protected Member Functions |
virtual bool | updateAll () |
| Updates and recalculates eveything possible (used by inherited classed when material properties have changed)
|
virtual bool | updateDerived () |
| Updates all the derived quantities cached as member variables for this and derived classes. (Especially if density, size or elastic modulus changes.)
|
void | writeJSON (rapidjson::PrettyWriter< rapidjson::StringBuffer > &w) |
| Writes this material's data to the rapidjson writing object.
|
bool | readJSON (rapidjson::Value &mat) |
| reads this material data from the rapidjson Value.
|
Protected Attributes |
std::string | error |
| The last error encountered.
|
std::string | myName |
| The name of this material. Default is "".
|
int | r |
| Red color value of this material from 0-255. Default is -1 (invalid/not set).
|
int | g |
| Green color value of this material from 0-255. Default is -1 (invalid/not set).
|
int | b |
| Blue color value of this material from 0-255. Default is -1 (invalid/not set).
|
int | a |
| Alpha value of this material from 0-255. Default is -1 (invalid/not set).
|
bool | linear |
| Set to true if this material is specified as linear.
|
float | E |
| Young's modulus (stiffness) in Pa.
|
float | sigmaYield |
| Yield stress in Pa.
|
float | sigmaFail |
| Failure stress in Pa.
|
std::vector< float > | strainData |
| strain data points
|
std::vector< float > | stressData |
| stress data points
|
float | nu |
| Poissonss Ratio.
|
float | rho |
| Density in Kg/m^3.
|
float | alphaCTE |
| Coefficient of thermal expansion (CTE)
|
float | muStatic |
| Static coefficient of friction.
|
float | muKinetic |
| Kinetic coefficient of friction.
|
float | zetaInternal |
| Internal damping ratio.
|
float | zetaGlobal |
| Global damping ratio.
|
float | zetaCollision |
| Collision damping ratio.
|
Vec3D< double > | extScale |
| A prescribed scaling factor. default of (1,1,1) is no scaling.
|
float | _eHat |
| Cached effective elastic modulus for materials with non-zero Poisson's ratio.
|
std::vector< CVX_Material * > | dependentMaterials |
| Any materials in this list will have updateDerived() called whenever it's called for this material. For example, in Voxelyze this is used for updatng link materials when one or both voxel materials change.
|
Friends |
class | CVoxelyze |
class | CVX_Voxel |
class | CVX_Link |
Defines the properties a raw material.
Contains all information relevant to a physical material to be simulated. All units are SI standard.
A physical material model may be specified as a series of true stress/strain data points, or by simple linear or bilinear parameters.
If a function returns unsuccessfully, check lastError() for the cause.