Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Nektar
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
45
Issues
45
List
Board
Labels
Milestones
Merge Requests
20
Merge Requests
20
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Nektar
Nektar
Commits
c4b9406c
Commit
c4b9406c
authored
Mar 26, 2018
by
David Moxey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to use external interface
parent
3f5ff6f0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
97 additions
and
146 deletions
+97
-146
EquationSystem.cpp
library/SolverUtils/EquationSystem.cpp
+0
-27
EquationSystem.h
library/SolverUtils/EquationSystem.h
+0
-69
FilterAeroForces.cpp
library/SolverUtils/Filters/FilterAeroForces.cpp
+7
-3
FilterEnergy.cpp
library/SolverUtils/Filters/FilterEnergy.cpp
+9
-5
FilterInterfaces.hpp
library/SolverUtils/Filters/FilterInterfaces.hpp
+35
-0
CompressibleFlowSystem.cpp
...ibleFlowSolver/EquationSystems/CompressibleFlowSystem.cpp
+3
-3
CompressibleFlowSystem.h
...ssibleFlowSolver/EquationSystems/CompressibleFlowSystem.h
+20
-18
IncNavierStokes.cpp
...IncNavierStokesSolver/EquationSystems/IncNavierStokes.cpp
+3
-3
IncNavierStokes.h
...s/IncNavierStokesSolver/EquationSystems/IncNavierStokes.h
+20
-18
No files found.
library/SolverUtils/EquationSystem.cpp
View file @
c4b9406c
...
...
@@ -1470,33 +1470,6 @@ namespace Nektar
return
null
;
}
void
EquationSystem
::
v_GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
)
{
ASSERTL0
(
false
,
"This function is not valid for the Base class"
);
}
void
EquationSystem
::
v_GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
)
{
ASSERTL0
(
false
,
"This function is not valid for the Base class"
);
}
bool
EquationSystem
::
v_HasConstantDensity
()
{
ASSERTL0
(
false
,
"This function is not valid for the Base class"
);
return
false
;
}
void
EquationSystem
::
v_GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
)
{
ASSERTL0
(
false
,
"This function is not valid for the Base class"
);
}
void
EquationSystem
::
v_ExtraFldOutput
(
std
::
vector
<
Array
<
OneD
,
NekDouble
>
>
&
fieldcoeffs
,
std
::
vector
<
std
::
string
>
&
variables
)
...
...
library/SolverUtils/EquationSystem.h
View file @
c4b9406c
...
...
@@ -130,23 +130,6 @@ class Interpolator;
/// Get pressure field if available
SOLVER_UTILS_EXPORT
MultiRegions
::
ExpListSharedPtr
GetPressure
();
/// Extract array with pressure from physfield
SOLVER_UTILS_EXPORT
void
GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
);
/// Extract array with density from physfield
SOLVER_UTILS_EXPORT
void
GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
);
SOLVER_UTILS_EXPORT
bool
HasConstantDensity
();
/// Extract array with velocity from physfield
SOLVER_UTILS_EXPORT
void
GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
);
SOLVER_UTILS_EXPORT
inline
void
ExtraFldOutput
(
std
::
vector
<
Array
<
OneD
,
NekDouble
>
>
&
fieldcoeffs
,
std
::
vector
<
std
::
string
>
&
variables
);
...
...
@@ -484,23 +467,6 @@ class Interpolator;
// Get pressure field if available
SOLVER_UTILS_EXPORT
virtual
MultiRegions
::
ExpListSharedPtr
v_GetPressure
(
void
);
// Extract array with pressure from physfield
SOLVER_UTILS_EXPORT
virtual
void
v_GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
);
// Extract array with density from physfield
SOLVER_UTILS_EXPORT
virtual
void
v_GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
);
SOLVER_UTILS_EXPORT
virtual
bool
v_HasConstantDensity
();
// Extract array with velocity from physfield
SOLVER_UTILS_EXPORT
virtual
void
v_GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
);
SOLVER_UTILS_EXPORT
virtual
void
v_ExtraFldOutput
(
std
::
vector
<
Array
<
OneD
,
NekDouble
>
>
&
fieldcoeffs
,
std
::
vector
<
std
::
string
>
&
variables
);
...
...
@@ -607,41 +573,6 @@ class Interpolator;
}
/**
* Extract array with pressure from physfield
*/
inline
void
EquationSystem
::
GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
)
{
v_GetPressure
(
physfield
,
pressure
);
}
/**
* Extract array with density from physfield
*/
inline
void
EquationSystem
::
GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
)
{
v_GetDensity
(
physfield
,
density
);
}
inline
bool
EquationSystem
::
HasConstantDensity
()
{
return
v_HasConstantDensity
();
}
/**
* Extract array with velocity from physfield
*/
inline
void
EquationSystem
::
GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
)
{
v_GetVelocity
(
physfield
,
velocity
);
}
/**
* Append the coefficients and name of variables with solver specific
* extra variables
*
...
...
library/SolverUtils/Filters/FilterAeroForces.cpp
View file @
c4b9406c
...
...
@@ -43,6 +43,7 @@
#include <MultiRegions/ExpList3D.h>
#include <MultiRegions/ExpList3DHomogeneous1D.h>
#include <SolverUtils/Filters/FilterAeroForces.h>
#include <SolverUtils/Filters/FilterInterfaces.hpp>
#include <LibUtilities/BasicUtils/ParseUtils.h>
using
namespace
std
;
...
...
@@ -589,6 +590,9 @@ void FilterAeroForces::CalculateForces(
auto
equ
=
m_equ
.
lock
();
ASSERTL0
(
equ
,
"Weak pointer expired"
);
auto
fluidEqu
=
std
::
dynamic_pointer_cast
<
FluidInterface
>
(
equ
);
ASSERTL0
(
fluidEqu
,
"Aero forces filter is incompatible with this solver."
);
int
i
,
j
,
k
,
n
,
cnt
,
elmtid
,
nq
,
offset
,
boundary
,
plane
;
// Get number of quadrature points and dimensions
int
physTot
=
pFields
[
0
]
->
GetNpoints
();
...
...
@@ -720,8 +724,8 @@ void FilterAeroForces::CalculateForces(
velocity
[
n
]
=
Array
<
OneD
,
NekDouble
>
(
fields
[
n
]
->
GetTotPoints
());
}
pressure
=
Array
<
OneD
,
NekDouble
>
(
fields
[
0
]
->
GetTotPoints
());
e
qu
->
GetVelocity
(
physfields
,
velocity
);
e
qu
->
GetPressure
(
physfields
,
pressure
);
fluidE
qu
->
GetVelocity
(
physfields
,
velocity
);
fluidE
qu
->
GetPressure
(
physfields
,
pressure
);
//Loop all the Boundary Regions
for
(
cnt
=
n
=
0
;
n
<
BndConds
.
num_elements
();
n
++
)
...
...
@@ -857,7 +861,7 @@ void FilterAeroForces::CalculateForces(
fv
[
j
],
1
,
fv
[
j
],
1
);
}
if
(
!
e
qu
->
HasConstantDensity
())
if
(
!
fluidE
qu
->
HasConstantDensity
())
{
// Add gradient term
Vmath
::
Vvtvp
(
nbc
,
div
,
1
,
...
...
library/SolverUtils/Filters/FilterEnergy.cpp
View file @
c4b9406c
...
...
@@ -36,6 +36,7 @@
#include <iomanip>
#include <SolverUtils/Filters/FilterEnergy.h>
#include <SolverUtils/Filters/FilterInterfaces.hpp>
using
namespace
std
;
...
...
@@ -48,7 +49,7 @@ std::string FilterEnergy::className = SolverUtils::GetFilterFactory().
FilterEnergy
::
FilterEnergy
(
const
LibUtilities
::
SessionReaderSharedPtr
&
pSession
,
const
std
::
weak_ptr
<
EquationSystem
>
&
pEquation
,
const
std
::
weak_ptr
<
EquationSystem
>
&
pEquation
,
const
ParamMap
&
pParams
)
:
Filter
(
pSession
,
pEquation
),
m_index
(
-
1
),
...
...
@@ -153,6 +154,9 @@ void FilterEnergy::v_Update(
auto
equ
=
m_equ
.
lock
();
ASSERTL0
(
equ
,
"Weak pointer expired"
);
auto
fluidEqu
=
std
::
dynamic_pointer_cast
<
FluidInterface
>
(
equ
);
ASSERTL0
(
fluidEqu
,
"Energy filter is incompatible with this solver."
);
// Store physical values in an array
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
physfields
(
pFields
.
num_elements
());
for
(
i
=
0
;
i
<
pFields
.
num_elements
();
++
i
)
...
...
@@ -169,7 +173,7 @@ void FilterEnergy::v_Update(
{
u
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nPoints
);
}
e
qu
->
GetVelocity
(
physfields
,
u
);
fluidE
qu
->
GetVelocity
(
physfields
,
u
);
for
(
i
=
0
;
i
<
3
;
++
i
)
{
...
...
@@ -181,10 +185,10 @@ void FilterEnergy::v_Update(
Vmath
::
Vvtvp
(
nPoints
,
u
[
i
],
1
,
u
[
i
],
1
,
tmp
,
1
,
tmp
,
1
);
}
if
(
!
e
qu
->
HasConstantDensity
())
if
(
!
fluidE
qu
->
HasConstantDensity
())
{
density
=
Array
<
OneD
,
NekDouble
>
(
nPoints
);
e
qu
->
GetDensity
(
physfields
,
density
);
fluidE
qu
->
GetDensity
(
physfields
,
density
);
Vmath
::
Vmul
(
nPoints
,
density
,
1
,
tmp
,
1
,
tmp
,
1
);
}
...
...
@@ -234,7 +238,7 @@ void FilterEnergy::v_Update(
Vmath
::
Vvtvp
(
nPoints
,
tmp2
,
1
,
tmp2
,
1
,
tmp
,
1
,
tmp
,
1
);
}
if
(
!
e
qu
->
HasConstantDensity
())
if
(
!
fluidE
qu
->
HasConstantDensity
())
{
Vmath
::
Vmul
(
nPoints
,
density
,
1
,
tmp
,
1
,
tmp
,
1
);
}
...
...
library/SolverUtils/Filters/FilterInterfaces.hpp
0 → 100644
View file @
c4b9406c
#ifndef NEKTAR_SOLVERUTILS_FILTERS_FILTERINTERFACES_HPP
#define NEKTAR_SOLVERUTILS_FILTERS_FILTERINTERFACES_HPP
#include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace
Nektar
{
namespace
SolverUtils
{
class
FluidInterface
{
public
:
/// Extract array with velocity from physfield
SOLVER_UTILS_EXPORT
virtual
void
GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
)
=
0
;
SOLVER_UTILS_EXPORT
virtual
bool
HasConstantDensity
()
=
0
;
/// Extract array with density from physfield
SOLVER_UTILS_EXPORT
virtual
void
GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
)
=
0
;
/// Extract array with pressure from physfield
SOLVER_UTILS_EXPORT
virtual
void
GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
)
=
0
;
};
}
}
#endif
solvers/CompressibleFlowSolver/EquationSystems/CompressibleFlowSystem.cpp
View file @
c4b9406c
...
...
@@ -894,7 +894,7 @@ namespace Nektar
/**
*
*/
void
CompressibleFlowSystem
::
v_
GetPressure
(
void
CompressibleFlowSystem
::
GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
)
{
...
...
@@ -904,7 +904,7 @@ namespace Nektar
/**
*
*/
void
CompressibleFlowSystem
::
v_
GetDensity
(
void
CompressibleFlowSystem
::
GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
)
{
...
...
@@ -914,7 +914,7 @@ namespace Nektar
/**
*
*/
void
CompressibleFlowSystem
::
v_
GetVelocity
(
void
CompressibleFlowSystem
::
GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
)
{
...
...
solvers/CompressibleFlowSolver/EquationSystems/CompressibleFlowSystem.h
View file @
c4b9406c
...
...
@@ -45,13 +45,15 @@
#include <SolverUtils/AdvectionSystem.h>
#include <SolverUtils/Diffusion/Diffusion.h>
#include <SolverUtils/Forcing/Forcing.h>
#include <SolverUtils/Filters/FilterInterfaces.hpp>
namespace
Nektar
{
/**
*
*/
class
CompressibleFlowSystem
:
public
SolverUtils
::
AdvectionSystem
class
CompressibleFlowSystem
:
public
SolverUtils
::
AdvectionSystem
,
public
SolverUtils
::
FluidInterface
{
public
:
...
...
@@ -67,6 +69,23 @@ namespace Nektar
Array
<
OneD
,
NekDouble
>
GetStabilityLimitVector
(
const
Array
<
OneD
,
int
>
&
ExpOrder
);
virtual
void
GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
);
virtual
void
GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
);
virtual
bool
HasConstantDensity
()
{
return
false
;
}
virtual
void
GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
);
protected
:
SolverUtils
::
DiffusionSharedPtr
m_diffusion
;
ArtificialDiffusionSharedPtr
m_artificialDiffusion
;
...
...
@@ -174,23 +193,6 @@ namespace Nektar
// Do nothing by default
}
virtual
void
v_GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
);
virtual
void
v_GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
);
virtual
bool
v_HasConstantDensity
()
{
return
false
;
}
virtual
void
v_GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
);
virtual
Array
<
OneD
,
NekDouble
>
v_GetMaxStdVelocity
();
};
...
...
solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.cpp
View file @
c4b9406c
...
...
@@ -806,7 +806,7 @@ namespace Nektar
/**
*
*/
void
IncNavierStokes
::
v_
GetPressure
(
void
IncNavierStokes
::
GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
)
{
...
...
@@ -816,7 +816,7 @@ namespace Nektar
/**
*
*/
void
IncNavierStokes
::
v_
GetDensity
(
void
IncNavierStokes
::
GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
)
{
...
...
@@ -827,7 +827,7 @@ namespace Nektar
/**
*
*/
void
IncNavierStokes
::
v_
GetVelocity
(
void
IncNavierStokes
::
GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
)
{
...
...
solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.h
View file @
c4b9406c
...
...
@@ -42,6 +42,7 @@
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <IncNavierStokesSolver/EquationSystems/Extrapolate.h>
#include <SolverUtils/Forcing/Forcing.h>
#include <SolverUtils/Filters/FilterInterfaces.hpp>
namespace
Nektar
{
...
...
@@ -127,7 +128,8 @@ namespace Nektar
* \brief This class is the base class for Navier Stokes problems
*
*/
class
IncNavierStokes
:
public
SolverUtils
::
AdvectionSystem
class
IncNavierStokes
:
public
SolverUtils
::
AdvectionSystem
,
public
SolverUtils
::
FluidInterface
{
public
:
// Destructor
...
...
@@ -147,6 +149,23 @@ namespace Nektar
void
AddForcing
(
const
SolverUtils
::
ForcingSharedPtr
&
pForce
);
virtual
void
GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
);
virtual
void
GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
);
virtual
bool
HasConstantDensity
()
{
return
true
;
}
virtual
void
GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
);
protected
:
// pointer to the extrapolation class for sub-stepping and HOPBS
...
...
@@ -227,23 +246,6 @@ namespace Nektar
return
m_pressure
;
}
virtual
void
v_GetPressure
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
pressure
);
virtual
void
v_GetDensity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
NekDouble
>
&
density
);
virtual
bool
v_HasConstantDensity
()
{
return
true
;
}
virtual
void
v_GetVelocity
(
const
Array
<
OneD
,
const
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
velocity
);
virtual
void
v_TransCoeffToPhys
(
void
)
{
ASSERTL0
(
false
,
"This method is not defined in this class"
);
...
...
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