Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
b5068a8f
Commit
b5068a8f
authored
Nov 28, 2012
by
Dave Moxey
Browse files
Fixing full solvers, adding Dirichlet boundary fix to XxtStaticCond.
parent
4be22850
Changes
3
Hide whitespace changes
Inline
Side-by-side
library/MultiRegions/GlobalLinSysDirectFull.cpp
View file @
b5068a8f
...
...
@@ -111,12 +111,12 @@ namespace Nektar
{
bool
dirForcCalculated
=
(
bool
)
pDirForcing
.
num_elements
();
int
nDirDofs
=
pLocToGloMap
->
GetNumGlobalDirBndCoeffs
();
int
nGlobDofs
=
pLocToGloMap
->
GetNumGlobalCoeffs
();
Array
<
OneD
,
NekDouble
>
tmp
(
nGlobDofs
),
tmp2
;
if
(
nDirDofs
)
{
// calculate the dirichlet forcing
int
nGlobDofs
=
pLocToGloMap
->
GetNumGlobalCoeffs
();
Array
<
OneD
,
NekDouble
>
tmp
(
nGlobDofs
);
if
(
dirForcCalculated
)
{
Vmath
::
Vsub
(
nGlobDofs
,
pInput
.
get
(),
1
,
...
...
@@ -130,23 +130,25 @@ namespace Nektar
int
nLocDofs
=
pLocToGloMap
->
GetNumLocalCoeffs
();
m_expList
.
lock
()
->
GeneralMatrixOp
(
m_linSysKey
,
pOutput
,
tmp
,
eGlobal
);
m_linSysKey
,
pOutput
,
tmp
,
eGlobal
);
Vmath
::
Vsub
(
nGlobDofs
,
pInput
.
get
(),
1
,
tmp
.
get
(),
1
,
tmp
.
get
(),
1
);
pInput
.
get
(),
1
,
tmp
.
get
(),
1
,
tmp
.
get
(),
1
);
}
Array
<
OneD
,
NekDouble
>
offsetarray
;
SolveLinearSystem
(
nGlobDofs
,
tmp
+
nDirDofs
,
offsetarray
=
pOutput
+
nDirDofs
,
pLocToGloMap
,
nDirDofs
);
tmp2
=
tmp
+
nDirDofs
,
pLocToGloMap
,
nDirDofs
);
}
else
{
SolveLinearSystem
(
pLocToGloMap
->
GetNumGlobalCoeffs
(),
pInput
,
pOutput
,
pLocToGloMap
);
Vmath
::
Vcopy
(
nGlobDofs
,
pInput
,
1
,
tmp
,
1
);
SolveLinearSystem
(
nDirDofs
,
tmp
,
tmp
,
pLocToGloMap
);
}
Vmath
::
Vadd
(
nGlobDofs
,
tmp
+
nDirDofs
,
1
,
pOutput
+
nDirDofs
,
1
,
tmp2
=
pOutput
+
nDirDofs
,
1
);
}
...
...
library/MultiRegions/GlobalLinSysIterativeFull.cpp
View file @
b5068a8f
...
...
@@ -128,37 +128,36 @@ namespace Nektar
int
nDirDofs
=
pLocToGloMap
->
GetNumGlobalDirBndCoeffs
();
int
nGlobDofs
=
pLocToGloMap
->
GetNumGlobalCoeffs
();
int
nLocDofs
=
pLocToGloMap
->
GetNumLocalCoeffs
();
int
nDirTotal
=
nDirDofs
;
expList
->
GetComm
()
->
AllReduce
(
nDirTotal
,
LibUtilities
::
ReduceSum
);
Array
<
OneD
,
NekDouble
>
tmp
(
nGlobDofs
);
if
(
nDirTotal
)
{
// calculate the Dirichlet forcing
Array
<
OneD
,
NekDouble
>
global_tmp
(
nGlobDofs
);
Array
<
OneD
,
NekDouble
>
offsetarray
;
if
(
dirForcCalculated
)
{
Vmath
::
Vsub
(
nGlobDofs
,
pInput
.
get
(),
1
,
pDirForcing
.
get
(),
1
,
global_
tmp
.
get
(),
1
);
tmp
.
get
(),
1
);
}
else
{
// Calculate the dirichlet forcing B_b (== X_b) and
// substract it from the rhs
expList
->
GeneralMatrixOp
(
m_linSysKey
,
pOutput
,
global_tmp
,
eGlobal
);
m_linSysKey
,
pOutput
,
tmp
,
eGlobal
);
Vmath
::
Vsub
(
nGlobDofs
,
pInput
.
get
(),
1
,
global_
tmp
.
get
(),
1
,
global_
tmp
.
get
(),
1
);
Vmath
::
Vsub
(
nGlobDofs
,
pInput
.
get
(),
1
,
tmp
.
get
(),
1
,
tmp
.
get
(),
1
);
}
if
(
vCG
)
{
SolveLinearSystem
(
nGlobDofs
,
global_tmp
,
pOutput
,
pLocToGloMap
,
nDirDofs
);
SolveLinearSystem
(
nGlobDofs
,
tmp
,
tmp
,
pLocToGloMap
,
nDirDofs
);
}
else
{
...
...
@@ -167,8 +166,12 @@ namespace Nektar
}
else
{
SolveLinearSystem
(
nGlobDofs
,
pInput
,
pOutput
,
pLocToGloMap
);
SolveLinearSystem
(
nGlobDofs
,
tmp
,
tmp
,
pLocToGloMap
);
}
Array
<
OneD
,
NekDouble
>
tmp2
=
pOutput
+
nDirDofs
;
Vmath
::
Vadd
(
nGlobDofs
-
nDirDofs
,
tmp
+
nDirDofs
,
1
,
tmp2
,
1
,
tmp2
,
1
);
}
...
...
library/MultiRegions/GlobalLinSysXxtStaticCond.cpp
View file @
b5068a8f
...
...
@@ -185,8 +185,7 @@ namespace Nektar
if
(
nGlobHomBndDofs
)
{
// construct boundary forcing
if
(
nIntDofs
&&
((
nDirBndDofs
)
&&
(
!
dirForcCalculated
)
&&
(
atLastLevel
))
)
if
(
nIntDofs
&&
((
!
dirForcCalculated
)
&&
(
atLastLevel
))
)
{
//include dirichlet boundary forcing
DNekScalBlkMat
&
BinvD
=
*
m_BinvD
;
...
...
@@ -194,8 +193,7 @@ namespace Nektar
pLocToGloMap
->
GlobalToLocalBnd
(
V_GlobBnd
,
V_LocBnd
);
V_LocBnd
=
BinvD
*
F_Int
+
SchurCompl
*
V_LocBnd
;
}
else
if
((
nDirBndDofs
)
&&
(
!
dirForcCalculated
)
&&
(
atLastLevel
))
else
if
((
!
dirForcCalculated
)
&&
(
atLastLevel
))
{
//include dirichlet boundary forcing
DNekScalBlkMat
&
SchurCompl
=
*
m_schurCompl
;
...
...
Write
Preview
Supports
Markdown
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