Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
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
MostafaMollaali
dynamic
Commits
86f05f1b
Commit
86f05f1b
authored
10 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[MeL] std::size_t instead of unsigned as type for id.
Using unique type for id fixes some warnings.
parent
5c1bc98b
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
MeshLib/Node.cpp
+4
-4
4 additions, 4 deletions
MeshLib/Node.cpp
MeshLib/Node.h
+4
-4
4 additions, 4 deletions
MeshLib/Node.h
with
8 additions
and
8 deletions
MeshLib/Node.cpp
+
4
−
4
View file @
86f05f1b
...
@@ -17,13 +17,13 @@
...
@@ -17,13 +17,13 @@
namespace
MeshLib
{
namespace
MeshLib
{
Node
::
Node
(
const
double
coords
[
3
],
unsigned
id
)
Node
::
Node
(
const
double
coords
[
3
],
std
::
size_t
id
)
:
MathLib
::
MathPoint
(
coords
),
_id
(
id
)
:
MathLib
::
MathPoint
(
coords
),
_id
(
id
)
{
{
}
}
Node
::
Node
(
double
x
,
double
y
,
double
z
,
unsigned
id
)
Node
::
Node
(
double
x
,
double
y
,
double
z
,
std
::
size_t
id
)
:
MathLib
::
MathPoint
({
x
,
y
,
z
}),
_id
(
id
)
:
MathLib
::
MathPoint
(
std
::
array
<
double
,
3
>
({
{
x
,
y
,
z
}
})
),
_id
(
id
)
{
{
}
}
...
@@ -43,7 +43,7 @@ void Node::updateCoordinates(double x, double y, double z)
...
@@ -43,7 +43,7 @@ void Node::updateCoordinates(double x, double y, double z)
_x
[
2
]
=
z
;
_x
[
2
]
=
z
;
const
size_t
nElements
(
this
->
_elements
.
size
());
const
size_t
nElements
(
this
->
_elements
.
size
());
for
(
unsigned
i
=
0
;
i
<
nElements
;
i
++
)
for
(
std
::
size_t
i
=
0
;
i
<
nElements
;
i
++
)
_elements
[
i
]
->
computeVolume
();
_elements
[
i
]
->
computeVolume
();
}
}
...
...
This diff is collapsed.
Click to expand it.
MeshLib/Node.h
+
4
−
4
View file @
86f05f1b
...
@@ -47,10 +47,10 @@ class Node : public MathLib::MathPoint
...
@@ -47,10 +47,10 @@ class Node : public MathLib::MathPoint
public:
public:
/// Constructor using a coordinate array
/// Constructor using a coordinate array
Node
(
const
double
coords
[
3
],
unsigned
id
=
std
::
numeric_limits
<
unsigned
>::
max
());
Node
(
const
double
coords
[
3
],
std
::
size_t
id
=
std
::
numeric_limits
<
std
::
size_t
>::
max
());
/// Constructor using single coordinates
/// Constructor using single coordinates
Node
(
double
x
,
double
y
,
double
z
,
unsigned
id
=
std
::
numeric_limits
<
unsigned
>::
max
());
Node
(
double
x
,
double
y
,
double
z
,
std
::
size_t
id
=
std
::
numeric_limits
<
std
::
size_t
>::
max
());
/// Copy constructor
/// Copy constructor
Node
(
const
Node
&
node
);
Node
(
const
Node
&
node
);
...
@@ -61,7 +61,7 @@ public:
...
@@ -61,7 +61,7 @@ public:
const
std
::
vector
<
MeshLib
::
Node
*>&
getConnectedNodes
()
const
{
return
_connected_nodes
;
}
const
std
::
vector
<
MeshLib
::
Node
*>&
getConnectedNodes
()
const
{
return
_connected_nodes
;
}
/// Get an element the node is part of.
/// Get an element the node is part of.
const
Element
*
getElement
(
unsigned
idx
)
const
{
return
_elements
[
idx
];
}
const
Element
*
getElement
(
std
::
size_t
idx
)
const
{
return
_elements
[
idx
];
}
/// Get all elements the node is part of.
/// Get all elements the node is part of.
const
std
::
vector
<
Element
*>&
getElements
()
const
{
return
_elements
;
}
const
std
::
vector
<
Element
*>&
getElements
()
const
{
return
_elements
;
}
...
@@ -88,7 +88,7 @@ protected:
...
@@ -88,7 +88,7 @@ protected:
}
}
/// Sets the ID of a node to the given value.
/// Sets the ID of a node to the given value.
void
setID
(
unsigned
id
)
{
this
->
_id
=
id
;
}
void
setID
(
std
::
size_t
id
)
{
this
->
_id
=
id
;
}
/// Update coordinates of a node.
/// Update coordinates of a node.
/// This method automatically also updates the areas/volumes of all connected elements.
/// This method automatically also updates the areas/volumes of all connected elements.
...
...
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