Hi Darwin,
That is indeed a bug in Chrono::GPU. It is not about materials but meshes. There was a misuse of data type, which caused Chrono::GPU to not pick up triangles in a mesh, when subdomains (SDs) used to discretize the space are small enough. SDs are small when the particle size is small, and that is the actual cause. I don't know why it did not happen in our tests which have much larger problem scales and maybe this only happens when the radius is numerically small; but either way, I was able to fix that. I will push a fix to github in a few days, but if you don't want to wait, you can fix it easily in your own clone of Chrono:
1) Find the following function in ChGpu_SMC_trimesh.cuh:
__inline__ __device__ void triangle_figureOutSDBox(const float3& vA,
const float3& vB,
const float3& vC,
int* L,
int* U,
ChSystemGpu_impl::GranParamsPtr gran_params) {
int3 min_pt;
min_pt.x = MIN(vA.x, MIN(vB.x, vC.x));
min_pt.y = MIN(vA.y, MIN(vB.y, vC.y));
min_pt.z = MIN(vA.z, MIN(vB.z, vC.z));
// Enlarge bounding box
min_pt.x -= gran_params->SD_size_X_SU / SAFETY_PARAM;
min_pt.y -= gran_params->SD_size_Y_SU / SAFETY_PARAM;
min_pt.z -= gran_params->SD_size_Z_SU / SAFETY_PARAM;
int3 max_pt;
max_pt.x = MAX(vA.x, MAX(vB.x, vC.x));
max_pt.y = MAX(vA.y, MAX(vB.y, vC.y));
max_pt.z = MAX(vA.z, MAX(vB.z, vC.z));
max_pt.x += gran_params->SD_size_X_SU / SAFETY_PARAM;
max_pt.y += gran_params->SD_size_Y_SU / SAFETY_PARAM;
max_pt.z += gran_params->SD_size_Z_SU / SAFETY_PARAM;
int3 tmp = pointSDTriplet(min_pt.x, min_pt.y, min_pt.z, gran_params);
L[0] = tmp.x;
L[1] = tmp.y;
L[2] = tmp.z;
tmp = pointSDTriplet(max_pt.x, max_pt.y, max_pt.z, gran_params);
U[0] = tmp.x;
U[1] = tmp.y;
U[2] = tmp.z;
}
2) Replace it entirely with the following snippet:
__inline__ __device__ void triangle_figureOutSDBox(const float3& vA,
const float3& vB,
const float3& vC,
int* L,
int* U,
ChSystemGpu_impl::GranParamsPtr gran_params) {
int64_t min_pt_x = MIN(vA.x, MIN(vB.x, vC.x));
int64_t min_pt_y = MIN(vA.y, MIN(vB.y, vC.y));
int64_t min_pt_z = MIN(vA.z, MIN(vB.z, vC.z));
// Enlarge bounding box
min_pt_x -= gran_params->SD_size_X_SU / SAFETY_PARAM;
min_pt_y -= gran_params->SD_size_Y_SU / SAFETY_PARAM;
min_pt_z -= gran_params->SD_size_Z_SU / SAFETY_PARAM;
int64_t max_pt_x = MAX(vA.x, MAX(vB.x, vC.x));
int64_t max_pt_y = MAX(vA.y, MAX(vB.y, vC.y));
int64_t max_pt_z = MAX(vA.z, MAX(vB.z, vC.z));
max_pt_x += gran_params->SD_size_X_SU / SAFETY_PARAM;
max_pt_y += gran_params->SD_size_Y_SU / SAFETY_PARAM;
max_pt_z += gran_params->SD_size_Z_SU / SAFETY_PARAM;
int3 tmp = pointSDTriplet(min_pt_x, min_pt_y, min_pt_z, gran_params);
L[0] = tmp.x;
L[1] = tmp.y;
L[2] = tmp.z;
tmp = pointSDTriplet(max_pt_x, max_pt_y, max_pt_z, gran_params);
U[0] = tmp.x;
U[1] = tmp.y;
U[2] = tmp.z;
}
Doing these 2 steps and rebuild, this problem should be gone (it's just replacing int type with int64). Let me know if this helps.
Thank you!
Ruochun