Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long functions in modmesh::inout::Gmsh should be defined outside the class declaration #425

Open
yungyuc opened this issue Sep 8, 2024 · 2 comments
Labels
mesh Spatial mesh refactor Change code without changing tests

Comments

@yungyuc
Copy link
Member

yungyuc commented Sep 8, 2024

Some long functions, e.g., Gmsh::is_valid_transition() (and more), should be moved outside the class declaration and header file:

    bool is_valid_transition(const std::string s)
    {
        if (last_fmt_state == FormatState::BEGIN)
        {
            return s == "$MeshFormat";
        }
        else if (last_fmt_state == FormatState::META_END || last_fmt_state == FormatState::PYHSICAL_NAME_END)
        {
            return s == "$PhysicalNames" || s == "$Nodes";
        }
        else if (last_fmt_state == FormatState::NODE_END)
        {
            return s == "$Elements";
        }

        return false;
    }

(In this specific case, the argument should use a const reference const std::string & s to save a copy.)

This issue tracks the work to refactor the Gmsh class.

@yungyuc yungyuc added refactor Change code without changing tests mesh Spatial mesh labels Sep 8, 2024
@ThreeMonth03
Copy link
Collaborator

@meng5113 Do you want to solve this issue? I think it may be suitable for you.

@ThreeMonth03
Copy link
Collaborator

@KHLee529 Are you interested in refactoring the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mesh Spatial mesh refactor Change code without changing tests
Projects
None yet
Development

No branches or pull requests

2 participants