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

Mesh partitioning tool #1238

Merged
merged 15 commits into from
Jul 14, 2016
Merged

Mesh partitioning tool #1238

merged 15 commits into from
Jul 14, 2016

Conversation

wenqing
Copy link
Member

@wenqing wenqing commented Jun 3, 2016

Added the mesh partitioning tool as a utility of ogs6.
Usage:

  • partmesh --help
  • partmesh -s [or ogs2metis] -i foo.vtu [or foo] // to convert mesh data to metis input data
  • partmesh -n 3 -m -i foo.vtu[or foo]

With a cmake option of UTILS_PARTMESH_BUILD_WITH_METIS, the source code of metis can be compiled into the executable file.

Added the gitbub repository of metis
https://github.com/scibuilder/metis.git

@TomFischer
Copy link
Member

Maybe your tool fits better in Applications/Utils/ModelPreparation?

@wenqing
Copy link
Member Author

wenqing commented Jun 3, 2016

@TomFischer Sounds good. Should I move the existing files of Applications/Utils/ModelPreparation to a new subdirectory, say ComputeNodeArea? By this the hierarchy of ModelPreparation will become as

ModelPreparation
  ComputeNodeArea 
  PartitionMesh

@endJunction
Copy link
Member

@wenqing Keep it flat. Just add the new tool in the ModelPreparation folder.

add_definitions(-DBUILD_WITH_METIS)
include(${CMAKE_SOURCE_DIR}/Applications/Utils/ModelPreparation/PartitionMesh/MetisSetup.cmake)
endif()
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this part should be more general and not be bound to a specific tool. Something like this:

If metis submodule was checked out then

  • include MetisSetup.cmake
  • include ModelPreparation/PartitionMesh (in Utils-directory)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bilke How to get the status in CMake that a submodule has been checkout?

@endJunction
Copy link
Member

I could not follow the code after the line 180 or so. I recommend to split the very long loop over the partitions into several smaller standalone routines, which fit into a screen.
There are also those "if ascii then A else B" conditionals in several places which are difficult to follow; extracting this parts into own routines would greatly help the understanding.
It seems to me there are multiple global variables used through the code. Their state is very difficult to follow. Introducing smaller scopes would help.

@wenqing
Copy link
Member Author

wenqing commented Jun 10, 2016

@endJunction That function will be rewritten according to your last comment.

@TomFischer
Copy link
Member

@endJunction That function will be rewritten according to your last comment.

@wenqing Please, could you add the label for work in progress?

{
os << elem->getNodeIndex(j) + 1 <<" ";
}
os << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::endl can be slow, because it always flushes. Better use "\n".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

@wenqing wenqing force-pushed the pmesh_tool branch 2 times, most recently from 70b06f1 to 970e4f0 Compare July 7, 2016 14:44
@chleh
Copy link
Collaborator

chleh commented Jul 7, 2016

👍

#include <tclap/CmdLine.h>

#ifdef _MSC_VER
#include <windows.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct that windows.h is only included when using VisualStudio compiler? What about gcc under windows os?

@endJunction
Copy link
Member

OK. After fixing the windows.h include this is to be rebased and merged.

@wenqing
Copy link
Member Author

wenqing commented Jul 11, 2016

Rebased. Note there is a branch of pmesh_tool in ogs-data repository for this PR.

@wenqing wenqing merged commit 4938648 into ufz:master Jul 14, 2016
chleh added a commit that referenced this pull request Jul 14, 2016
Yonghui56 pushed a commit to Yonghui56/ogs that referenced this pull request Sep 20, 2016
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants