@@ -24,10 +24,7 @@ void InitialCellTagging::UpdateKernel::update(const Arrayi &cell_index)
2424 cell_pkg_index_[index_1d] = 1 ; // outside far field by default
2525 cell_contain_id_[index_1d] = 2 ; // default value is 2, indicating not near interface
2626 Vecd cell_position = index_handler_.CellPositionFromIndex (cell_index);
27- Real signed_distance = shape_->findSignedDistance (cell_position);
28- Vecd normal_direction = shape_->findNormalDirection (cell_position);
29- Real measure = (signed_distance * normal_direction).cwiseAbs ().maxCoeff ();
30- if (measure < grid_spacing_)
27+ if (ABS (shape_->findSignedDistance (cell_position)) < grid_spacing_)
3128 {
3229 cell_pkg_index_[index_1d] = 2 ; // indicate initially tagged temporarily
3330 occupied_data_pkgs_->push_back (std::make_pair (index_1d, 1 )); // core package
@@ -65,10 +62,7 @@ void InitialCellTaggingFromCoarse::UpdateKernel::update(const Arrayi &cell_index
6562
6663 if (coarse_index_handler_.isWithinCorePackage (cell_pkg_index_coarse_, pkg_type_coarse_, cell_position))
6764 {
68- Real signed_distance = shape_->findSignedDistance (cell_position);
69- Vecd normal_direction = shape_->findNormalDirection (cell_position);
70- Real measure = (signed_distance * normal_direction).cwiseAbs ().maxCoeff ();
71- if (measure < grid_spacing_)
65+ if (ABS (shape_->findSignedDistance (cell_position)) < grid_spacing_)
7266 {
7367 cell_pkg_index_[index_1d] = 2 ; // indicate initially tagged temporarily
7468 occupied_data_pkgs_->push_back (std::make_pair (index_1d, 1 )); // core package
0 commit comments