@@ -16,7 +16,7 @@ BodyPartFromMesh::BodyPartFromMesh(SPHBody &body, SharedPtr<TriangleMeshShape> t
1616 : BodyRegionByParticle(body, triangle_mesh_shape_ptr)
1717{
1818 // set the body domain bounds because it is not set by default
19- BoundingBox bounds = triangle_mesh_shape_ptr->getBounds ();
19+ BoundingBoxd bounds = triangle_mesh_shape_ptr->getBounds ();
2020 setBodyPartBounds (bounds);
2121}
2222
@@ -46,18 +46,18 @@ SolidBodyForSimulation::SolidBodyForSimulation(
4646 std::cout << " normal initialization done" << std::endl;
4747}
4848
49- BoundingBox expandBoundingBox (const BoundingBox &original, const BoundingBox &additional)
49+ BoundingBoxd expandBoundingBox (const BoundingBoxd &original, const BoundingBoxd &additional)
5050{
51- BoundingBox expanded = original;
52- for (int i = 0 ; i < expanded.first_ .size (); i++)
51+ BoundingBoxd expanded = original;
52+ for (int i = 0 ; i < expanded.lower_ .size (); i++)
5353 {
54- if (additional.first_ [i] < expanded.first_ [i])
54+ if (additional.lower_ [i] < expanded.lower_ [i])
5555 {
56- expanded.first_ [i] = additional.first_ [i];
56+ expanded.lower_ [i] = additional.lower_ [i];
5757 }
58- if (additional.second_ [i] > expanded.second_ [i])
58+ if (additional.upper_ [i] > expanded.upper_ [i])
5959 {
60- expanded.second_ [i] = additional.second_ [i];
60+ expanded.upper_ [i] = additional.upper_ [i];
6161 }
6262 }
6363 return expanded;
@@ -108,7 +108,7 @@ void relaxParticlesSingleResolution(bool write_particle_relaxation_data,
108108std::tuple<Vecd *, Real *> generateAndRelaxParticlesFromMesh (
109109 SharedPtr<TriangleMeshShape> triangle_mesh_shape, Real resolution, bool particle_relaxation, bool write_particle_relaxation_data)
110110{
111- BoundingBox bb = triangle_mesh_shape->getBounds ();
111+ BoundingBoxd bb = triangle_mesh_shape->getBounds ();
112112 SPHSystem system (bb, resolution);
113113 SolidBody model (system, triangle_mesh_shape);
114114 model.defineBodyLevelSetShape ()->cleanLevelSet ();
@@ -197,7 +197,7 @@ StructuralSimulation::StructuralSimulation(const StructuralSimulationInput &inpu
197197 particle_relaxation_list_(input.particle_relaxation_list_),
198198 write_particle_relaxation_data_(input.write_particle_relaxation_data_),
199199 system_resolution_(0.0 ),
200- system_(SPHSystem(BoundingBox (Vec3d::Zero(), Vec3d::Zero()), system_resolution_)),
200+ system_(SPHSystem(BoundingBoxd (Vec3d::Zero(), Vec3d::Zero()), system_resolution_)),
201201 scale_system_boundaries_(input.scale_system_boundaries_),
202202 physical_time_(*system_.getSystemVariableDataByName<Real>(" PhysicalTime" )),
203203
@@ -284,17 +284,17 @@ void StructuralSimulation::calculateSystemBoundaries()
284284 // calculate system bounds from all bodies
285285 for (size_t i = 0 ; i < body_mesh_list_.size (); i++)
286286 {
287- BoundingBox additional = body_mesh_list_[i]->getBounds ();
287+ BoundingBoxd additional = body_mesh_list_[i]->getBounds ();
288288 system_.setSystemDomainBounds (expandBoundingBox (system_.getSystemDomainBounds (), additional));
289289 }
290290 // scale the system bounds around the center point
291- Vecd center_point = (system_.getSystemDomainBounds ().first_ + system_.getSystemDomainBounds ().second_ ) * 0.5 ;
291+ Vecd center_point = (system_.getSystemDomainBounds ().lower_ + system_.getSystemDomainBounds ().upper_ ) * 0.5 ;
292292
293- Vecd distance_first = system_.getSystemDomainBounds ().first_ - center_point;
294- Vecd distance_second = system_.getSystemDomainBounds ().second_ - center_point;
293+ Vecd distance_first = system_.getSystemDomainBounds ().lower_ - center_point;
294+ Vecd distance_second = system_.getSystemDomainBounds ().upper_ - center_point;
295295
296- system_.getSystemDomainBounds ().first_ = center_point + distance_first * scale_system_boundaries_;
297- system_.getSystemDomainBounds ().second_ = center_point + distance_second * scale_system_boundaries_;
296+ system_.getSystemDomainBounds ().lower_ = center_point + distance_first * scale_system_boundaries_;
297+ system_.getSystemDomainBounds ().upper_ = center_point + distance_second * scale_system_boundaries_;
298298}
299299
300300void StructuralSimulation::createBodyMeshList ()
@@ -430,17 +430,17 @@ void StructuralSimulation::initializeForceInBodyRegion()
430430 for (size_t i = 0 ; i < force_in_body_region_tuple_.size (); i++)
431431 {
432432 int body_index = std::get<0 >(force_in_body_region_tuple_[i]);
433- BoundingBox bbox = std::get<1 >(force_in_body_region_tuple_[i]);
433+ BoundingBoxd bbox = std::get<1 >(force_in_body_region_tuple_[i]);
434434 Vec3d force = std::get<2 >(force_in_body_region_tuple_[i]);
435435 Real end_time = std::get<3 >(force_in_body_region_tuple_[i]);
436436
437437 // get the length of each side to create the box
438- Real x_side = bbox.second_ [0 ] - bbox.first_ [0 ];
439- Real y_side = bbox.second_ [1 ] - bbox.first_ [1 ];
440- Real z_side = bbox.second_ [2 ] - bbox.first_ [2 ];
438+ Real x_side = bbox.upper_ [0 ] - bbox.lower_ [0 ];
439+ Real y_side = bbox.upper_ [1 ] - bbox.lower_ [1 ];
440+ Real z_side = bbox.upper_ [2 ] - bbox.lower_ [2 ];
441441 Vec3d halfsize_bbox (0.5 * x_side, 0.5 * y_side, 0.5 * z_side);
442442 // get the center point for translation from the origin
443- Vec3d center = (bbox.second_ + bbox.first_ ) * 0.5 ;
443+ Vec3d center = (bbox.upper_ + bbox.lower_ ) * 0.5 ;
444444 // SimTK geometric modeling resolution
445445 int resolution (20 );
446446 // create the triangle mesh of the box
@@ -510,15 +510,15 @@ void StructuralSimulation::initializeConstrainSolidBodyRegion()
510510 for (size_t i = 0 ; i < body_indices_fixed_constraint_region_.size (); i++)
511511 {
512512 int body_index = body_indices_fixed_constraint_region_[i].first ;
513- BoundingBox bbox = body_indices_fixed_constraint_region_[i].second ;
513+ BoundingBoxd bbox = body_indices_fixed_constraint_region_[i].second ;
514514
515515 // get the length of each side to create the box
516- Real x_side = bbox.second_ [0 ] - bbox.first_ [0 ];
517- Real y_side = bbox.second_ [1 ] - bbox.first_ [1 ];
518- Real z_side = bbox.second_ [2 ] - bbox.first_ [2 ];
516+ Real x_side = bbox.upper_ [0 ] - bbox.lower_ [0 ];
517+ Real y_side = bbox.upper_ [1 ] - bbox.lower_ [1 ];
518+ Real z_side = bbox.upper_ [2 ] - bbox.lower_ [2 ];
519519 Vec3d halfsize_bbox (0.5 * x_side, 0.5 * y_side, 0.5 * z_side);
520520 // get the center point for translation from the origin
521- Vec3d center = (bbox.second_ + bbox.first_ ) * 0.5 ;
521+ Vec3d center = (bbox.upper_ + bbox.lower_ ) * 0.5 ;
522522 // SimTK geometric modeling resolution
523523 int resolution (20 );
524524 // create the triangle mesh of the box
0 commit comments