#include <DislocationDynamicsModule.h>
Public Types | |
Type and constant definitions | |
enum | VISUALIZATION_FILE_FORMAT { ASCII = 0, BINARY = 1 } |
Public Member Functions | |
Constructor and destructor | |
DislocationDynamicsModule (Pointer< Database > input_db, Pointer< PatchHierarchy< 3 > > patch_hierarchy, ElasticStressStrategy *elastic_stress_strategy, LSMDD_PhysicsStrategy *lsmdd_physics_strategy) | |
virtual | ~DislocationDynamicsModule () |
Accessor methods for level set functions and related data | |
virtual int | getPhiPatchDataHandle () const |
virtual int | getPsiPatchDataHandle () const |
virtual int | getVelocityPatchDataHandle () const |
virtual int | getControlVolumePatchDataHandle () const |
Accessor methods for simulation state | |
virtual double | getStartTime () const |
virtual double | getEndTime () const |
virtual double | getCurrentTime () const |
virtual bool | endTimeReached () const |
virtual int | numSimulationStepsTaken () const |
virtual void | printClassData (ostream &os) const |
Methods for time advancing dislocation lines | |
virtual void | initializeDislocationLevelSetFunctions () |
virtual double | computeNextDt () |
virtual void | advanceDislocations (const double dt) |
virtual bool | toggleUpwindDirection () |
Visualization methods | |
virtual void | writeAllDislocationLinesToFile (const string &base_name, const VISUALIZATION_FILE_FORMAT file_type=ASCII) |
virtual void | writeOneDislocationLineToFile (const int line_handle, const string &base_name, const VISUALIZATION_FILE_FORMAT file_type=ASCII, const bool overwrite_file=true, const bool allocate_scratch_data=true) |
Inherited methods | |
Methods inherited from the LevelSetMethodPatchStrategy and LevelSetMethodVelocityStrategy Classes. Users need not be concerned with these methods. | |
virtual void | initializeLevelSetFunctionsOnPatch (Patch< 3 > &patch, const double time, const int phi_handle, const int psi_handle) |
virtual void | setLevelSetFunctionBoundaryConditions (Patch< 3 > &patch, const double fill_time, const int phi_handle, const int psi_handle, const IntVector< 3 > &ghost_width_to_fill) |
virtual double | computeStableDtOnPatch (Patch< 3 > &patch, LevelSetFunctionIntegrator< 3 > *lsm_integrator, LevelSetMethodVelocityFieldStrategy< 3 > *lsm_velocity_field_strategy) |
virtual bool | providesExternalVelocityField () const |
virtual bool | providesNormalVelocityField () const |
virtual int | getExternalVelocityFieldPatchDataHandle (int component) const |
virtual int | getNormalVelocityFieldPatchDataHandle (LEVEL_SET_FCN_TYPE level_set_fcn, int component) const |
virtual void | setCurrentTime (const double time) |
virtual double | computeStableDt () |
virtual void | computeVelocityField (const double time, const int phi_handle, const int psi_handle, const int line_handle) |
virtual void | initializeLevelData (const Pointer< PatchHierarchy< 3 > > hierarchy, const int level_number, const double init_data_time, const int phi_handle, const int psi_handle, const bool can_be_refined, const bool initial_time, const Pointer< PatchLevel< 3 > > old_level=Pointer< PatchLevel< 3 > >((0)), const bool allocate_data=true) |
virtual void | resetHierarchyConfiguration (Pointer< PatchHierarchy< 3 > > hierarchy, const int coarsest_level, const int finest_level) |
Protected Member Functions | |
Utility methods | |
virtual void | getFromInput (Pointer< Database > input_db) |
virtual void | computeDislocationLineField (const int line_handle, const int phi_handle, const int psi_handle) |
virtual void | computeUnitTangentVectorForDislocationLine (const int tangent_vector_handle, const int line_handle, const int phi_handle, const int psi_handle) |
virtual void | initializeVariables () |
virtual void | initializeCommunicationObjects () |
virtual void | fillGhostCellsForLevelSetFunctions (const int line_handle, const int phi_handle, const int psi_handle) |
virtual void | writeOneDislocationLineToAsciiFile (const string &base_name, const int line_handle, const bool overwrite_file=true) |
virtual void | writeOneDislocationLineToBinaryFile (const string &base_name, const int line_handle, const bool overwrite_file=true) |
Protected Attributes | |
double | d_start_time |
double | d_end_time |
SPATIAL_DERIVATIVE_TYPE | d_spatial_derivative_type |
int | d_spatial_derivative_order |
int | d_num_stabilization_iterations |
int | d_reinitialization_interval |
int | d_use_reinitialization |
int | d_orthogonalization_interval |
int | d_use_orthogonalization |
bool | d_use_persistent_velocity_data |
LSMDD_Parameters | d_lsmdd_params |
Pointer< PatchHierarchy< 3 > > | d_patch_hierarchy |
Pointer< CartesianGridGeometry< 3 > > | d_grid_geometry |
Array< BurgersVector > | d_burgers_vectors |
int | d_num_dislocation_lines |
Pointer< LevelSetMethodAlgorithm< 3 > > | d_lsm_algorithm |
Pointer< FieldExtensionAlgorithm< 3 > > | d_lsm_phi_field_extension_alg |
Pointer< FieldExtensionAlgorithm< 3 > > | d_lsm_psi_field_extension_alg |
ElasticStressStrategy * | d_elastic_stress_strategy |
LSMDD_PhysicsStrategy * | d_lsmdd_physics_strategy |
Pointer< BoundaryConditionModule< 3 > > | d_level_set_fcn_bc_module |
Array< IntVector< 3 > > | d_lower_bc_phi |
Array< IntVector< 3 > > | d_upper_bc_phi |
Array< IntVector< 3 > > | d_lower_bc_psi |
Array< IntVector< 3 > > | d_upper_bc_psi |
IntVector< 3 > | d_lower_bc_velocity |
IntVector< 3 > | d_upper_bc_velocity |
IntVector< 3 > | d_level_set_fcn_scratch_ghostcell_width |
int | d_phi_scratch_handle |
int | d_psi_scratch_handle |
int | d_grad_phi_plus_handle |
int | d_grad_phi_minus_handle |
int | d_grad_phi_central_handle |
int | d_grad_psi_plus_handle |
int | d_grad_psi_minus_handle |
int | d_grad_psi_central_handle |
int | d_dislocation_line_field_handle |
int | d_velocity_handle |
int | d_aux_stress_field_handle |
int | d_force_handle |
vector< int > | d_tangent_vector_handles |
int | d_distance_handle |
ComponentSelector | d_tangent_vectors |
Pointer< RefineAlgorithm< 3 > > | d_level_set_fcn_fill_bdry_alg |
Array< Pointer< RefineSchedule< 3 > > > | d_level_set_fcn_fill_bdry_sched |
Pointer< RefineAlgorithm< 3 > > | d_force_interp_fill_bdry_alg |
Array< Pointer< RefineSchedule< 3 > > > | d_force_interp_fill_bdry_sched |
Pointer< RefineAlgorithm< 3 > > | d_tangent_fill_bdry_alg |
Array< Pointer< RefineSchedule< 3 > > > | d_tangent_fill_bdry_sched |
double | d_current_time |
double | d_last_stress_update_time |
int | d_num_simulation_steps_taken |
bool | d_upwind_spatial_derivative_flag |
bool | d_hierarchy_configuration_needs_reset |
bool | d_velocity_data_allocated |
Static Protected Attributes | |
const int | s_lsmdd_version |
const int | s_lsmdd_binary_output_max_num_dislocations |
The numerical algorithms underlying the LSMDD were originally developed by Xiang et. al. in their series of papers on level set method approaches for simulating dislocation dynamics. However, because there are still open research questions about how various aspects of dislocation motion and interactions, the LSMDD library has been designed to allow flexibility in how the physics of dislocations are computationally modeled. For example, the library has been designed to allow a user to supply his/her algorithms for computing the forces on and velocity on dislocation lines.
The parallel level set method calculations required by LSMDD are provided by the Level Set Method Library (LSMLIB). We have leveraged the vector level set method calculations and standard level set method discretizations provided by LSMLIB. The parallel and restart capabilities of LSMDD are provided by the Structured Adaptive Mesh Refinement Application Infrastructure (SAMRAI) developed in the Center for Applied Scientific Computing at Lawrence Livermore National Laboratory. It is worth mentioning that the LSMLIB also relies heavily on SAMRAI for its parallel and restart capabilities.
For more details about the numerical algorithms used by specific elastic stress modules or dislocation force modules, see the documentation for those modules.
When using the DislocationDynamicsModule, it is possible to modify the behavior of the module through an input file. The input data parameters available for/required by the user are described below. In the input file, the parameters for the components of the DislocationDynamicsModule must each have their own separate sub-databases. That is, the input file should have the following form:
... input parameters for DislocationDynamicsModule ...
LSMDD_Parameters { ... input parameters for LSMDD_Parameters ... }
LevelSetMethodAlgorithm {
LevelSetFunctionIntegrator { ... input parameters for LevelSetFunctionIntegrator ... }
LevelSetMethodGriddingAlgorithm { ... input parameters LevelSetMethodGriddingAlgorithm ... }
} // end input database for LevelSetMethodAlgorithm
FieldExtensionAlgorithm { ... input parameters FieldExtensionAlgorithm ... }
} // end input database for DislocationDynamicsModule
DislocationDynamicsModule Input Database Parameters
Dislocation Dynamics Module Parameters:
There are two parts to the input for the LevelSetMethodAlgorithm: LevelSetFunctionIntegrator and LevelSetMethodGriddingAlgorithm.
The input parameters for the LevelSetFunctionIntegrator are:
The input parameters for the LevelSetMethodGriddingAlgorithm are:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ DislocationDynamicsModule {
num_stabilization_iterations = 4 use_persistent_velocity_data = TRUE spatial_derivative_type = WENO spatial_derivative_order = 5
shear_modulus = 1.0 poisson_ratio = 0.33333
climb_mobility = 1 glide_mobility = 1
core_radius = 3
min_dislocation_segment_length = 1e-6 max_angle_for_pure_screw = .1
debug_on = FALSE
}
LevelSetMethodAlgorithm{
LevelSetFunctionIntegrator { start_time = 0.0 end_time = 2000.0
spatial_derivative_type = "WENO" spatial_derivative_order = 5 tvd_runge_kutta_order = 3 cfl_number = 0.5
reinitialization_interval = 50 reinitialization_max_iters = 20 orthogonalization_interval = 50 orthogonalization_max_iters = 20
verbose = FALSE
} // end of LevelSetFunctionIntegrator database
LevelSetMethodGriddingAlgorithm { max_levels = 1
largest_patch_size { level_0 = 10000, 10000, 10000 }
} // end of LevelSetMethodGriddingAlgorithm database
} // end of LevelSetMethodAlgorithm database
FieldExtensionAlgorithm {
spatial_derivative_type = "WENO" spatial_derivative_order = 1 tvd_runge_kutta_order = 1 cfl_number = 0.5
max_iterations = 20
verbose_mode = TRUE
} // end of FieldExtensionAlgorithm database
} // end of DislocationDynanmicsModule database
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NOTES
WARNING MESSAGE: LSMDD_LSM_Algorithm::LevelSetMethodGriddingAlgorithm:getFromInput No `tagging_method' entry specified, so cell tagging will NOT be performed. If you wish to invoke cell tagging, you must enter one or more valid tagging methods, of type GRADIENT_DETECTOR, RICHARDSON_EXTRAPOLATION, or REFINE_BOXES See class header for details.It is perfectly safe to ignore this warning.
|
Enumerated type for the different visualization file formats |
|
The constructor creates a LevelSetMethodAlgorithm to track the motion of dislocation lines during the simulation, creates FieldExtensionAlgorithms to extend the velocity field off of dislocation lines, and initializes the state of the DislocationDynamicsModule using the parameters from the input database. Arguments:
|
|
The destructor deallocates memory used during the simulation. |
|
advanceDislocations() advances all of the dislocations in the simulation by computing the stress field associated with the dislocations, using this stress field to compute the forces and velocities on each of the dislocations, and advancing the dislocation level set functions with the calculated velocities. Arguments:
Return value: none |
|
computeDislocationLineField() computes the dislocation line field ( delta(phi)*delta(psi)*unit_tangent_vector ) required to calculate the elastic stress field due to dislocation lines for a single dislocation line. Arguments:
Return value: none |
|
computeNextDt() computes the maximum stable dt for the next time step. Arguments: none Return value: dt |
|
computeStableDt() just returns the largest double value because there is no dynamics in the elastic stress calculation that would impact the time step size (i.e. the material is assumed to respond instantaneously). Arguments: none Return value: maximum acceptable (stable) time step |
|
computeStableDtOnPatch() passes the request to the LSMDD_PhysicsStrategy object. Arguments:
Return value: user-specified time step dt |
|
computeUnitTangentVectorForDislocationLine() computes the tangent vector for the dislocation line associated with a single Burgers vector which is used to compute the force on a dislocation line via the formula: (sigma dot b) cross tangent Arguments:
Return value: none NOTES:
|
|
computeVelocityField() computes all necessary level set method velocity fields on the entire hierarchy. Arguments:
Return value: none |
|
endTimeReached() returns true if the end time for the simulation has been reached; otherwise, it returns false. Arguments: none Return value: true if the current time is equal to or after the end time for the simulation; false otherwise |
|
fillGhostCellsForLevelSetFunctions() fills the ghostcells for the level set functions phi and psi. Ghostcells corresponding to grid cells in the interior of the computational domain are filled by copying data from neighboring patches. Ghostcells corresponding to cells outside of the computational domain are filled either by (1) copying data from the appropriate grid cells for periodic boundary conditions or (2) calling the setLevelSetFunctionBoundaryConditions() method in the user-defined subclass of the LSMDD_PhysicsStrategy class. Arguments:
Return value: none NOTES:
|
|
getControlVolumePatchDataHandle() returns the patch data handle for the control volume. Arguments: none Return value: PatchData handle for control volume |
|
getCurrentTime() returns the current simulation time. Arguments: none Return value: current time |
|
getEndTime() returns the simulation end time. Arguments: none Return value: end time |
|
Accessor method for the external (vector) velocity field PatchData handle. Arguments:
Return value: PatchData handle for the external velocity field data |
|
Arguments:
Return value: none |
|
getNormalVelocityFieldPatchDataHandle() returns a bogus PatchData handle since the dislocation dynamics requires a vector velocity field, not just the normal velocity. Arguments:
Return value: -1 |
|
getPhiPatchDataHandle() returns the patch data handle for phi. Arguments: none Return value: PatchData handle for phi |
|
getPsiPatchDataHandle() returns the patch data handle for psi. Arguments: none Return value: PatchData handle for psi |
|
getStartTime() returns the simulation start time. Arguments: none Return value: start time |
|
getVelocityPatchDataHandle() returns the patch data handle for the velocity. Arguments: none Return value: PatchData handle for velocity |
|
initializeCommunicationObjects() initializes the objects involved in communication between patches (including inter-node data transfers). Arguments: none Return value: none |
|
initializeDislocationsLevelSetFunctions() initializes the level set functions associated with each dislocation line in the simulation. Arguments: none Return value: none |
|
initializeLevelData() does not do anything since there are no fields that need to be initialized for the velocity field calculation. Arguments:
Return value: none |
|
initializeLevelSetFunctionsOnPatch() passes the request to the LSMDD_PhysicsStrategy object. Arguments:
Return value: none |
|
initializeVariables() sets up the variables and PatchData handles for the dislocation dynamics simulation. Arguments: none Return value: none |
|
numSimulationStepsTaken() returns the number of time steps taken in the simulation. Arguments: none Return value: number of simulation steps taken |
|
printClassData() prints the value of the data members for an instance of the DislocationDynamicsModule class. Arguments:
Return value: none |
|
providesExternalVelocityField() returns true. Arguments: none Return value: true |
|
providesNormalVelocityField() returns false. Arguments: none Return value: false |
|
resetHierarchyConfiguration() updates resets the communication schedules to be consistent with the new configuration of the PatchHierarchy. This method should be invoked any time the PatchHierarchy has been changed. Arguments:
Return value: none |
|
setCurrentTime() sets the current simulation time to the specified time. Arguments:
Return value: none |
|
setLevelSetFunctionBoundaryConditions() passes the request to the LSMDD_PhysicsStrategy object. Arguments:
Return value: none |
|
toggleUpwindDirection() toggles the upwind direction used to compute the dislocation line field. Arguments: none Return value: current upwind direction |
|
writeAllDislocationLinesToFile() outputs all of the current dislocation lines as a series of dislocation line segments. Arguments:
Return value: none NOTES:
|
|
writeOneDislocationLineToAsciiFile() outputs the specified dislocation line to an ASCII text file as a series of dislocation line segments. Arguments:
Return value: none NOTES:
x_1 y_1 z_1 x_2 y_2 z_2
|
|
writeOneDislocationLineToBinaryFile() outputs the specified dislocation line to a binary file. Arguments:
Return value: none NOTES:
|
|
writeOneDislocationLineToFile() outputs the specified dislocation line as a series of dislocation line segments. Arguments:
Return value: none NOTES:
x_1 y_1 z_1 x_2 y_2 z_2 The last line of the output for the specified dislocation line is a row containing five NaNs and the dislocation number (line_handle). This is used indicate that the data for the specified dislocation line has ended.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|