Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
0ccb3584
Commit
0ccb3584
authored
4 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[A/U/ME] New tool AddElementQuality.
parent
5ffcec21
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Applications/Utils/MeshEdit/AddElementQuality.cpp
+65
-0
65 additions, 0 deletions
Applications/Utils/MeshEdit/AddElementQuality.cpp
Applications/Utils/MeshEdit/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Applications/Utils/MeshEdit/CMakeLists.txt
with
66 additions
and
0 deletions
Applications/Utils/MeshEdit/AddElementQuality.cpp
0 → 100644
+
65
−
0
View file @
0ccb3584
/**
* \file
* \copyright
* Copyright (c) 2012-2020, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*/
#include
<tclap/CmdLine.h>
#include
<array>
#include
<string>
#include
"BaseLib/RunTime.h"
#include
"InfoLib/GitInfo.h"
#include
"MeshLib/IO/readMeshFromFile.h"
#include
"MeshLib/IO/writeMeshToFile.h"
#include
"MeshLib/Mesh.h"
#include
"MeshLib/MeshEnums.h"
#include
"MeshLib/MeshQuality/ElementQualityInterface.h"
int
main
(
int
argc
,
char
*
argv
[])
{
TCLAP
::
CmdLine
cmd
(
"Add element quality as a mesh property.
\n\n
"
"OpenGeoSys-6 software, version "
+
GitInfoLib
::
GitInfo
::
ogs_version
+
".
\n
"
"Copyright (c) 2012-2020, OpenGeoSys Community "
"(http://www.opengeosys.org)"
,
' '
,
GitInfoLib
::
GitInfo
::
ogs_version
);
TCLAP
::
ValueArg
<
std
::
string
>
mesh_in_arg
(
"i"
,
"input_mesh_file"
,
"input mesh file"
,
true
,
""
,
"string"
);
cmd
.
add
(
mesh_in_arg
);
TCLAP
::
ValueArg
<
std
::
string
>
mesh_out_arg
(
"o"
,
"output_mesh_file"
,
"output mesh file"
,
true
,
""
,
"string"
);
cmd
.
add
(
mesh_out_arg
);
cmd
.
parse
(
argc
,
argv
);
// read the mesh file
BaseLib
::
RunTime
run_time
;
run_time
.
start
();
std
::
unique_ptr
<
MeshLib
::
Mesh
>
mesh
(
MeshLib
::
IO
::
readMeshFromFile
(
mesh_in_arg
.
getValue
()));
if
(
!
mesh
)
{
return
EXIT_FAILURE
;
}
INFO
(
"Time for reading: {:g} s"
,
run_time
.
elapsed
());
// Geometric information
MeshLib
::
MeshQualityType
const
type
=
MeshLib
::
MeshQualityType
::
EDGERATIO
;
MeshLib
::
ElementQualityInterface
element_quality
(
*
mesh
,
type
);
auto
const
element_quality_vector
=
element_quality
.
getQualityVector
();
INFO
(
"{:d}"
,
element_quality_vector
.
size
());
MeshLib
::
addPropertyToMesh
(
*
mesh
,
"element_quality"
,
MeshLib
::
MeshItemType
::
Cell
,
1
,
element_quality_vector
);
INFO
(
"Writing mesh '{:s}' ... "
,
mesh_out_arg
.
getValue
());
MeshLib
::
IO
::
writeMeshToFile
(
*
mesh
,
mesh_out_arg
.
getValue
());
INFO
(
"done."
);
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
Applications/Utils/MeshEdit/CMakeLists.txt
+
1
−
0
View file @
0ccb3584
set
(
TOOLS
set
(
TOOLS
AddElementQuality
AddLayer
AddLayer
appendLinesAlongPolyline
appendLinesAlongPolyline
checkMesh
checkMesh
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment