@@ -11,43 +11,51 @@ MultilevelLevelSet::MultilevelLevelSet(
1111 Shape &shape, SPHAdaptation &sph_adaptation, Real refinement_ratio)
1212 : BaseMeshField(" LevelSet_" + shape.getName()), shape_(shape), total_levels_(1 )
1313{
14- Real reference_data_spacing = coarse_data->DataSpacing () * 0.5 ;
15- Real global_h_ratio = sph_adaptation.ReferenceSpacing () / reference_data_spacing / refinement_ratio;
16- kernel_ = makeUnique<SingularVariable<KernelTabulatedCK>>(
17- " levelset_kernel" , KernelTabulatedCK (*sph_adaptation.getKernel ()));
14+ Real data_spacing = coarse_data->DataSpacing () * 0.5 ;
15+ Real global_h_ratio = sph_adaptation.ReferenceSpacing () / data_spacing / refinement_ratio;
16+ Real smoothing_length = sph_adaptation.ReferenceSmoothingLength () / global_h_ratio;
1817 global_h_ratio_vec_.push_back (global_h_ratio);
18+ neighbor_method_set_.push_back (
19+ neighbor_method_keeper_.template createPtr <NeighborMethod<SingleValued>>(
20+ *sph_adaptation.getKernel (), smoothing_length, data_spacing));
1921
20- initializeLevel (reference_data_spacing , tentative_bounds, coarse_data);
22+ initializeLevel (data_spacing , tentative_bounds, coarse_data);
2123}
2224// =================================================================================================//
2325MultilevelLevelSet::MultilevelLevelSet (
24- BoundingBox tentative_bounds, Real reference_data_spacing ,
26+ BoundingBox tentative_bounds, Real data_spacing ,
2527 size_t total_levels, Shape &shape, SPHAdaptation &sph_adaptation, Real refinement_ratio)
2628 : BaseMeshField(" LevelSet_" + shape.getName()), shape_(shape), total_levels_(total_levels)
2729{
28- Real global_h_ratio = sph_adaptation.ReferenceSpacing () / reference_data_spacing / refinement_ratio;
30+ Real global_h_ratio = sph_adaptation.ReferenceSpacing () / data_spacing / refinement_ratio;
31+ Real smoothing_length = sph_adaptation.ReferenceSmoothingLength () / global_h_ratio;
2932 global_h_ratio_vec_.push_back (global_h_ratio);
30- kernel_ = makeUnique<SingularVariable<KernelTabulatedCK>>(
31- " levelset_kernel" , KernelTabulatedCK (*sph_adaptation.getKernel ()));
33+ neighbor_method_set_.push_back (
34+ neighbor_method_keeper_.template createPtr <NeighborMethod<SingleValued>>(
35+ *sph_adaptation.getKernel (), smoothing_length, data_spacing));
3236
33- initializeLevel (reference_data_spacing , tentative_bounds);
37+ initializeLevel (data_spacing , tentative_bounds);
3438 for (size_t level = 1 ; level < total_levels_; ++level)
3539 {
36- reference_data_spacing *= 0.5 ; // Halve the data spacing
37- global_h_ratio *= 2 ; // Double the ratio
40+ data_spacing *= 0.5 ; // Halve the data spacing
41+ global_h_ratio *= 2 ; // Double the ratio
42+ smoothing_length *= 0.5 ; // Halve the smoothing length
3843 global_h_ratio_vec_.push_back (global_h_ratio);
44+ neighbor_method_set_.push_back (
45+ neighbor_method_keeper_.template createPtr <NeighborMethod<SingleValued>>(
46+ *sph_adaptation.getKernel (), smoothing_length, data_spacing));
3947
40- initializeLevel (reference_data_spacing , tentative_bounds, mesh_data_set_[level - 1 ]);
48+ initializeLevel (data_spacing , tentative_bounds, mesh_data_set_[level - 1 ]);
4149 }
4250}
4351// =================================================================================================//
4452void MultilevelLevelSet::initializeLevel (
45- Real reference_data_spacing , BoundingBox tentative_bounds, MeshWithGridDataPackagesType *coarse_data)
53+ Real data_spacing , BoundingBox tentative_bounds, MeshWithGridDataPackagesType *coarse_data)
4654{
4755 MeshWithGridDataPackagesType *mesh_data =
4856 mesh_data_ptr_vector_keeper_
4957 .template createPtr <MeshWithGridDataPackagesType>(
50- tentative_bounds, reference_data_spacing , 4 );
58+ tentative_bounds, data_spacing , 4 );
5159 mesh_data_set_.push_back (mesh_data);
5260
5361 if (coarse_data == nullptr )
0 commit comments