Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Nektar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Ronald
Nektar
Commits
d677ec7e
Commit
d677ec7e
authored
Apr 27, 2016
by
Douglas Serson
Committed by
Chris Cantwell
May 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert HistoryPoints to phys space in 3DH1D
(cherry picked from commit
3b75a72e
)
parent
53933b5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
21 deletions
+71
-21
library/SolverUtils/Filters/FilterHistoryPoints.cpp
library/SolverUtils/Filters/FilterHistoryPoints.cpp
+70
-20
library/SolverUtils/Filters/FilterHistoryPoints.h
library/SolverUtils/Filters/FilterHistoryPoints.h
+1
-1
No files found.
library/SolverUtils/Filters/FilterHistoryPoints.cpp
View file @
d677ec7e
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <iomanip>
#include <iomanip>
#include <SolverUtils/Filters/FilterHistoryPoints.h>
#include <SolverUtils/Filters/FilterHistoryPoints.h>
#include <MultiRegions/ExpList3DHomogeneous1D.h>
#include <boost/format.hpp>
#include <boost/format.hpp>
...
@@ -193,7 +194,7 @@ void FilterHistoryPoints::v_Initialise(
...
@@ -193,7 +194,7 @@ void FilterHistoryPoints::v_Initialise(
// Determine the unique process responsible for each history point
// Determine the unique process responsible for each history point
// For points on a partition boundary, must select a single process
// For points on a partition boundary, must select a single process
LibUtilities
::
CommSharedPtr
vComm
=
pFields
[
0
]
->
GetComm
();
LibUtilities
::
CommSharedPtr
vComm
=
pFields
[
0
]
->
GetComm
();
int
vRank
=
vComm
->
GetRank
();
int
vRank
=
vComm
->
GetR
owComm
()
->
GetR
ank
();
int
vHP
=
m_historyPoints
.
size
();
int
vHP
=
m_historyPoints
.
size
();
Array
<
OneD
,
int
>
procList
(
vHP
,
-
1
);
Array
<
OneD
,
int
>
procList
(
vHP
,
-
1
);
Array
<
OneD
,
int
>
idList
(
vHP
,
-
1
);
Array
<
OneD
,
int
>
idList
(
vHP
,
-
1
);
...
@@ -254,6 +255,7 @@ void FilterHistoryPoints::v_Initialise(
...
@@ -254,6 +255,7 @@ void FilterHistoryPoints::v_Initialise(
// If multiple processes find they are the nearest (e.g. point lies
// If multiple processes find they are the nearest (e.g. point lies
// on a partition boundary, we will choose the process of highest
// on a partition boundary, we will choose the process of highest
// rank.
// rank.
m_planeIDs
=
Array
<
OneD
,
int
>
(
planeIDs
.
size
(),
-
1
);
for
(
i
=
0
;
i
<
vHP
;
++
i
)
for
(
i
=
0
;
i
<
vHP
;
++
i
)
{
{
if
(
dist_loc
[
i
]
==
dist
[
i
])
if
(
dist_loc
[
i
]
==
dist
[
i
])
...
@@ -271,6 +273,7 @@ void FilterHistoryPoints::v_Initialise(
...
@@ -271,6 +273,7 @@ void FilterHistoryPoints::v_Initialise(
// process ID
// process ID
if
(
idList
[
i
]
!=
-
1
)
if
(
idList
[
i
]
!=
-
1
)
{
{
procList
[
i
]
=
vRank
;
if
(
m_isHomogeneous1D
)
if
(
m_isHomogeneous1D
)
{
{
int
j
;
int
j
;
...
@@ -286,14 +289,9 @@ void FilterHistoryPoints::v_Initialise(
...
@@ -286,14 +289,9 @@ void FilterHistoryPoints::v_Initialise(
if
(
j
!=
IDs
.
num_elements
())
if
(
j
!=
IDs
.
num_elements
())
{
{
planeIDs
[
i
]
=
j
;
m_planeIDs
[
i
]
=
j
;
procList
[
i
]
=
vRank
;
}
}
}
}
else
{
procList
[
i
]
=
vRank
;
}
}
}
}
}
...
@@ -317,10 +315,6 @@ void FilterHistoryPoints::v_Initialise(
...
@@ -317,10 +315,6 @@ void FilterHistoryPoints::v_Initialise(
// local list of history points.
// local list of history points.
if
(
idList
[
i
]
!=
-
1
)
if
(
idList
[
i
]
!=
-
1
)
{
{
if
(
m_isHomogeneous1D
)
{
m_planeIDs
.
push_back
(
planeIDs
[
i
]);
}
m_historyLocalPointMap
[
m_historyList
.
size
()]
=
i
;
m_historyLocalPointMap
[
m_historyList
.
size
()]
=
i
;
m_historyList
.
push_back
(
m_historyList
.
push_back
(
std
::
pair
<
SpatialDomains
::
PointGeomSharedPtr
,
std
::
pair
<
SpatialDomains
::
PointGeomSharedPtr
,
...
@@ -394,7 +388,7 @@ void FilterHistoryPoints::v_Initialise(
...
@@ -394,7 +388,7 @@ void FilterHistoryPoints::v_Initialise(
if
(
m_isHomogeneous1D
)
if
(
m_isHomogeneous1D
)
{
{
m_outputStream
<<
"# (in Wavespace)"
<<
endl
;
//
m_outputStream << "# (in Wavespace)" << endl;
}
}
}
}
v_Update
(
pFields
,
time
);
v_Update
(
pFields
,
time
);
...
@@ -434,18 +428,74 @@ void FilterHistoryPoints::v_Update(const Array<OneD, const MultiRegions::ExpList
...
@@ -434,18 +428,74 @@ void FilterHistoryPoints::v_Update(const Array<OneD, const MultiRegions::ExpList
{
{
locCoord
=
(
*
x
).
second
;
locCoord
=
(
*
x
).
second
;
expId
=
(
*
x
).
first
->
GetVid
();
expId
=
(
*
x
).
first
->
GetVid
();
NekDouble
value
;
physvals
=
pFields
[
j
]
->
GetPlane
(
m_planeIDs
[
k
])
->
UpdatePhys
()
+
pFields
[
j
]
->
GetPhys_Offset
(
expId
);
int
plane
=
m_planeIDs
[
m_historyLocalPointMap
[
k
]];
if
(
pFields
[
j
]
->
GetWaveSpace
()
==
false
&&
plane
!=
-
1
)
// transform elemental data if required.
if
(
pFields
[
j
]
->
GetPhysState
()
==
false
)
{
{
pFields
[
j
]
->
GetPlane
(
m_planeIDs
[
k
])
->
GetExp
(
expId
)
->
BwdTrans
(
pFields
[
j
]
->
GetPlane
(
m_planeIDs
[
k
])
->
GetCoeffs
()
+
pFields
[
j
]
->
GetCoeff_Offset
(
expId
),
physvals
);
physvals
=
pFields
[
j
]
->
GetPlane
(
plane
)
->
UpdatePhys
()
+
pFields
[
j
]
->
GetPhys_Offset
(
expId
);
// transform elemental data if required.
if
(
pFields
[
j
]
->
GetPhysState
()
==
false
)
{
pFields
[
j
]
->
GetPlane
(
plane
)
->
GetExp
(
expId
)
->
BwdTrans
(
pFields
[
j
]
->
GetPlane
(
plane
)
->
GetCoeffs
()
+
pFields
[
j
]
->
GetCoeff_Offset
(
expId
),
physvals
);
}
// Interpolate data
value
=
pFields
[
j
]
->
GetPlane
(
plane
)
->
GetExp
(
expId
)
->
StdPhysEvaluate
(
locCoord
,
physvals
);
}
}
else
{
// Create vector with eIDs across all planes
std
::
vector
<
unsigned
int
>
eIDs
;
int
nPlanes
=
pFields
[
j
]
->
GetZIDs
().
num_elements
();
int
elmtsPerPlane
=
pFields
[
j
]
->
GetExpSize
()
/
nPlanes
;
// interpolate point can do with zero plane methods
for
(
int
n
=
0
;
n
<
nPlanes
;
n
++
)
data
[
m_historyLocalPointMap
[
k
]
*
numFields
+
j
]
=
pFields
[
j
]
->
GetExp
(
expId
)
->
StdPhysEvaluate
(
locCoord
,
physvals
);
{
eIDs
.
push_back
(
expId
+
n
*
elmtsPerPlane
);
}
// Create new 3DH1D expansion with one element per plane
MultiRegions
::
ExpList3DHomogeneous1DSharedPtr
tmp
=
boost
::
dynamic_pointer_cast
<
MultiRegions
::
ExpList3DHomogeneous1D
>
(
pFields
[
j
]);
ASSERTL0
(
tmp
,
"Failed to type cast expansion"
);
MultiRegions
::
ExpList3DHomogeneous1DSharedPtr
exp
=
MemoryManager
<
MultiRegions
::
ExpList3DHomogeneous1D
>::
AllocateSharedPtr
(
*
tmp
,
eIDs
);
// Fill phys array of new expansion and apply HomoBwdTrans
for
(
int
n
=
0
;
n
<
nPlanes
;
n
++
)
{
int
nq
=
exp
->
GetPlane
(
0
)
->
GetTotPoints
();
Array
<
OneD
,
NekDouble
>
fromPhys
=
pFields
[
j
]
->
GetPlane
(
n
)
->
GetPhys
()
+
pFields
[
j
]
->
GetPhys_Offset
(
expId
);
Array
<
OneD
,
NekDouble
>
toPhys
=
exp
->
GetPlane
(
n
)
->
UpdatePhys
();
Vmath
::
Vcopy
(
nq
,
fromPhys
,
1
,
toPhys
,
1
);
}
exp
->
HomogeneousBwdTrans
(
exp
->
GetPhys
(),
exp
->
UpdatePhys
());
// Interpolate data
if
(
plane
!=
-
1
)
{
physvals
=
exp
->
GetPlane
(
plane
)
->
UpdatePhys
();
value
=
exp
->
GetPlane
(
plane
)
->
GetExp
(
0
)
->
StdPhysEvaluate
(
locCoord
,
physvals
);
}
}
// store data
if
(
plane
!=
-
1
)
{
data
[
m_historyLocalPointMap
[
k
]
*
numFields
+
j
]
=
value
;
}
}
}
}
}
else
else
...
...
library/SolverUtils/Filters/FilterHistoryPoints.h
View file @
d677ec7e
...
@@ -82,7 +82,7 @@ class FilterHistoryPoints : public Filter
...
@@ -82,7 +82,7 @@ class FilterHistoryPoints : public Filter
unsigned
int
m_outputFrequency
;
unsigned
int
m_outputFrequency
;
/// plane to take history point from if using a homogeneous1D expansion
/// plane to take history point from if using a homogeneous1D expansion
unsigned
int
m_outputPlane
;
unsigned
int
m_outputPlane
;
std
::
vector
<
unsigned
int
>
m_planeIDs
;
Array
<
OneD
,
int
>
m_planeIDs
;
bool
m_isHomogeneous1D
;
bool
m_isHomogeneous1D
;
std
::
string
m_outputFile
;
std
::
string
m_outputFile
;
std
::
ofstream
m_outputStream
;
std
::
ofstream
m_outputStream
;
...
...
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