//+ SetFactory("OpenCASCADE"); Mesh.CharacteristicLengthMin = 0.05; Mesh.CharacteristicLengthMax = 0.05; wall_x = 1; wall_y = 1; wall_z = 0.2; space = 1e-6; mortar_layer = 0.1; vs() = ShapeFromFile("Amir_simp_small_stones.step"); Physical Volume("stones") = {vs()}; v() = ShapeFromFile("Amir_simp_small_mortar.step"); Physical Volume("mortar") = {v()}; Coherence; bbox() = BoundingBox Volume{vs(), v()}; xmin = bbox(0); ymin = bbox(1); zmin = bbox(2); xmax = bbox(3); ymax = bbox(4); zmax = bbox(5); clamp_x = 0.1; clamp_y = 0.1; clamp_z = 0.1; Box(500000) = {xmin - space, ymin - space, zmin - space, xmax - xmin + 2*space, ymax - ymin + 2*space, zmax - zmin + 2*space}; // clamp top Box(100000) = {xmin, ymin - clamp_y/2., zmin -clamp_z/2., xmax - xmin, clamp_y, clamp_z}; Cylinder(210000) = {xmin, ymin, zmin, xmax-xmin, 0, 0, 0.01, 2*Pi}; BooleanDifference{ Volume{100000}; Delete;}{ Volume{500000}; } BooleanDifference{ Volume{100000}; Delete;}{ Volume{210000}; Delete; } // clamp bottom Box(110000) = {xmin, ymax - clamp_y/2., zmax - clamp_z/2., xmax - xmin, clamp_y, clamp_z}; Cylinder(220000) = {xmin, ymax, zmax, xmax - xmin, 0, 0, 0.01, 2*Pi}; BooleanDifference{ Volume{110000}; Delete;}{ Volume{500000}; Delete; } BooleanDifference{ Volume{110000}; Delete; }{ Volume{220000}; Delete; } Physical Surface("clamp_top_inside") = {9589, 9586}; Physical Surface("clamp_top_outside") = {9583, 9584}; // Physical Surface("clamp_bottom_inside") = {9574, 9576}; Physical Surface("clamp_bottom_outside") = {9578, 9579}; // Physical Volume("clamp_bottom") = {100000}; Physical Volume("clamp_top") = {110000}; // Physical Surface("wall_top") = {9563, 9564, 8889, 2334, 2338, 4829, 4832, 6995, 6993};//{7785, 6446, 3930, 4036, 1045, 2050, 2054, 4225, 4228, 6114, 6116, 8479, 8463}; Physical Surface("wall_bottom") = {9561, 9562, 5221, 5225, 3964, 4637, 4636, 4669, 1654, 5060}; //{8373, 8358, 4046, 4047, 4075, 4423, 4566, 4570, 3452, 1456, 6841}; //