Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
code
pugs
Commits
3c4dfca0
Commit
3c4dfca0
authored
4 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Fix warning in assertion
parent
ec8e0e2d
No related branches found
No related tags found
1 merge request
!46
Feature/free boundary condition
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mesh/SubItemValuePerItem.hpp
+5
-8
5 additions, 8 deletions
src/mesh/SubItemValuePerItem.hpp
with
5 additions
and
8 deletions
src/mesh/SubItemValuePerItem.hpp
+
5
−
8
View file @
3c4dfca0
...
@@ -55,8 +55,7 @@ class SubItemValuePerItem
...
@@ -55,8 +55,7 @@ class SubItemValuePerItem
public:
public:
template
<
typename
IndexType
>
template
<
typename
IndexType
>
PUGS_INLINE
const
DataType
&
PUGS_INLINE
const
DataType
&
operator
[](
IndexType
i
)
const
noexcept
(
NO_ASSERT
)
operator
[](
IndexType
i
)
const
noexcept
(
NO_ASSERT
)
{
{
static_assert
(
std
::
is_integral_v
<
IndexType
>
,
"SubView is indexed by integral values"
);
static_assert
(
std
::
is_integral_v
<
IndexType
>
,
"SubView is indexed by integral values"
);
Assert
(
i
<
m_size
);
Assert
(
i
<
m_size
);
...
@@ -64,8 +63,7 @@ class SubItemValuePerItem
...
@@ -64,8 +63,7 @@ class SubItemValuePerItem
}
}
template
<
typename
IndexType
>
template
<
typename
IndexType
>
PUGS_FORCEINLINE
DataType
&
PUGS_FORCEINLINE
DataType
&
operator
[](
IndexType
i
)
noexcept
(
NO_ASSERT
)
operator
[](
IndexType
i
)
noexcept
(
NO_ASSERT
)
{
{
static_assert
(
std
::
is_integral_v
<
IndexType
>
,
"SubView is indexed by integral values"
);
static_assert
(
std
::
is_integral_v
<
IndexType
>
,
"SubView is indexed by integral values"
);
Assert
(
i
<
m_size
);
Assert
(
i
<
m_size
);
...
@@ -104,10 +102,10 @@ class SubItemValuePerItem
...
@@ -104,10 +102,10 @@ class SubItemValuePerItem
PUGS_FORCEINLINE
DataType
&
PUGS_FORCEINLINE
DataType
&
operator
()(
IndexType
item_id
,
SubIndexType
i
)
const
noexcept
(
NO_ASSERT
)
operator
()(
IndexType
item_id
,
SubIndexType
i
)
const
noexcept
(
NO_ASSERT
)
{
{
static_assert
(
std
::
is_same_v
<
IndexType
,
ItemId
>
,
"first index must be
an
ItemId"
);
static_assert
(
std
::
is_same_v
<
IndexType
,
ItemId
>
,
"first index must be
of the correct
ItemId
type
"
);
static_assert
(
std
::
is_integral_v
<
SubIndexType
>
,
"second index must be an integral type"
);
static_assert
(
std
::
is_integral_v
<
SubIndexType
>
,
"second index must be an integral type"
);
Assert
(
this
->
isBuilt
());
Assert
(
this
->
isBuilt
());
Assert
(
i
<
m_host_row_map
(
size_t
{
item_id
}
+
1
)
-
m_host_row_map
(
size_t
{
item_id
})
);
Assert
(
i
+
m_host_row_map
(
size_t
{
item_id
})
<
m_host_row_map
(
size_t
{
item_id
}
+
1
));
return
m_values
[
m_host_row_map
(
size_t
{
item_id
})
+
i
];
return
m_values
[
m_host_row_map
(
size_t
{
item_id
})
+
i
];
}
}
...
@@ -122,8 +120,7 @@ class SubItemValuePerItem
...
@@ -122,8 +120,7 @@ class SubItemValuePerItem
// Following Kokkos logic, these classes are view and const view does allow
// Following Kokkos logic, these classes are view and const view does allow
// changes in data
// changes in data
template
<
typename
ArrayIndexType
>
template
<
typename
ArrayIndexType
>
DataType
&
DataType
&
operator
[](
const
ArrayIndexType
&
i
)
const
noexcept
(
NO_ASSERT
)
operator
[](
const
ArrayIndexType
&
i
)
const
noexcept
(
NO_ASSERT
)
{
{
static_assert
(
std
::
is_integral_v
<
ArrayIndexType
>
,
"index must be an integral type"
);
static_assert
(
std
::
is_integral_v
<
ArrayIndexType
>
,
"index must be an integral type"
);
Assert
(
this
->
isBuilt
());
Assert
(
this
->
isBuilt
());
...
...
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