Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Julia Docampo Sanchez
Nektar
Commits
a990d43c
Commit
a990d43c
authored
Jul 11, 2017
by
Kilian Lackhove
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interppointdatatofld: support for frompts being a csv file
parent
4402bb95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
library/FieldUtils/ProcessModules/ProcessInterpPointDataToFld.cpp
...FieldUtils/ProcessModules/ProcessInterpPointDataToFld.cpp
+21
-5
library/FieldUtils/ProcessModules/ProcessInterpPoints.cpp
library/FieldUtils/ProcessModules/ProcessInterpPoints.cpp
+2
-1
No files found.
library/FieldUtils/ProcessModules/ProcessInterpPointDataToFld.cpp
View file @
a990d43c
...
...
@@ -45,6 +45,8 @@ using namespace std;
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <LibUtilities/BasicUtils/CsvIO.h>
#include <boost/math/special_functions/fpclassify.hpp>
namespace
bg
=
boost
::
geometry
;
...
...
@@ -84,11 +86,25 @@ void ProcessInterpPointDataToFld::Process(po::variables_map &vm)
ASSERTL0
(
m_config
[
"frompts"
].
as
<
string
>
().
compare
(
"NotSet"
)
!=
0
,
"ProcessInterpPointDataToFld requires frompts parameter"
);
string
inFile
=
m_config
[
"frompts"
].
as
<
string
>
().
c_str
();
LibUtilities
::
CommSharedPtr
c
=
LibUtilities
::
GetCommFactory
().
CreateInstance
(
"Serial"
,
0
,
0
);
LibUtilities
::
PtsIOSharedPtr
ptsIO
=
MemoryManager
<
LibUtilities
::
PtsIO
>::
AllocateSharedPtr
(
c
);
ptsIO
->
Import
(
inFile
,
fieldPts
);
if
(
boost
::
filesystem
::
path
(
inFile
).
extension
()
==
".pts"
)
{
LibUtilities
::
PtsIOSharedPtr
ptsIO
=
MemoryManager
<
LibUtilities
::
PtsIO
>::
AllocateSharedPtr
(
m_f
->
m_comm
);
ptsIO
->
Import
(
inFile
,
fieldPts
);
}
else
if
(
boost
::
filesystem
::
path
(
inFile
).
extension
()
==
".csv"
)
{
LibUtilities
::
CsvIOSharedPtr
csvIO
=
MemoryManager
<
LibUtilities
::
CsvIO
>::
AllocateSharedPtr
(
m_f
->
m_comm
);
csvIO
->
Import
(
inFile
,
fieldPts
);
}
else
{
ASSERTL0
(
false
,
"unknown frompts file type"
);
}
int
nFields
=
fieldPts
->
GetNFields
();
ASSERTL0
(
nFields
>
0
,
"No field values provided in input"
);
...
...
library/FieldUtils/ProcessModules/ProcessInterpPoints.cpp
View file @
a990d43c
...
...
@@ -126,6 +126,7 @@ void ProcessInterpPoints::Process(po::variables_map &vm)
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
pts
;
m_f
->
m_fieldPts
->
GetPts
(
pts
);
rng
->
m_checkShape
=
false
;
rng
->
m_zmin
=
-
1
;
rng
->
m_zmax
=
1
;
...
...
@@ -245,7 +246,7 @@ void ProcessInterpPoints::CreateFieldPts(po::variables_map &vm)
}
else
{
ASSERTL0
(
false
,
"
no input
file
found
"
);
ASSERTL0
(
false
,
"
unknown topts
file
type
"
);
}
}
...
...
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