Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenVolumeMesh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenVolumeMesh
OpenVolumeMesh
Commits
59c40b49
Commit
59c40b49
authored
May 27, 2019
by
Jan Möbius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'clean-cppcheck' into 'master'
cppcheck fixes See merge request
!59
parents
f1b89140
aa83f978
Pipeline
#10567
passed with stage
in 4 minutes and 21 seconds
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
34 deletions
+35
-34
.gitignore
.gitignore
+1
-0
CI/ci-cppcheck.sh
CI/ci-cppcheck.sh
+3
-11
src/OpenVolumeMesh/Core/PropertyDefines.hh
src/OpenVolumeMesh/Core/PropertyDefines.hh
+2
-2
src/OpenVolumeMesh/Core/PropertyDefinesT_impl.hh
src/OpenVolumeMesh/Core/PropertyDefinesT_impl.hh
+1
-1
src/OpenVolumeMesh/Core/TopologyKernel.cc
src/OpenVolumeMesh/Core/TopologyKernel.cc
+4
-0
src/OpenVolumeMesh/FileManager/FileManager.cc
src/OpenVolumeMesh/FileManager/FileManager.cc
+1
-0
src/OpenVolumeMesh/Geometry/Vector11T.hh
src/OpenVolumeMesh/Geometry/Vector11T.hh
+6
-2
src/OpenVolumeMesh/Mesh/HexahedralMeshIterators.cc
src/OpenVolumeMesh/Mesh/HexahedralMeshIterators.cc
+4
-2
src/OpenVolumeMesh/Mesh/TetrahedralMeshIterators.cc
src/OpenVolumeMesh/Mesh/TetrahedralMeshIterators.cc
+5
-10
src/OpenVolumeMesh/Mesh/TetrahedralMeshTopologyKernel.cc
src/OpenVolumeMesh/Mesh/TetrahedralMeshTopologyKernel.cc
+8
-6
No files found.
.gitignore
View file @
59c40b49
...
...
@@ -5,3 +5,4 @@ build*
*.swp
.settings
cppcheck.log
CI/ci-cppcheck.sh
View file @
59c40b49
...
...
@@ -13,22 +13,14 @@ WARNING='\033[0;93m'
echo
-e
"
${
OUTPUT
}
"
echo
"=============================================================================="
echo
"Running cppcheck"
echo
-n
"Version: "
cppcheck
--version
echo
"=============================================================================="
echo
-e
"
${
NC
}
"
echo
"Please Wait ..."
# Run cppcheck and output into file
cppcheck
--enable
=
all
.
-I
src
-i
Doc/
--force
--suppress
=
missingIncludeSystem
--quiet
-Umin
-Umax
-UBMPOSTFIX
-DOPENVOLUMEMESHDLLEXPORT
=
""
&> cppcheck.log
echo
-e
"
${
OUTPUT
}
"
echo
"=============================================================================="
echo
"CPPCHECK Messages"
echo
"=============================================================================="
echo
-e
"
${
NC
}
"
# Echo output to command line for simple analysis via gitlab
cat
cppcheck.log
cppcheck
--enable
=
all
.
-I
src
-i
Doc/
--force
--suppress
=
missingIncludeSystem
--inline-suppr
--quiet
-Umin
-Umax
-UBMPOSTFIX
-DOPENVOLUMEMESHDLLEXPORT
=
""
2>&1 |
tee
cppcheck.log
COUNT
=
$(
wc
-l
< cppcheck.log
)
...
...
src/OpenVolumeMesh/Core/PropertyDefines.hh
View file @
59c40b49
...
...
@@ -85,11 +85,11 @@ template<typename T, typename Entity>
class
PropertyTT
:
public
PropertyPtr
<
OpenVolumeMeshPropertyT
<
T
>
,
Entity
>
{
public:
template
<
typename
MeshT
>
PropertyTT
(
MeshT
*
mesh
,
const
std
::
string
&
_name
,
const
T
_def
=
T
())
PropertyTT
(
MeshT
*
mesh
,
const
std
::
string
&
_name
,
const
T
&
_def
=
T
())
:
PropertyTT
(
std
::
move
(
mesh
->
template
request_property
<
T
,
Entity
>(
_name
,
_def
)))
{}
using
PropertyHandleT
=
OpenVolumeMesh
::
PropHandleT
<
Entity
>
;
PropertyTT
(
const
std
::
string
&
_name
,
const
std
::
string
&
_internal_type_name
,
ResourceManager
&
_resMan
,
PropertyHandleT
_handle
,
const
T
_def
=
T
());
PropertyTT
(
const
std
::
string
&
_name
,
const
std
::
string
&
_internal_type_name
,
ResourceManager
&
_resMan
,
PropertyHandleT
_handle
,
const
T
&
_def
=
T
());
~
PropertyTT
()
override
=
default
;
BaseProperty
*
clone
(
ResourceManager
&
_resMan
,
OpenVolumeMeshHandle
_handle
)
const
override
;
const
std
::
string
entityType
()
const
override
{
return
entityTypeName
<
Entity
>
();
}
...
...
src/OpenVolumeMesh/Core/PropertyDefinesT_impl.hh
View file @
59c40b49
...
...
@@ -42,7 +42,7 @@
namespace
OpenVolumeMesh
{
template
<
typename
T
,
typename
Entity
>
PropertyTT
<
T
,
Entity
>::
PropertyTT
(
const
std
::
string
&
_name
,
const
std
::
string
&
_internal_type_name
,
ResourceManager
&
_resMan
,
PropertyHandleT
_handle
,
const
T
_def
)
:
PropertyTT
<
T
,
Entity
>::
PropertyTT
(
const
std
::
string
&
_name
,
const
std
::
string
&
_internal_type_name
,
ResourceManager
&
_resMan
,
PropertyHandleT
_handle
,
const
T
&
_def
)
:
PropertyPtr
<
OpenVolumeMeshPropertyT
<
T
>
,
Entity
>
(
new
OpenVolumeMeshPropertyT
<
T
>
(
_name
,
_internal_type_name
,
_def
),
_resMan
,
_handle
)
{
}
...
...
src/OpenVolumeMesh/Core/TopologyKernel.cc
View file @
59c40b49
...
...
@@ -468,6 +468,7 @@ CellHandle TopologyKernel::add_cell(const std::vector<HalfFaceHandle>& _halfface
//========================================================================================
/// Set the vertices of an edge
// cppcheck-suppress unusedFunction ; public interface
void
TopologyKernel
::
set_edge
(
const
EdgeHandle
&
_eh
,
const
VertexHandle
&
_fromVertex
,
const
VertexHandle
&
_toVertex
)
{
assert
(
_fromVertex
.
is_valid
()
&&
(
size_t
)
_fromVertex
.
idx
()
<
n_vertices
()
&&
!
is_deleted
(
_fromVertex
));
...
...
@@ -502,6 +503,7 @@ void TopologyKernel::set_edge(const EdgeHandle& _eh, const VertexHandle& _fromVe
//========================================================================================
/// Set the half-edges of a face
// cppcheck-suppress unusedFunction ; public interface
void
TopologyKernel
::
set_face
(
const
FaceHandle
&
_fh
,
const
std
::
vector
<
HalfEdgeHandle
>&
_hes
)
{
Face
&
f
=
face
(
_fh
);
...
...
@@ -542,6 +544,7 @@ void TopologyKernel::set_face(const FaceHandle& _fh, const std::vector<HalfEdgeH
//========================================================================================
/// Set the half-faces of a cell
// cppcheck-suppress unusedFunction ; public interface
void
TopologyKernel
::
set_cell
(
const
CellHandle
&
_ch
,
const
std
::
vector
<
HalfFaceHandle
>&
_hfs
)
{
Cell
&
c
=
cell
(
_ch
);
...
...
@@ -1954,6 +1957,7 @@ void TopologyKernel::delete_multiple_cells(const std::vector<bool>& _tag) {
//========================================================================================
// cppcheck-suppress unusedFunction ; public interface
CellIter
TopologyKernel
::
delete_cell_range
(
const
CellIter
&
_first
,
const
CellIter
&
_last
)
{
assert
(
_first
>=
cells_begin
());
...
...
src/OpenVolumeMesh/FileManager/FileManager.cc
View file @
59c40b49
...
...
@@ -184,6 +184,7 @@ bool FileManager::isHexahedralMesh(const std::string& _filename) const {
return
true
;
}
// cppcheck-suppress unusedFunction ; public interface
bool
FileManager
::
isTetrahedralMesh
(
const
std
::
string
&
_filename
)
const
{
std
::
ifstream
iff
(
_filename
.
c_str
(),
std
::
ios
::
in
);
...
...
src/OpenVolumeMesh/Geometry/Vector11T.hh
View file @
59c40b49
...
...
@@ -121,7 +121,9 @@ class VectorT {
typename
=
typename
std
::
enable_if
<
sizeof
...(
T
)
==
DIM
>
::
type
,
typename
=
typename
std
::
enable_if
<
are_convertible_to
<
Scalar
,
T
...
>::
value
>::
type
>
constexpr
VectorT
(
T
...
vs
)
:
values_
{
{
static_cast
<
Scalar
>
(
vs
)...}
}
{
// cppcheck-suppress noExplicitConstructor ; only applies to unimportant DIM==1
constexpr
VectorT
(
T
...
vs
)
:
values_
{
{
static_cast
<
Scalar
>
(
vs
)...}
}
{
static_assert
(
sizeof
...(
T
)
==
DIM
,
"Invalid number of components specified in constructor."
);
static_assert
(
are_convertible_to
<
Scalar
,
T
...
>::
value
,
...
...
@@ -176,7 +178,9 @@ class VectorT {
template
<
typename
OtherScalar
,
typename
=
typename
std
::
enable_if
<
std
::
is_convertible
<
OtherScalar
,
Scalar
>
::
value
>>
vector_type
&
operator
=
(
const
VectorT
<
OtherScalar
,
DIM
>&
_rhs
)
{
// cppcheck-suppress operatorEqRetRefThis ; false positive
vector_type
&
operator
=
(
const
VectorT
<
OtherScalar
,
DIM
>&
_rhs
)
{
std
::
transform
(
_rhs
.
data
(),
_rhs
.
data
()
+
DIM
,
data
(),
[](
OtherScalar
rhs
)
{
return
static_cast
<
Scalar
>
(
std
::
move
(
rhs
));
...
...
src/OpenVolumeMesh/Mesh/HexahedralMeshIterators.cc
View file @
59c40b49
...
...
@@ -235,10 +235,12 @@ HexVertexIter::HexVertexIter(const CellHandle& _ref_h,
BaseIter
(
_mesh
,
_ref_h
,
_max_laps
)
{
assert
(
_ref_h
.
is_valid
());
assert
(
_mesh
->
cell
(
_ref_h
).
halffaces
().
size
()
==
6
);
HexahedralMeshTopologyKernel
::
Cell
cell
=
_mesh
->
cell
(
_ref_h
);
assert
(
cell
.
halffaces
().
size
()
==
6
);
// Get first half-face
HalfFaceHandle
curHF
=
*
_mesh
->
cell
(
_ref_h
)
.
halffaces
().
begin
();
HalfFaceHandle
curHF
=
*
cell
.
halffaces
().
begin
();
assert
(
curHF
.
is_valid
());
// Get first half-edge
...
...
src/OpenVolumeMesh/Mesh/TetrahedralMeshIterators.cc
View file @
59c40b49
...
...
@@ -32,14 +32,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#include <set>
#include "TetrahedralMeshIterators.hh"
...
...
@@ -58,10 +50,13 @@ TetVertexIter::TetVertexIter(const CellHandle& _ref_h,
BaseIter
(
_mesh
,
_ref_h
,
_max_laps
)
{
assert
(
_ref_h
.
is_valid
());
assert
(
_mesh
->
cell
(
_ref_h
).
halffaces
().
size
()
==
4
);
TetrahedralMeshTopologyKernel
::
Cell
cell
=
_mesh
->
cell
(
_ref_h
);
assert
(
cell
.
halffaces
().
size
()
==
4
);
// Get first half-face
HalfFaceHandle
curHF
=
*
_mesh
->
cell
(
_ref_h
)
.
halffaces
().
begin
();
HalfFaceHandle
curHF
=
*
cell
.
halffaces
().
begin
();
assert
(
curHF
.
is_valid
());
// Get first half-edge
...
...
src/OpenVolumeMesh/Mesh/TetrahedralMeshTopologyKernel.cc
View file @
59c40b49
...
...
@@ -330,6 +330,7 @@ void TetrahedralMeshTopologyKernel::collapse_edge(HalfEdgeHandle _heh)
// swapPropertyElements(halfedge_props_begin(), halfedge_props_end(), source, destination);
//}
// cppcheck-suppress unusedFunction ; public interface
VertexHandle
TetrahedralMeshTopologyKernel
::
collapse_edge
(
HalfEdgeHandle
_heh
)
{
bool
deferred_deletion_tmp
=
deferred_deletion_enabled
();
...
...
@@ -355,10 +356,8 @@ VertexHandle TetrahedralMeshTopologyKernel::collapse_edge(HalfEdgeHandle _heh)
for
(
VertexCellIter
vc_it
=
vc_iter
(
from_vh
);
vc_it
.
valid
();
++
vc_it
)
incidentCells
.
push_back
(
*
vc_it
);
for
(
unsigned
int
i
=
0
;
i
<
incidentCells
.
size
();
++
i
)
for
(
const
CellHandle
&
ch
:
incidentCells
)
{
CellHandle
ch
=
incidentCells
[
i
];
if
(
collapsingCells
.
find
(
ch
)
!=
collapsingCells
.
end
())
continue
;
...
...
@@ -366,9 +365,9 @@ VertexHandle TetrahedralMeshTopologyKernel::collapse_edge(HalfEdgeHandle _heh)
std
::
vector
<
HalfFaceHandle
>
newHalffaces
;
for
(
unsigned
int
i
=
0
;
i
<
4
;
++
i
)
for
(
unsigned
int
hf_idx
=
0
;
hf_idx
<
4
;
++
hf_idx
)
{
Face
hf
=
halfface
(
c
.
halffaces
()[
i
]);
Face
hf
=
halfface
(
c
.
halffaces
()[
hf_idx
]);
std
::
vector
<
HalfEdgeHandle
>
newHalfedges
;
for
(
unsigned
int
j
=
0
;
j
<
3
;
++
j
)
...
...
@@ -384,7 +383,7 @@ VertexHandle TetrahedralMeshTopologyKernel::collapse_edge(HalfEdgeHandle _heh)
HalfFaceHandle
hfh
=
add_halfface
(
newHalfedges
);
newHalffaces
.
push_back
(
hfh
);
swap_halfface_properties
(
c
.
halffaces
()[
i
],
hfh
);
swap_halfface_properties
(
c
.
halffaces
()[
hf_idx
],
hfh
);
}
delete_cell
(
ch
);
...
...
@@ -422,6 +421,7 @@ VertexHandle TetrahedralMeshTopologyKernel::collapse_edge(HalfEdgeHandle _heh)
}
// cppcheck-suppress unusedFunction ; public interface
void
TetrahedralMeshTopologyKernel
::
split_edge
(
HalfEdgeHandle
_heh
,
VertexHandle
_vh
)
{
bool
deferred_deletion_tmp
=
deferred_deletion_enabled
();
...
...
@@ -450,6 +450,7 @@ void TetrahedralMeshTopologyKernel::split_edge(HalfEdgeHandle _heh, VertexHandle
}
// cppcheck-suppress unusedFunction ; public interface
void
TetrahedralMeshTopologyKernel
::
split_face
(
FaceHandle
_fh
,
VertexHandle
_vh
)
{
bool
deferred_deletion_tmp
=
deferred_deletion_enabled
();
...
...
@@ -562,6 +563,7 @@ std::vector<VertexHandle> TetrahedralMeshTopologyKernel::get_halfface_vertices(H
return
std
::
vector
<
VertexHandle
>
();
}
// cppcheck-suppress unusedFunction ; public interface
std
::
vector
<
VertexHandle
>
TetrahedralMeshTopologyKernel
::
get_halfface_vertices
(
HalfFaceHandle
hfh
,
HalfEdgeHandle
heh
)
const
{
std
::
vector
<
VertexHandle
>
vertices
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment