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
fbcc5822
Commit
fbcc5822
authored
10 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Style: Removed spaces, tabs at the end of line.
parent
c45eb0d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FileIO/TetGenInterface.cpp
+22
-22
22 additions, 22 deletions
FileIO/TetGenInterface.cpp
FileIO/TetGenInterface.h
+26
-26
26 additions, 26 deletions
FileIO/TetGenInterface.h
with
48 additions
and
48 deletions
FileIO/TetGenInterface.cpp
+
22
−
22
View file @
fbcc5822
...
...
@@ -55,7 +55,7 @@ bool TetGenInterface::readTetGenPoly (std::string const& poly_fname,
}
std
::
vector
<
MeshLib
::
Node
*>
nodes
;
if
(
!
readNodesFromStream
(
poly_stream
,
nodes
))
if
(
!
readNodesFromStream
(
poly_stream
,
nodes
))
{
// remove nodes read until now
for
(
std
::
size_t
k
(
0
);
k
<
nodes
.
size
();
++
k
)
...
...
@@ -65,7 +65,7 @@ bool TetGenInterface::readTetGenPoly (std::string const& poly_fname,
const
std
::
size_t
nNodes
(
nodes
.
size
());
std
::
vector
<
GeoLib
::
Point
*>
*
points
=
new
std
::
vector
<
GeoLib
::
Point
*>
;
points
->
reserve
(
nNodes
);
for
(
std
::
size_t
k
(
0
);
k
<
nNodes
;
++
k
)
for
(
std
::
size_t
k
(
0
);
k
<
nNodes
;
++
k
)
{
points
->
push_back
(
new
GeoLib
::
Point
(
nodes
[
k
]
->
getCoords
()));
delete
nodes
[
k
];
...
...
@@ -110,7 +110,7 @@ std::size_t TetGenInterface::getNFacets(std::ifstream &input) const
return
false
;
}
bool
TetGenInterface
::
parseFacets
(
std
::
ifstream
&
input
,
bool
TetGenInterface
::
parseFacets
(
std
::
ifstream
&
input
,
std
::
vector
<
GeoLib
::
Surface
*>
&
surfaces
,
std
::
vector
<
GeoLib
::
Point
*>
&
points
)
{
...
...
@@ -229,7 +229,7 @@ MeshLib::Mesh* TetGenInterface::readTetGenMesh (std::string const& nodes_fname,
return
new
MeshLib
::
Mesh
(
mesh_name
,
nodes
,
elements
);
}
bool
TetGenInterface
::
readNodesFromStream
(
std
::
ifstream
&
ins
,
bool
TetGenInterface
::
readNodesFromStream
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
)
{
std
::
string
line
;
...
...
@@ -259,10 +259,10 @@ bool TetGenInterface::readNodesFromStream (std::ifstream &ins,
return
false
;
}
bool
TetGenInterface
::
parseNodesFileHeader
(
std
::
string
&
line
,
std
::
size_t
&
n_nodes
,
bool
TetGenInterface
::
parseNodesFileHeader
(
std
::
string
&
line
,
std
::
size_t
&
n_nodes
,
std
::
size_t
&
dim
,
std
::
size_t
&
n_attributes
,
std
::
size_t
&
n_attributes
,
bool
&
boundary_markers
)
const
{
std
::
size_t
pos_beg
,
pos_end
;
...
...
@@ -298,9 +298,9 @@ bool TetGenInterface::parseNodesFileHeader(std::string &line,
return
true
;
}
bool
TetGenInterface
::
parseNodes
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
,
std
::
size_t
n_nodes
,
bool
TetGenInterface
::
parseNodes
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
,
std
::
size_t
n_nodes
,
std
::
size_t
dim
)
{
std
::
size_t
pos_beg
,
pos_end
,
id
;
...
...
@@ -308,10 +308,10 @@ bool TetGenInterface::parseNodes(std::ifstream &ins,
double
*
coordinates
(
static_cast
<
double
*>
(
alloca
(
sizeof
(
double
)
*
dim
)));
nodes
.
reserve
(
n_nodes
);
for
(
std
::
size_t
k
(
0
);
k
<
n_nodes
&&
!
ins
.
fail
();
k
++
)
for
(
std
::
size_t
k
(
0
);
k
<
n_nodes
&&
!
ins
.
fail
();
k
++
)
{
getline
(
ins
,
line
);
if
(
ins
.
fail
())
if
(
ins
.
fail
())
{
ERR
(
"TetGenInterface::parseNodes(): Error reading node %d."
,
k
);
return
false
;
...
...
@@ -356,8 +356,8 @@ bool TetGenInterface::parseNodes(std::ifstream &ins,
return
true
;
}
bool
TetGenInterface
::
readElementsFromStream
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
bool
TetGenInterface
::
readElementsFromStream
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
)
{
std
::
string
line
;
...
...
@@ -421,10 +421,10 @@ bool TetGenInterface::parseElementsFileHeader(std::string &line,
return
true
;
}
bool
TetGenInterface
::
parseElements
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
,
std
::
size_t
n_tets
,
bool
TetGenInterface
::
parseElements
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
,
std
::
size_t
n_tets
,
std
::
size_t
n_nodes_per_tet
,
bool
region_attribute
)
{
...
...
@@ -452,7 +452,7 @@ bool TetGenInterface::parseElements(std::ifstream& ins,
k
--
;
continue
;
}
if
(
pos_beg
!=
std
::
string
::
npos
&&
pos_end
!=
std
::
string
::
npos
)
id
=
BaseLib
::
str2number
<
size_t
>
(
line
.
substr
(
pos_beg
,
pos_end
-
pos_beg
));
else
{
...
...
@@ -498,8 +498,8 @@ bool TetGenInterface::parseElements(std::ifstream& ins,
return
true
;
}
bool
TetGenInterface
::
writeTetGenPoly
(
const
std
::
string
&
file_name
,
const
GeoLib
::
GEOObjects
&
geo_objects
,
bool
TetGenInterface
::
writeTetGenPoly
(
const
std
::
string
&
file_name
,
const
GeoLib
::
GEOObjects
&
geo_objects
,
const
std
::
string
&
geo_name
)
const
{
std
::
vector
<
GeoLib
::
Point
*>
const
*
const
points
=
geo_objects
.
getPointVec
(
geo_name
);
...
...
@@ -533,7 +533,7 @@ bool TetGenInterface::writeTetGenPoly(const std::string &file_name,
for
(
std
::
size_t
j
=
0
;
j
<
nTriangles
;
++
j
)
{
const
GeoLib
::
Triangle
&
tri
=
*
(
*
(
*
surfaces
)[
i
])[
j
];
out
<<
"3 "
<<
tri
[
0
]
<<
" "
<<
tri
[
1
]
<<
" "
<<
tri
[
2
]
<<
"
\n
"
;
out
<<
"3 "
<<
tri
[
0
]
<<
" "
<<
tri
[
1
]
<<
" "
<<
tri
[
2
]
<<
"
\n
"
;
}
}
out
<<
"0
\n
"
;
// the polygon holes list
...
...
This diff is collapsed.
Click to expand it.
FileIO/TetGenInterface.h
+
26
−
26
View file @
fbcc5822
...
...
@@ -67,9 +67,9 @@ public:
* @param geo_name the name for the geometry.
* @return returns true on success and false otherwise.
*/
bool
writeTetGenPoly
(
const
std
::
string
&
file_name
,
const
GeoLib
::
GEOObjects
&
geo_objects
,
const
std
::
string
&
geo_name
)
const
;
bool
writeTetGenPoly
(
const
std
::
string
&
file_name
,
const
GeoLib
::
GEOObjects
&
geo_objects
,
const
std
::
string
&
geo_name
)
const
;
private:
/**
...
...
@@ -78,11 +78,11 @@ private:
* @param input the input stream
* @return true, if all information is read, false if the method detects an error
*/
bool
readFacetsFromStream
(
std
::
ifstream
&
input
,
bool
readFacetsFromStream
(
std
::
ifstream
&
input
,
std
::
vector
<
GeoLib
::
Point
*>
&
points
);
/// Returns the declared number of facets in the poly file.
std
::
size_t
getNFacets
(
std
::
ifstream
&
input
)
const
;
std
::
size_t
getNFacets
(
std
::
ifstream
&
input
)
const
;
/**
* Method parses the lines reading the facets from TetGen poly file
...
...
@@ -91,7 +91,7 @@ private:
* @param points the point vector needed for creating surfaces (input)
* @return true, if the facets have been read correctly, false if the method detects an error
*/
bool
parseFacets
(
std
::
ifstream
&
input
,
bool
parseFacets
(
std
::
ifstream
&
input
,
std
::
vector
<
GeoLib
::
Surface
*>
&
surfaces
,
std
::
vector
<
GeoLib
::
Point
*>
&
points
);
...
...
@@ -101,7 +101,7 @@ private:
* @param input the input stream
* @return true, if all information is read, false if the method detects an error
*/
bool
readNodesFromStream
(
std
::
ifstream
&
input
,
bool
readNodesFromStream
(
std
::
ifstream
&
input
,
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
);
/**
...
...
@@ -113,11 +113,11 @@ private:
* @param boundary_markers have the nodes boundary information (output)
* @return true, if the file header is read, false if the method detects an error
*/
bool
parseNodesFileHeader
(
std
::
string
&
line
,
std
::
size_t
&
n_nodes
,
std
::
size_t
&
dim
,
std
::
size_t
&
n_attributes
,
bool
&
boundary_markers
)
const
;
bool
parseNodesFileHeader
(
std
::
string
&
line
,
std
::
size_t
&
n_nodes
,
std
::
size_t
&
dim
,
std
::
size_t
&
n_attributes
,
bool
&
boundary_markers
)
const
;
/**
* method parses the lines reading the nodes from TetGen nodes file
* @param ins the input stream (input)
...
...
@@ -126,9 +126,9 @@ private:
* @param dim the spatial dimension of the node (input)
* @return true, if the nodes are read, false if the method detects an error
*/
bool
parseNodes
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
,
std
::
size_t
n_nodes
,
bool
parseNodes
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
,
std
::
size_t
n_nodes
,
std
::
size_t
dim
);
/**
...
...
@@ -139,9 +139,9 @@ private:
* @param nodes the node information needed for creating elements
* @return true, if all information is read, false if the method detects an error
*/
bool
readElementsFromStream
(
std
::
ifstream
&
input
,
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
);
bool
readElementsFromStream
(
std
::
ifstream
&
input
,
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
)
const
;
/**
* Method parses the header of the elements file created by TetGen
* @param line the header is in this string (input)
...
...
@@ -150,8 +150,8 @@ private:
* @param region_attribute is on output true, if there
* @return
*/
bool
parseElementsFileHeader
(
std
::
string
&
line
,
std
::
size_t
&
n_tets
,
bool
parseElementsFileHeader
(
std
::
string
&
line
,
std
::
size_t
&
n_tets
,
std
::
size_t
&
n_nodes_per_tet
,
bool
&
region_attribute
)
const
;
/**
...
...
@@ -164,12 +164,12 @@ private:
* @param region_attribute if region attribute is true, region information is read
* @return true, if the tetrahedras are read, false if the method detects an error
*/
bool
parseElements
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
,
std
::
size_t
n_tets
,
std
::
size_t
n_nodes_per_tet
,
bool
region_attribute
);
bool
parseElements
(
std
::
ifstream
&
ins
,
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
,
std
::
size_t
n_tets
,
std
::
size_t
n_nodes_per_tet
,
bool
region_attribute
)
const
;
/**
* the value is true if the indexing is zero based, else false
...
...
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