|
| | Stress (std::string name, const Method< TMethod > &method, TGrid *pgrid) |
| | Constructs a Stress object.
|
| |
| | Stress (const Method< TMethod > &method, TGrid *pgrid) |
| | Constructs a Stress object.
|
| |
| void | write () |
| | Write stress and, for Cauchy stress, density fields.
|
| |
| void | write (const std::string &filename) |
| |
| void | write_voxel_grid (const int nx, const int ny, const int nz, const Vector3d &lowerLimit, const Vector3d &upperLimit) |
| | Write structured grid fields in LAMMPS dump-grid format.
|
| |
| void | write_voxel_grid (const std::string &filename, const int nx, const int ny, const int nz, const Vector3d &lowerLimit, const Vector3d &upperLimit) |
| |
| | ~Stress () |
| |
template<typename TMethod,
StressType stressType, typename TGrid = typename std::conditional<stressType==Piola,Grid<Reference>,Grid<Current>>::type>
class Stress< TMethod, stressType, TGrid >
Three-dimensional stress field on a grid.
The stress field is computed using a prescribed averaging method. For Cauchy stresses, the object also stores continuum momentum density, mass density, and the internal continuum velocity used to form the kinetic stress from relative velocities. These continuum fields are not defined for Piola stresses; the kinetic contribution to Piola stress is taken to be zero.
- Template Parameters
-
| TMethod | - Method template parameter. For example, TMethod=MethodSphere for a spherical averaging domain and TMethod=MethodLDAD for LDAD. For a user-defined averaging domain, TMethod=MethodUser |
| stressType | - Piola or Cauchy |
| TGrid | - pointer to Grid<Reference> or Grid<Current> depending on whether stressType is Piola or Cauchy, respectively |
- Examples
- crack/main.cpp, testIdealGas.cpp, testLDADLJ.cpp, testLDADSWTriclinic.cpp, testLJ.cpp, and testMls.cpp.
Definition at line 42 of file Stress.h.
template<typename TMethod ,
StressType stressType, typename TGrid = typename std::conditional<stressType==Piola,Grid<Reference>,Grid<Current>>::type>
| void Stress< TMethod, stressType, TGrid >::write |
( |
| ) |
|
|
inline |
Write stress and, for Cauchy stress, density fields.
This function writes the stress field to [name].stress. The stress file is OVITO-readable and contains nine columns: grid coordinates followed by \(\sigma_{xx}\), \(\sigma_{yy}\), \(\sigma_{zz}\), \(\sigma_{xy}\), \(\sigma_{xz}\), and \(\sigma_{yz}\).
For Cauchy stress objects, two additional OVITO-readable files are written:
[name].momentum_density, with grid coordinates and \(\mathbf p(\mathbf x)\).
[name].mass_density, with grid coordinates and \(\rho(\mathbf x)\).
The continuum velocity field is an internal intermediate and is not written.
Use write_voxel_grid() for optional structured-grid output in LAMMPS dump-grid format.
- Examples
- crack/main.cpp, testLDADLJ.cpp, and testLJ.cpp.
Definition at line 146 of file Stress.h.
template<typename TMethod ,
StressType stressType, typename TGrid = typename std::conditional<stressType==Piola,Grid<Reference>,Grid<Current>>::type>
| void Stress< TMethod, stressType, TGrid >::write_voxel_grid |
( |
const int |
nx, |
|
|
const int |
ny, |
|
|
const int |
nz, |
|
|
const Vector3d & |
lowerLimit, |
|
|
const Vector3d & |
upperLimit |
|
) |
| |
|
inline |
Write structured grid fields in LAMMPS dump-grid format.
This output is intended for direct visualization of structured stress grids in OVITO. The caller must provide the grid dimensions and orthogonal bounding box used to create the grid. The grid dimensions are checked against field.size() before writing.
The dump-grid DIMENSION is inferred from the number of grid counts greater than one. Bounds are shifted by half a grid spacing along active directions so that voxel cell centers coincide with the MDStressLab grid coordinates; inactive directions are written as a collapsed plane.
The stress tensor is written to [name].voxel_grid_stress with component order SXX SYY SZZ SYZ SXZ SXY, matching LAMMPS/OVITO dump-grid conventions. For Cauchy stress objects, this function also writes [name].voxel_grid_momentum_density and [name].voxel_grid_mass_density.
The values are written in the same order as pgrid->coordinates.
Definition at line 227 of file Stress.h.