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
hyteg
hyteg
Commits
07b957ab
Commit
07b957ab
authored
Sep 30, 2021
by
Marcus Mohr
Browse files
Further adaptations to get rid of PetscInt at most places
parent
c4dce15e
Pipeline
#34509
failed with stages
in 24 minutes and 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/hyteg/petsc/PETScSparseMatrix.hpp
View file @
07b957ab
...
...
@@ -92,21 +92,21 @@ class PETScSparseMatrix
petscCommunicator
)
{}
PETScSparseMatrix
(
const
FunctionTypeSrc
<
PetscIn
t
>&
enumerator
,
const
uint_t
&
level
,
const
char
name
[]
=
"Mat"
,
const
MPI_Comm
&
petscCommunicator
=
walberla
::
mpi
::
MPIManager
::
instance
()
->
comm
()
)
PETScSparseMatrix
(
const
FunctionTypeSrc
<
idx_
t
>&
enumerator
,
const
uint_t
&
level
,
const
char
name
[]
=
"Mat"
,
const
MPI_Comm
&
petscCommunicator
=
walberla
::
mpi
::
MPIManager
::
instance
()
->
comm
()
)
:
PETScSparseMatrix
(
numberOfLocalDoFs
(
enumerator
,
level
),
numberOfGlobalDoFs
(
enumerator
,
level
,
petscCommunicator
),
name
,
petscCommunicator
)
{}
PETScSparseMatrix
(
const
FunctionTypeSrc
<
PetscIn
t
>&
enumeratorSrc
,
const
FunctionTypeDst
<
PetscIn
t
>&
enumeratorDst
,
const
uint_t
&
level
,
const
char
name
[]
=
"Mat"
,
const
MPI_Comm
&
petscCommunicator
=
walberla
::
mpi
::
MPIManager
::
instance
()
->
comm
()
)
PETScSparseMatrix
(
const
FunctionTypeSrc
<
idx_
t
>&
enumeratorSrc
,
const
FunctionTypeDst
<
idx_
t
>&
enumeratorDst
,
const
uint_t
&
level
,
const
char
name
[]
=
"Mat"
,
const
MPI_Comm
&
petscCommunicator
=
walberla
::
mpi
::
MPIManager
::
instance
()
->
comm
()
)
:
PETScSparseMatrix
(
numberOfLocalDoFs
(
enumeratorDst
,
level
),
numberOfGlobalDoFs
(
enumeratorDst
,
level
,
petscCommunicator
),
numberOfGlobalDoFs
(
enumeratorSrc
,
level
,
petscCommunicator
),
...
...
@@ -217,10 +217,10 @@ class PETScSparseMatrix
/// \param rhsVec RHS of the system as PETSc vector - NOTE THAT THIS IS MODIFIED IN PLACE
/// \param level the refinement level
///
void
applyDirichletBCSymmetrically
(
const
FunctionTypeSrc
<
real_t
>&
dirichletSolution
,
const
FunctionTypeSrc
<
idx_t
>&
numerator
,
void
applyDirichletBCSymmetrically
(
const
FunctionTypeSrc
<
real_t
>&
dirichletSolution
,
const
FunctionTypeSrc
<
idx_t
>&
numerator
,
PETScVector
<
real_t
,
OperatorType
::
dstType
::
template
FunctionType
>
&
rhsVec
,
const
uint_t
&
level
)
const
uint_t
&
level
)
{
std
::
vector
<
idx_t
>
bcIndices
;
hyteg
::
petsc
::
applyDirichletBC
(
numerator
,
bcIndices
,
level
);
...
...
tests/hyteg/Petsc/PetscMatrixAssemblyTest.cpp
View file @
07b957ab
...
...
@@ -125,7 +125,7 @@ void testAssembly( BlockOperator< fKind< real_t >, fKind< real_t > >& oper,
}
typedef
BlockOperator
<
fKind
<
real_t
>
,
fKind
<
real_t
>
>
operType
;
fKind
<
PetscInt
>
enumerator
(
"enumerator"
,
storage
,
level
,
level
);
fKind
<
idx_t
>
enumerator
(
"enumerator"
,
storage
,
level
,
level
);
enumerator
.
enumerate
(
level
);
PETScManager
petscManager
;
...
...
tests/hyteg/forms/RowSumTest.cpp
View file @
07b957ab
...
...
@@ -50,10 +50,8 @@ template < class P1Form >
using
P1ConstOp
=
P1ConstantOperator
<
P1Form
,
false
,
false
,
false
>
;
template
<
typename
rowSumFormType
,
template
<
class
>
class
funcType
,
template
<
class
>
class
opType
,
template
<
class
>
class
funcType
,
template
<
class
>
class
opType
,
typename
opTypeLap
,
typename
opTypeMass
>
bool
RowSumTest
(
const
uint_t
&
level
,
const
std
::
string
&
meshFile
,
rowSumFormType
rowSumLaplace
,
rowSumFormType
rowSumMass
)
...
...
@@ -95,11 +93,11 @@ bool RowSumTest( const uint_t& level, const std::string& meshFile, rowSumFormTyp
// compare
real_t
maxError
;
error
.
assign
(
{
1.0
,
-
1.0
},
{
dstVerificationLaplace
,
dstRowSumLaplace
},
level
,
All
);
error
.
assign
(
{
1.0
,
-
1.0
},
{
dstVerificationLaplace
,
dstRowSumLaplace
},
level
,
All
);
maxError
=
error
.
getMaxMagnitude
(
level
);
WALBERLA_LOG_INFO_ON_ROOT
(
" -> error max magnitude Laplace: "
<<
maxError
<<
", eps: "
<<
eps
);
error
.
assign
(
{
1.0
,
-
1.0
},
{
dstVerificationMass
,
dstRowSumMass
},
level
,
All
);
error
.
assign
(
{
1.0
,
-
1.0
},
{
dstVerificationMass
,
dstRowSumMass
},
level
,
All
);
maxError
=
error
.
getMaxMagnitude
(
level
);
WALBERLA_LOG_INFO_ON_ROOT
(
" -> error max magnitude mass: "
<<
maxError
<<
", eps: "
<<
eps
);
...
...
@@ -108,11 +106,11 @@ bool RowSumTest( const uint_t& level, const std::string& meshFile, rowSumFormTyp
#ifdef HYTEG_BUILD_WITH_PETSC
// check if matrices diagonal
PETScManager
manager
;
typedef
typename
FunctionTrait
<
funcType
<
PetscIn
t
>
>::
Tag
enumTag
;
const
auto
localSize
=
numberOfLocalDoFs
<
enumTag
>
(
*
storage
,
level
);
const
auto
globalSize
=
numberOfGlobalDoFs
<
enumTag
>
(
*
storage
,
level
);
funcType
<
PetscIn
t
>
numerator
(
"numerator"
,
storage
,
level
,
level
);
PETScManager
manager
;
typedef
typename
FunctionTrait
<
funcType
<
idx_
t
>
>::
Tag
enumTag
;
const
auto
localSize
=
numberOfLocalDoFs
<
enumTag
>
(
*
storage
,
level
);
const
auto
globalSize
=
numberOfGlobalDoFs
<
enumTag
>
(
*
storage
,
level
);
funcType
<
idx_
t
>
numerator
(
"numerator"
,
storage
,
level
,
level
);
numerator
.
enumerate
(
level
);
...
...
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