Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1105189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:35:34+00:00 2026-05-17T01:35:34+00:00

I want a tool to remove duplicate nodes (nodes in the finite element sense,

  • 0

I want a tool to remove duplicate nodes (“nodes” in the finite element sense, simply a point in space with certain coordinates). Basically, I want to be able to take a collection of nodes, and reduce it by eliminating extra nodes that are within a certain tolerance in distance of other nodes. I figure that an STL set of nodes sorted by coordinate will fit the bill nicely performance wise. My question is how to incorporate a tolerance that is settable at run time.

Consider the simple key comparison function for the 1D case (a single coordinate per node). I know my logic could be shortened; that isn’t what my question is about.

struct NodeSorter_x{
    //Stores Node objects sorted by x coordinate within tolerance TOL
    bool operator()(const Node N1, const Node N2) const
    {
        //returns true if N1 < N2 and not within TOL distance
        return ( N1.x < N2.x) && !( fabs( N1.x - N2.x ) < TOL );
    }
};

And the set containing unique node objects (no duplicates)…

std::set <Node,NodeSorter_x> UniqueNodeSet;

So, I want to be able to set TOL used in the comparison at run time. How do I go about doing so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:35:35+00:00Added an answer on May 17, 2026 at 1:35 am
    struct NodeSorter_x{
        NodeSorter_x(double tol) : TOL(tol) {}
        bool operator()(const Node N1, const Node N2) const
        {
            //returns true if N1 < N2 and not within TOL distance
            return ( N1.x < N2.x) && !( fabs( N1.x - N2.x ) < TOL );
        }
    };
    
    std::set <Node,NodeSorter_x> UniqueNodeSet( NodeSorter_x(0.1) );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for some tool to remove cooments from Javascript sources. I was able
I want to remove the EXIF information (including thumbnail, metadata, camera info... everything!) from
I am new to the RegEx and i want to be able to search
Is there a diff tool that allows me to write regular expression to remove
I want to make a tool that will make a video of your app
Possible Duplicate: What should a good BugTracking tool be capable of? Although there is
We have a huge Java Swing application. Now we want to remove couplings from
I have a button in my tool bar to remove all of the breakpoints.
I want to base a tool on eclipse in a way that I could
I tried to find and replace some tags with SpringSource Tool Suite(Eclipse). I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.