Loading tools/mesh_converter/MeshElement.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -58,12 +58,12 @@ double MeshElement::get_distance(size_t index, Point& qp) const { return unibn::L2Distance<Point>::compute(vertices_[index], qp); } bool MeshElement::validElement(double volume_cut, Point& qp) const { bool MeshElement::isValid(double volume_cut, Point& qp) const { if(std::fabs(volume_) < MIN_VOLUME) { LOG(TRACE) << "Invalid tetrahedron with coplanar(3D)/colinear(2D) vertices."; LOG(TRACE) << "Invalid tetrahedron, all vertices are " << (dimension_ == 3 ? "coplanar" : "colinear"); return false; } else if(std::fabs(volume_) <= volume_cut) { LOG(TRACE) << "Tetrahedron volume smaller than volume cut."; LOG(TRACE) << "Invalid tetrahedron with volume " << std::fabs(volume_) << " smaller than volume cut " << volume_cut; return false; } Loading tools/mesh_converter/MeshElement.hpp +6 −4 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ namespace mesh_converter { * @param volume_cut Threshold for the minimum tetrahedron volume * @param qp Desired point for the interpolation */ bool validElement(double volume_cut, Point& qp) const; bool isValid(double volume_cut, Point& qp) const; /** * @brief Barycentric interpolation implementation Loading Loading @@ -129,20 +129,22 @@ namespace mesh_converter { // Dimensionality is number of iterator elements minus one: size_t dimensions = static_cast<size_t>(end - begin) - 1; size_t idx = 0; LOG(TRACE) << "Constructing " << dimensions << "D element at " << reference_ << " with mesh points:"; for(; begin < end; begin++) { LOG(TRACE) << "\t\t" << (*grid_)[*begin]; grid_elements[idx] = (*grid_)[*begin]; field_elements[idx++] = (*field_)[*begin]; } LOG(TRACE) << "Constructing element with dim " << dimensions << " at " << reference_; MeshElement element(dimensions, grid_elements, field_elements); valid_ = element.validElement(cut_, reference_); valid_ = element.isValid(cut_, reference_); if(valid_) { LOG(DEBUG) << element.print(reference_); result_ = element.getObservable(reference_); } return valid_; // Don't break out of the loop if element is invalid return valid_; } /** Loading Loading
tools/mesh_converter/MeshElement.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -58,12 +58,12 @@ double MeshElement::get_distance(size_t index, Point& qp) const { return unibn::L2Distance<Point>::compute(vertices_[index], qp); } bool MeshElement::validElement(double volume_cut, Point& qp) const { bool MeshElement::isValid(double volume_cut, Point& qp) const { if(std::fabs(volume_) < MIN_VOLUME) { LOG(TRACE) << "Invalid tetrahedron with coplanar(3D)/colinear(2D) vertices."; LOG(TRACE) << "Invalid tetrahedron, all vertices are " << (dimension_ == 3 ? "coplanar" : "colinear"); return false; } else if(std::fabs(volume_) <= volume_cut) { LOG(TRACE) << "Tetrahedron volume smaller than volume cut."; LOG(TRACE) << "Invalid tetrahedron with volume " << std::fabs(volume_) << " smaller than volume cut " << volume_cut; return false; } Loading
tools/mesh_converter/MeshElement.hpp +6 −4 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ namespace mesh_converter { * @param volume_cut Threshold for the minimum tetrahedron volume * @param qp Desired point for the interpolation */ bool validElement(double volume_cut, Point& qp) const; bool isValid(double volume_cut, Point& qp) const; /** * @brief Barycentric interpolation implementation Loading Loading @@ -129,20 +129,22 @@ namespace mesh_converter { // Dimensionality is number of iterator elements minus one: size_t dimensions = static_cast<size_t>(end - begin) - 1; size_t idx = 0; LOG(TRACE) << "Constructing " << dimensions << "D element at " << reference_ << " with mesh points:"; for(; begin < end; begin++) { LOG(TRACE) << "\t\t" << (*grid_)[*begin]; grid_elements[idx] = (*grid_)[*begin]; field_elements[idx++] = (*field_)[*begin]; } LOG(TRACE) << "Constructing element with dim " << dimensions << " at " << reference_; MeshElement element(dimensions, grid_elements, field_elements); valid_ = element.validElement(cut_, reference_); valid_ = element.isValid(cut_, reference_); if(valid_) { LOG(DEBUG) << element.print(reference_); result_ = element.getObservable(reference_); } return valid_; // Don't break out of the loop if element is invalid return valid_; } /** Loading