Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GILLES Sebastien
MoReFEM
Commits
29b70c57
Commit
29b70c57
authored
Oct 16, 2019
by
GILLES Sebastien
Browse files
#1292 Fix warnings.
parent
0540b3a3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Sources/FiniteElement/RefFiniteElement/Advanced/RefFEltInLocalOperator.cpp
View file @
29b70c57
...
...
@@ -72,7 +72,7 @@ namespace MoReFEM
}
// \todo #1292 Probably might be done with native Xtensor functions
const
LocalMatrix
&
ExtractSubMatrix
(
const
LocalMatrix
&
full_matrix
,
const
RefFEltInLocalOperator
&
ref_felt
)
{
...
...
@@ -83,7 +83,7 @@ namespace MoReFEM
const
auto
&
row_range
=
ref_felt
.
GetLocalNodeIndexList
();
const
auto
ref_felt_space_dim
=
static_cast
<
in
t
>
(
ref_felt
.
GetFEltSpaceDimension
());
const
auto
ref_felt_space_dim
=
static_cast
<
std
::
size_
t
>
(
ref_felt
.
GetFEltSpaceDimension
());
#ifndef NDEBUG
// \todo #1292 Wrappers::Seldon::AssertBlockRowValidity(full_matrix, row_range);
...
...
@@ -98,7 +98,7 @@ namespace MoReFEM
{
auto
row_index
=
row_range
[
i
];
for
(
int
component
=
0
;
component
<
ref_felt_space_dim
;
++
component
)
for
(
auto
component
=
0
ul
;
component
<
ref_felt_space_dim
;
++
component
)
ret
(
i
,
component
)
=
full_matrix
(
row_index
,
component
);
}
...
...
Sources/OperatorInstances/VariationalOperator/BilinearForm/Local/GradPhiGradPhi.cpp
View file @
29b70c57
...
...
@@ -47,8 +47,8 @@ namespace MoReFEM
const
auto
&
ref_felt
=
elementary_data
.
GetRefFElt
(
unknown
);
const
auto
&
test_ref_felt
=
elementary_data
.
GetTestRefFElt
(
test_unknown
);
const
int
Nnode_for_unknown
=
static_cast
<
in
t
>
(
ref_felt
.
Nnode
());
const
int
Nnode_for_test_unknown
=
static_cast
<
in
t
>
(
test_ref_felt
.
Nnode
());
const
auto
Nnode_for_unknown
=
static_cast
<
std
::
size_
t
>
(
ref_felt
.
Nnode
());
const
auto
Nnode_for_test_unknown
=
static_cast
<
std
::
size_
t
>
(
test_ref_felt
.
Nnode
());
#ifndef NDEBUG
{
...
...
@@ -97,12 +97,12 @@ namespace MoReFEM
const
auto
&
infos_at_quad_pt_list
=
elementary_data
.
GetInformationsAtQuadraturePointList
();
const
int
Nnode_for_unknown
=
static_cast
<
in
t
>
(
ref_felt
.
Nnode
());
const
int
Nnode_for_test_unknown
=
static_cast
<
in
t
>
(
test_ref_felt
.
Nnode
());
const
auto
Nnode_for_unknown
=
static_cast
<
std
::
size_
t
>
(
ref_felt
.
Nnode
());
const
auto
Nnode_for_test_unknown
=
static_cast
<
std
::
size_
t
>
(
test_ref_felt
.
Nnode
());
const
int
Ncomponent
=
static_cast
<
in
t
>
(
ref_felt
.
Ncomponent
());
const
auto
Ncomponent
=
static_cast
<
std
::
size_
t
>
(
ref_felt
.
Ncomponent
());
assert
(
Ncomponent
==
static_cast
<
in
t
>
(
test_ref_felt
.
Ncomponent
()));
assert
(
Ncomponent
==
static_cast
<
std
::
size_
t
>
(
test_ref_felt
.
Ncomponent
()));
for
(
const
auto
&
infos_at_quad_pt
:
infos_at_quad_pt_list
)
{
...
...
@@ -130,13 +130,13 @@ namespace MoReFEM
// Then report it into the elementary matrix.
for
(
int
m
=
0
;
m
<
Nnode_for_test_unknown
;
++
m
)
for
(
auto
m
=
0
ul
;
m
<
Nnode_for_test_unknown
;
++
m
)
{
for
(
int
n
=
0
;
n
<
Nnode_for_unknown
;
++
n
)
for
(
auto
n
=
0
ul
;
n
<
Nnode_for_unknown
;
++
n
)
{
const
double
value
=
block_matrix
(
m
,
n
);
for
(
int
deriv_component
=
0
;
deriv_component
<
Ncomponent
;
++
deriv_component
)
for
(
auto
deriv_component
=
0
ul
;
deriv_component
<
Ncomponent
;
++
deriv_component
)
{
const
auto
shift
=
Nnode_for_test_unknown
*
deriv_component
;
matrix_result
(
m
+
shift
,
n
+
shift
)
+=
value
;
...
...
Sources/Operators/ConformInterpolator/Internal/ComputePatternHelper.cpp
View file @
29b70c57
...
...
@@ -216,8 +216,7 @@ namespace MoReFEM
std
::
vector
<
LocalRowContent
>
LocalMatrixContent
(
const
LocalMatrix
&
matrix
)
{
{
const
auto
Nrow
=
matrix
.
shape
(
0
);
const
auto
Ncol
=
matrix
.
shape
(
1
);
...
...
@@ -226,11 +225,11 @@ namespace MoReFEM
std
::
vector
<
LocalRowContent
>
ret
;
ret
.
reserve
(
static_cast
<
std
::
size_t
>
(
Nrow
));
for
(
auto
row
=
0
;
row
<
Nrow
;
++
row
)
for
(
auto
row
=
0
ul
;
row
<
Nrow
;
++
row
)
{
LocalRowContent
line_content
;
for
(
auto
col
=
0
;
col
<
Ncol
;
++
col
)
for
(
auto
col
=
0
ul
;
col
<
Ncol
;
++
col
)
{
const
auto
value
=
matrix
(
row
,
col
);
...
...
Sources/Operators/ConformInterpolator/Lagrangian/LocalLagrangianInterpolator.cpp
View file @
29b70c57
...
...
@@ -67,13 +67,13 @@ namespace MoReFEM
const
auto
Nunknown
=
source_unknown_list
.
size
();
assert
(
Nunknown
==
target_unknown_list
.
size
());
int
shift_row
=
0
;
int
shift_col
=
0
;
auto
shift_row
=
0
;
auto
shift_col
=
0
;
const
auto
dimension
=
source_data
.
GetFEltSpace
().
GetMeshDimension
();
int
Nnode_in_row
=
node_block
.
shape
(
0
);
int
Nnode_in_col
=
node_block
.
shape
(
1
);
const
auto
Nnode_in_row
=
node_block
.
shape
(
0
);
const
auto
Nnode_in_col
=
node_block
.
shape
(
1
);
auto
&
local_projection_matrix
=
GetNonCstProjectionMatrix
();
...
...
@@ -93,11 +93,11 @@ namespace MoReFEM
}
#endif // NDEBUG
for
(
int
component
=
0
;
component
<
Ncomponent
;
++
component
)
for
(
auto
component
=
0
;
component
<
Ncomponent
;
++
component
)
{
for
(
auto
row
=
0
;
row
<
Nnode_in_row
;
++
row
)
for
(
auto
row
=
0
ul
;
row
<
Nnode_in_row
;
++
row
)
{
for
(
auto
col
=
0
;
col
<
Nnode_in_col
;
++
col
)
for
(
auto
col
=
0
ul
;
col
<
Nnode_in_col
;
++
col
)
local_projection_matrix
(
row
+
shift_row
,
col
+
shift_col
)
=
node_block
(
row
,
col
);
}
...
...
Sources/Operators/LocalVariationalOperator/Advanced/ExtractGradientBasedBlock.cpp
View file @
29b70c57
...
...
@@ -41,12 +41,12 @@ namespace MoReFEM
assert
(
full_matrix
.
shape
(
0
)
>=
Ncomponent
);
assert
(
full_matrix
.
shape
(
1
)
>=
Ncomponent
);
const
int
first_row_index_in_full_matrix
=
static_cast
<
int
>
(
row_component
)
*
Ncomponent
;
const
int
first_col_index_in_full_matrix
=
static_cast
<
int
>
(
col_component
)
*
Ncomponent
;
const
auto
first_row_index_in_full_matrix
=
row_component
*
Ncomponent
;
const
auto
first_col_index_in_full_matrix
=
col_component
*
Ncomponent
;
for
(
int
m
=
0
;
m
<
Ncomponent
;
++
m
)
for
(
auto
m
=
0
ul
;
m
<
Ncomponent
;
++
m
)
{
for
(
int
n
=
0
;
n
<
Ncomponent
;
++
n
)
for
(
auto
n
=
0
ul
;
n
<
Ncomponent
;
++
n
)
{
assert
(
first_row_index_in_full_matrix
+
m
<
full_matrix
.
shape
(
0
));
assert
(
first_col_index_in_full_matrix
+
n
<
full_matrix
.
shape
(
1
));
...
...
@@ -63,15 +63,15 @@ namespace MoReFEM
XtensorMatrix
&
column_matrix
)
{
const
auto
Ncomponent
=
column_matrix
.
shape
(
0
);
assert
(
static_cast
<
in
t
>
(
row_component
)
<
Ncomponent
);
assert
(
static_cast
<
in
t
>
(
column_matrix
.
shape
(
1
))
==
1
);
assert
(
static_cast
<
std
::
size_
t
>
(
row_component
)
<
Ncomponent
);
assert
(
static_cast
<
size_
t
>
(
column_matrix
.
shape
(
1
))
==
1
ul
);
// >= and not > in the following assert because of the 1D case where this extraction is just a copy.
// Indeed the two matrices in this case are in fact scalars.
assert
(
full_column_matrix
.
shape
(
0
)
>=
Ncomponent
);
const
int
first_row_index_in_full_column_matrix
=
static_cast
<
int
>
(
row_component
)
*
Ncomponent
;
const
auto
first_row_index_in_full_column_matrix
=
row_component
*
Ncomponent
;
for
(
int
m
=
0
;
m
<
Ncomponent
;
++
m
)
for
(
auto
m
=
0
ul
;
m
<
Ncomponent
;
++
m
)
{
assert
(
first_row_index_in_full_column_matrix
+
m
<
full_column_matrix
.
shape
(
0
));
...
...
@@ -85,15 +85,15 @@ namespace MoReFEM
XtensorMatrix
&
row_matrix
)
{
const
auto
Ncomponent
=
row_matrix
.
shape
(
1
);
assert
(
static_cast
<
int
>
(
col_component
)
<
Ncomponent
);
assert
(
static_cast
<
int
>
(
row_matrix
.
shape
(
0
)
)
==
1
);
assert
(
col_component
<
Ncomponent
);
assert
(
row_matrix
.
shape
(
0
)
==
1
);
// >= and not > in the following assert because of the 1D case where this extraction is just a copy.
// Indeed the two matrices in this case are in fact scalars.
assert
(
full_row_matrix
.
shape
(
0
)
>=
Ncomponent
);
const
int
first_col_index_in_full_row_matrix
=
static_cast
<
in
t
>
(
col_component
)
*
Ncomponent
;
const
auto
first_col_index_in_full_row_matrix
=
static_cast
<
std
::
size_
t
>
(
col_component
)
*
Ncomponent
;
for
(
int
m
=
0
;
m
<
Ncomponent
;
++
m
)
for
(
auto
m
=
0
ul
;
m
<
Ncomponent
;
++
m
)
{
assert
(
first_col_index_in_full_row_matrix
+
m
<
full_row_matrix
.
shape
(
0
));
...
...
Sources/Parameters/Policy/AtDof/Internal/AtDof.cpp
View file @
29b70c57
...
...
@@ -109,9 +109,9 @@ namespace MoReFEM
const
auto
&
dof_list
=
node
.
GetDofList
();
const
auto
Ndof
=
static_cast
<
int
>
(
dof_list
.
size
()
)
;
const
auto
Ndof
=
dof_list
.
size
();
for
(
auto
dof_index
=
0
;
dof_index
<
Ndof
;
++
dof_index
)
for
(
auto
dof_index
=
0
ul
;
dof_index
<
Ndof
;
++
dof_index
)
{
const
auto
&
dof_ptr
=
dof_list
[
static_cast
<
std
::
size_t
>
(
dof_index
)];
assert
(
!
(
!
dof_ptr
));
...
...
Sources/ThirdParty/Wrappers/Seldon/MatrixOperations.cpp
View file @
29b70c57
...
...
@@ -112,10 +112,8 @@ namespace MoReFEM
const
auto
Nrow
=
matrix
.
shape
(
0
);
const
auto
Ncol
=
matrix
.
shape
(
1
);
bool
is_non_zero
=
false
;
for
(
int
i
=
0
;
i
<
Nrow
&&
!
is_non_zero
;
++
i
)
for
(
int
j
=
0
;
j
<
Ncol
&&
!
is_non_zero
;
++
j
)
for
(
auto
i
=
0ul
;
i
<
Nrow
;
++
i
)
for
(
auto
j
=
0ul
;
j
<
Ncol
;
++
j
)
if
(
!
NumericNS
::
IsZero
(
matrix
(
i
,
j
)))
return
false
;
...
...
Sources/ThirdParty/Wrappers/Seldon/SeldonFunctions.hxx
View file @
29b70c57
...
...
@@ -293,9 +293,9 @@ namespace MoReFEM
const
auto
Nrow
=
source
.
shape
(
0
);
const
auto
Ncol
=
source
.
shape
(
1
);
for
(
auto
i
=
0
;
i
<
Nrow
;
++
i
)
for
(
auto
i
=
0
ul
;
i
<
Nrow
;
++
i
)
{
for
(
auto
j
=
0
;
j
<
Ncol
;
++
j
)
for
(
auto
j
=
0
ul
;
j
<
Ncol
;
++
j
)
target
(
i
,
j
)
=
factor
*
source
(
i
,
j
);
}
...
...
@@ -307,10 +307,7 @@ namespace MoReFEM
{
assert
(
target
.
shape
(
0
)
==
source
.
shape
(
0
));
const
auto
Nrow
=
source
.
shape
(
0
);
for
(
int
i
=
0
;
i
<
Nrow
;
++
i
)
target
(
i
)
=
factor
*
source
(
i
);
target
=
factor
*
source
;
}
...
...
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