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
694adbbd
Commit
694adbbd
authored
8 years ago
by
wenqing
Browse files
Options
Downloads
Patches
Plain Diff
[MeshIO] Added a new function for reading serial mesh data
parent
5a5b9140
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MeshLib/IO/readMeshFromFile.cpp
+10
-16
10 additions, 16 deletions
MeshLib/IO/readMeshFromFile.cpp
MeshLib/IO/readMeshFromFile.h
+1
-0
1 addition, 0 deletions
MeshLib/IO/readMeshFromFile.h
MeshLib/NodePartitionedMesh.h
+4
-0
4 additions, 0 deletions
MeshLib/NodePartitionedMesh.h
with
15 additions
and
16 deletions
MeshLib/IO/readMeshFromFile.cpp
+
10
−
16
View file @
694adbbd
...
...
@@ -55,27 +55,20 @@ MeshLib::Mesh* readMeshFromFile(const std::string &file_name)
}
else
if
(
world_size
==
1
)
{
MeshLib
::
Mesh
*
mesh
=
nullptr
;
if
(
BaseLib
::
hasFileExtension
(
"msh"
,
file_name
))
{
MeshLib
::
IO
::
Legacy
::
MeshIO
meshIO
;
mesh
=
meshIO
.
loadMeshFromFile
(
file_name
);
}
if
(
BaseLib
::
hasFileExtension
(
"vtu"
,
file_name
))
mesh
=
MeshLib
::
IO
::
VtuInterface
::
readVTUFile
(
file_name
);
if
(
mesh
==
nullptr
)
{
ERR
(
"readMeshFromFile(): Unknown mesh file format in file %s."
,
file_name
.
c_str
());
}
MeshLib
::
Mesh
*
mesh
=
readMeshFromFileSerial
(
file_name
);
MeshLib
::
NodePartitionedMesh
*
part_mesh
=
new
MeshLib
::
NodePartitionedMesh
(
*
mesh
);
delete
mesh
;
return
part_mesh
;
}
return
nullptr
;
#else
return
readMeshFromFileSerial
(
file_name
);
#endif
}
MeshLib
::
Mesh
*
readMeshFromFileSerial
(
const
std
::
string
&
file_name
)
{
if
(
BaseLib
::
hasFileExtension
(
"msh"
,
file_name
))
{
MeshLib
::
IO
::
Legacy
::
MeshIO
meshIO
;
...
...
@@ -86,8 +79,9 @@ MeshLib::Mesh* readMeshFromFile(const std::string &file_name)
return
MeshLib
::
IO
::
VtuInterface
::
readVTUFile
(
file_name
);
ERR
(
"readMeshFromFile(): Unknown mesh file format in file %s."
,
file_name
.
c_str
());
#endif
return
nullptr
;
}
}
// end namespace IO
}
// end namespace MeshLib
This diff is collapsed.
Click to expand it.
MeshLib/IO/readMeshFromFile.h
+
1
−
0
View file @
694adbbd
...
...
@@ -27,6 +27,7 @@ class Mesh;
namespace
IO
{
MeshLib
::
Mesh
*
readMeshFromFileSerial
(
const
std
::
string
&
file_name
);
MeshLib
::
Mesh
*
readMeshFromFile
(
const
std
::
string
&
file_name
);
}
}
...
...
This diff is collapsed.
Click to expand it.
MeshLib/NodePartitionedMesh.h
+
4
−
0
View file @
694adbbd
...
...
@@ -43,6 +43,10 @@ class NodePartitionedMesh : public Mesh
for
(
std
::
size_t
i
=
0
;
i
<
_nodes
.
size
();
i
++
)
{
_global_node_ids
[
i
]
=
_nodes
[
i
]
->
getID
();
// TODO To add copying of the connected nodes (and elements)
// in the copy constructor of class Node in order to
// drop the following lines.
auto
node
=
_nodes
[
i
];
// Copy constructor of Mesh does not copy the connected
// nodes to node.
...
...
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