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
527af378
Commit
527af378
authored
Sep 29, 2021
by
Nils Kohl
🌝
Browse files
Removing another call to createMatrix(). Some cleanup.
parent
bb355727
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/hyteg/composites/P2P1TaylorHoodStokesOperator.hpp
View file @
527af378
...
...
@@ -38,15 +38,8 @@ class P2P1TaylorHoodStokesOperator : public Operator< P2P1TaylorHoodFunction< re
P2P1TaylorHoodStokesOperator
(
const
std
::
shared_ptr
<
PrimitiveStorage
>&
storage
,
size_t
minLevel
,
size_t
maxLevel
)
:
Operator
(
storage
,
minLevel
,
maxLevel
)
,
A
(
storage
,
minLevel
,
maxLevel
)
,
Lapl
(
storage
,
minLevel
,
maxLevel
)
,
div_x
(
storage
,
minLevel
,
maxLevel
)
,
div_y
(
storage
,
minLevel
,
maxLevel
)
,
div_z
(
storage
,
minLevel
,
maxLevel
)
,
div
(
storage
,
minLevel
,
maxLevel
)
,
divT_x
(
storage
,
minLevel
,
maxLevel
)
,
divT_y
(
storage
,
minLevel
,
maxLevel
)
,
divT_z
(
storage
,
minLevel
,
maxLevel
)
,
divT
(
storage
,
minLevel
,
maxLevel
)
,
pspg_
(
storage
,
minLevel
,
maxLevel
)
,
pspg_inv_diag_
(
storage
,
minLevel
,
maxLevel
)
...
...
@@ -69,48 +62,16 @@ class P2P1TaylorHoodStokesOperator : public Operator< P2P1TaylorHoodFunction< re
size_t
level
,
DoFType
flag
)
const
{
A
.
toMatrix
(
mat
,
src
.
uvw
[
0
],
dst
.
uvw
[
0
],
level
,
flag
);
divT_x
.
getVertexToVertexOpr
().
toMatrix
(
mat
,
src
.
p
,
dst
.
uvw
[
0
].
getVertexDoFFunction
(),
level
,
flag
);
divT_x
.
getVertexToEdgeOpr
().
toMatrix
(
mat
,
src
.
p
,
dst
.
uvw
[
0
].
getEdgeDoFFunction
(),
level
,
flag
);
A
.
toMatrix
(
mat
,
src
.
uvw
[
1
],
dst
.
uvw
[
1
],
level
,
flag
);
divT_y
.
getVertexToVertexOpr
().
toMatrix
(
mat
,
src
.
p
,
dst
.
uvw
[
1
].
getVertexDoFFunction
(),
level
,
flag
);
divT_y
.
getVertexToEdgeOpr
().
toMatrix
(
mat
,
src
.
p
,
dst
.
uvw
[
1
].
getEdgeDoFFunction
(),
level
,
flag
);
if
(
src
.
uvw
[
0
].
getStorage
()
->
hasGlobalCells
()
)
{
A
.
toMatrix
(
mat
,
src
.
uvw
[
2
],
dst
.
uvw
[
2
],
level
,
flag
);
divT_z
.
getVertexToVertexOpr
().
toMatrix
(
mat
,
src
.
p
,
dst
.
uvw
[
2
].
getVertexDoFFunction
(),
level
,
flag
);
divT_z
.
getVertexToEdgeOpr
().
toMatrix
(
mat
,
src
.
p
,
dst
.
uvw
[
2
].
getEdgeDoFFunction
(),
level
,
flag
);
}
div_x
.
getVertexToVertexOpr
().
toMatrix
(
mat
,
src
.
uvw
[
0
].
getVertexDoFFunction
(),
dst
.
p
,
level
,
flag
|
DirichletBoundary
);
div_x
.
getEdgeToVertexOpr
().
toMatrix
(
mat
,
src
.
uvw
[
0
].
getEdgeDoFFunction
(),
dst
.
p
,
level
,
flag
|
DirichletBoundary
);
div_y
.
getVertexToVertexOpr
().
toMatrix
(
mat
,
src
.
uvw
[
1
].
getVertexDoFFunction
(),
dst
.
p
,
level
,
flag
|
DirichletBoundary
);
div_y
.
getEdgeToVertexOpr
().
toMatrix
(
mat
,
src
.
uvw
[
1
].
getEdgeDoFFunction
(),
dst
.
p
,
level
,
flag
|
DirichletBoundary
);
if
(
src
.
uvw
[
0
].
getStorage
()
->
hasGlobalCells
()
)
{
div_z
.
getVertexToVertexOpr
().
toMatrix
(
mat
,
src
.
uvw
[
2
].
getVertexDoFFunction
(),
dst
.
p
,
level
,
flag
|
DirichletBoundary
);
div_z
.
getEdgeToVertexOpr
().
toMatrix
(
mat
,
src
.
uvw
[
2
].
getEdgeDoFFunction
(),
dst
.
p
,
level
,
flag
|
DirichletBoundary
);
}
Lapl
.
toMatrix
(
mat
,
src
.
uvw
,
dst
.
uvw
,
level
,
flag
);
divT
.
toMatrix
(
mat
,
src
.
p
,
dst
.
uvw
,
level
,
flag
);
div
.
toMatrix
(
mat
,
src
.
uvw
,
dst
.
p
,
level
,
flag
);
}
P2ConstantVectorLaplaceOperator
Lapl
;
P2ToP1ConstantDivOperator
div
;
P1ToP2ConstantDivTOperator
divT
;
// currently need these for being able to call createMatrix()
P2ConstantLaplaceOperator
A
;
P2ToP1ConstantDivxOperator
div_x
;
P2ToP1ConstantDivyOperator
div_y
;
P2ToP1ConstantDivzOperator
div_z
;
P1ToP2ConstantDivTxOperator
divT_x
;
P1ToP2ConstantDivTyOperator
divT_y
;
P1ToP2ConstantDivTzOperator
divT_z
;
/// this operator is need in the uzawa smoother
// this operator is needed in the uzawa smoother
P1PSPGOperator
pspg_
;
P1PSPGInvDiagOperator
pspg_inv_diag_
;
bool
hasGlobalCells_
;
...
...
src/hyteg/composites/P2P1UzawaDampingFactorEstimationOperator.hpp
View file @
527af378
...
...
@@ -67,24 +67,14 @@ class P2P1UzawaDampingFactorEstimationOperator : public Operator< P1Function< re
tmp_solution_
.
uvw
[
1
].
interpolate
(
0
,
level
,
All
);
tmp_solution_
.
uvw
[
2
].
interpolate
(
0
,
level
,
All
);
A
.
divT_x
.
apply
(
src
,
tmp_rhs_
.
uvw
[
0
],
level
,
flag
,
Replace
);
A
.
divT_y
.
apply
(
src
,
tmp_rhs_
.
uvw
[
1
],
level
,
flag
,
Replace
);
if
(
hasGlobalCells_
)
{
A
.
divT_z
.
apply
(
src
,
tmp_rhs_
.
uvw
[
2
],
level
,
flag
,
Replace
);
}
A
.
divT
.
apply
(
src
,
tmp_rhs_
.
uvw
,
level
,
flag
,
Replace
);
for
(
uint_t
i
=
0
;
i
<
numGSIterationsVelocity_
;
i
++
)
{
velocitySmoother_
->
solve
(
A
,
tmp_solution_
,
tmp_rhs_
,
level
);
}
A
.
div_x
.
apply
(
tmp_solution_
.
uvw
[
0
],
tmp_schur_
,
level
,
flag
,
Replace
);
A
.
div_y
.
apply
(
tmp_solution_
.
uvw
[
1
],
tmp_schur_
,
level
,
flag
,
Add
);
if
(
hasGlobalCells_
)
{
A
.
div_z
.
apply
(
tmp_solution_
.
uvw
[
2
],
tmp_schur_
,
level
,
flag
,
Add
);
}
A
.
div
.
apply
(
tmp_solution_
.
uvw
,
tmp_schur_
,
level
,
flag
,
Replace
);
mass_inv_diag_
.
apply
(
tmp_schur_
,
dst
,
level
,
flag
,
Replace
);
}
...
...
src/hyteg/p2functionspace/P2ConstantOperator.hpp
View file @
527af378
...
...
@@ -29,11 +29,6 @@
#include "hyteg/p2functionspace/P2Function.hpp"
#include "hyteg/solvers/Smoothables.hpp"
// This include can be removed once the implementation of createMatrix() was moved into toMatrix()
#ifdef HYTEG_BUILD_WITH_PETSC
#include "hyteg/p2functionspace/P2Petsc.hpp"
#endif
namespace
hyteg
{
using
walberla
::
real_t
;
...
...
src/hyteg/p2functionspace/P2Petsc.hpp
View file @
527af378
...
...
@@ -97,23 +97,6 @@ inline void applyDirichletBC( const P2VectorFunction< PetscInt >& numerator, std
}
}
// =============
// P2Operators
// =============
template
<
class
OperatorType
>
inline
void
createMatrix
(
const
OperatorType
&
opr
,
const
P2Function
<
PetscInt
>&
src
,
const
P2Function
<
PetscInt
>&
dst
,
const
std
::
shared_ptr
<
SparseMatrixProxy
>&
mat
,
uint_t
level
,
DoFType
flag
)
{
createMatrix
(
opr
.
getVertexToVertexOpr
(),
src
.
getVertexDoFFunction
(),
dst
.
getVertexDoFFunction
(),
mat
,
level
,
flag
);
createMatrix
(
opr
.
getEdgeToVertexOpr
(),
src
.
getEdgeDoFFunction
(),
dst
.
getVertexDoFFunction
(),
mat
,
level
,
flag
);
createMatrix
(
opr
.
getVertexToEdgeOpr
(),
src
.
getVertexDoFFunction
(),
dst
.
getEdgeDoFFunction
(),
mat
,
level
,
flag
);
createMatrix
(
opr
.
getEdgeToEdgeOpr
(),
src
.
getEdgeDoFFunction
(),
dst
.
getEdgeDoFFunction
(),
mat
,
level
,
flag
);
}
}
// namespace petsc
}
// namespace hyteg
...
...
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