sparkl2d_kernels/
gpu_particle_model.rs1use crate::DevicePointer;
2use crate::{GpuConstitutiveModel, GpuPlasticModel};
3use sparkl_core::dynamics::models::CorotatedLinearElasticity;
4
5pub type GpuFailureModel = sparkl_core::dynamics::models::CoreFailureModel;
6
7#[derive(cust_core::DeviceCopy, Copy, Clone, PartialEq)]
8#[repr(C)]
9pub struct GpuParticleModel {
10 pub constitutive_model: GpuConstitutiveModel,
11 pub plastic_model: Option<GpuPlasticModel>,
12 pub failure_model: Option<GpuFailureModel>,
13}
14
15impl Default for GpuParticleModel {
16 fn default() -> Self {
17 Self {
18 constitutive_model: GpuConstitutiveModel::CorotatedLinearElasticity(
19 CorotatedLinearElasticity::new(1.0e6, 0.2),
20 DevicePointer::null(),
21 ),
22 plastic_model: None,
23 failure_model: None,
24 }
25 }
26}