Commit 92d1d0de authored by Michael Turner's avatar Michael Turner

Merge remote-tracking branch 'upstream/master' into feature/geo-curves

parents c020efd7 7ca455c4
......@@ -8,6 +8,11 @@ v5.0.0
expansion in pyramids (!750)
- Significant overhaul of CMake infrastructure (!770, !804)
- Fix ThridpartyCCM options (!802)
- Fix Windows CRLF tokens in GEO reader and improve comment handling (!805)
- Use chrono in Timer (!807)
- Fix caching of FUNCTION tags that read from file and provide the same
functionality in FUNCTIONs defined for forcings (!759)
- Added native support for csv files in addititon to pts (!760)
**NekMesh**:
- Add feature to read basic 2D geo files as CAD (!731)
......@@ -23,6 +28,8 @@ v5.0.0
**FieldConvert**:
- Add input module for Semtex field files (!777)
- Fixed interppoints module (!760)
- Move StreamFunction utility to a FieldConvert module (!809)
**Documentation**:
- Added the developer-guide repository as a submodule (!751)
......@@ -35,6 +42,12 @@ v4.4.2
**Library**
- Fix ability to set default implementation in Collections and added an option
to set eNoCollections in FieldConvert as default (!789)
- Fix performance issue in ProcessIsoContour in relation to memory consumption
(!821)
- Fix performance issue with ExtractPhysToBndElmt (!796)
**Utilities**
- Fix vtkToFld missing dependency which prevented compiling with VTK 7.1 (!808)
v4.4.1
------
......
......@@ -10,7 +10,7 @@
MESSAGE(STATUS "Searching for Boost:")
SET(MIN_VER "1.56.0")
SET(NEEDED_BOOST_LIBS thread iostreams date_time filesystem system
program_options regex timer chrono)
program_options regex)
SET(Boost_DEBUG 0)
SET(Boost_NO_BOOST_CMAKE ON)
IF( BOOST_ROOT )
......
......@@ -60,8 +60,9 @@ IF (NEKTAR_USE_FFTW)
# Test if FFTW path is a system path. Only add to include path if not an
# implicitly defined CXX include path (due to GCC 6.x now providing its own
# version of some C header files and -isystem reorders include paths).
GET_FILENAME_COMPONENT(X ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ABSOLUTE)
GET_FILENAME_COMPONENT(X "${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}" ABSOLUTE)
GET_FILENAME_COMPONENT(Y ${FFTW_INCLUDE_DIR} ABSOLUTE)
IF (NOT Y MATCHES ".*${X}.*")
INCLUDE_DIRECTORIES(SYSTEM ${FFTW_INCLUDE_DIR})
ENDIF()
......
......@@ -475,3 +475,34 @@ volume = {163},
year = {2016}
}
@article{rospjo16,
title={Eigensolution analysis of spectral/hp continuous Galerkin approximations to advection--diffusion problems: Insights into spectral vanishing viscosity},
author={Moura, RC and Sherwin, SJ and Peir{\'o}, Joaquim},
journal={Journal of Computational Physics},
volume={307},
pages={401--422},
year={2016},
publisher={Elsevier}
}
@article{yvsiouei93,
title={Legendre pseudospectral viscosity method for nonlinear conservation laws},
author={Maday, Yvon and Kaber, Sidi M Ould and Tadmor, Eitan},
journal={SIAM Journal on Numerical Analysis},
volume={30},
number={2},
pages={321--342},
year={1993},
publisher={SIAM}
}
@article{rosh06,
title={Stabilisation of spectral/hp element methods through spectral vanishing viscosity: Application to fluid mechanics modelling},
author={Kirby, Robert M and Sherwin, Spencer J},
journal={Computer methods in applied mechanics and engineering},
volume={195},
number={23},
pages={3128--3144},
year={2006},
publisher={Elsevier}
}
\ No newline at end of file
......@@ -221,7 +221,7 @@ to screen;
\item \inltt{TInf} farfield temperature (i.e. $T_{\infty}$). Default value = 288.15 $K$;
\item \inltt{Twall} temperature at the wall when isothermal boundary
conditions are employed (i.e. $T_{w}$). Default value = 300.15$K$;
\item \inltt{uint} farfield $X$-component of the velocity (i.e. $u_{\infty}$). Default value = 0.1 $m/s$;
\item \inltt{uInf} farfield $X$-component of the velocity (i.e. $u_{\infty}$). Default value = 0.1 $m/s$;
\item \inltt{vInf} farfield $Y$-component of the velocity (i.e. $v_{\infty}$). Default value = 0.0 $m/s$;
\item \inltt{wInf} farfield $Z$-component of the velocity (i.e. $w_{\infty}$). Default value = 0.0 $m/s$;
\item \inltt{mu} dynamic viscosity (i.e. $\mu_{\infty}$). Default value = 1.78e-05 $Pa s$;
......
......@@ -830,7 +830,6 @@ the advection term using the pressure inverse mass matrix. It can be used just i
<I PROPERTY="SmoothAdvection" VALUE="True"/>
\end{lstlisting}
\item \inltt{SpectralVanishingViscosity}: activates a stabilization technique
which increases the viscosity on the modes with the highest frequencies.
\begin{lstlisting}[style=XMLStyle]
......@@ -839,7 +838,34 @@ which increases the viscosity on the modes with the highest frequencies.
In a Quasi-3D simulation, this will affect both the Fourier and the spectral/hp expansions.
To activate them independently, use \inltt{SpectralVanishingViscositySpectralHP}
and \inltt{SpectralVanishingViscosityHomo1D}.
and \inltt{SpectralVanishingViscosityHomo1D}. \\
There are three spectral vanishing viscosity kernels available:
\begin{center}
\footnotesize
\begin{tabular}{lcc}
\toprule
{SVV Kernel} & {\texttt{SpectralVanishingViscosity}} \\
\midrule
Exponential Kernel & \texttt{True} \\
Power Kernel & \texttt{PowerKernel} \\
DG Kernel & \texttt{DGKernel} \\
\bottomrule
\end{tabular}
\end{center}
The Exponential kernel is based on the work of Maday et al. \cite{yvsiouei93},
its extension to 2D can be found in \cite{rosh06}. A diffusion coefficient can
be specified which defines the base magnitude of the viscosity; this parameter
is scaled by $h/p$. SVV viscosity is activated for expansion modes greater than
the product of the cut-off ratio and the expansion order. The Power kernel is a
smooth function with no cut-off frequency; it focusses on a narrower band of
higher expansion modes as the polynomial order increases. The cut-off ratio
parameter for the Power kernel corresponds to the power ratio, see Moura et al.
\cite{rospjo16}. The DG-Kernel is an attempt to match the dissipation of CG-SVV
to DG schemes of lower expansion orders. This kernel does not require any parameters
although the diffusion coefficient can still be modified.
\item \inltt{DEALIASING}: activates the 3/2 padding rule on the advection term
of a Quasi-3D simulation.
......@@ -856,7 +882,6 @@ stabilize the simulation. This method is based on the work of Kirby and Sherwin
\end{itemize}
\subsection{Parameters}
The following parameters can be specified in the \inltt{PARAMETERS} section of
the session file:
......@@ -869,7 +894,7 @@ the session file:
\item \inltt{MinSubSteps}: perform a minimum number of substeps in sub-stepping algorithm (default is 1)
\item \inltt{MaxSubSteps}: perform a maxmimum number of substeps in sub-stepping algorithm otherwise exit (default is 100)
\item \inltt{SVVCutoffRatio}: sets the ratio of Fourier frequency not affected by the SVV technique (default value = 0.75, i.e. the first 75\% of frequency are not damped)
\item \inltt{SVVDiffCoeff}: sets the SVV diffusion coefficient (default value = 0.1)
\item \inltt{SVVDiffCoeff}: sets the SVV diffusion coefficient (default value = 0.1 (Exponential and Power kernel), 1 (DG-Kernel))
\end{itemize}
\subsection{Womersley Boundary Condition}
......
......@@ -214,6 +214,7 @@ openany, % A chapter may start on either a recto or verso page.
}
\lstset{%
escapeinside={(*}{*)},%
breaklines=true,
}
\usepackage{tikz}
......
......@@ -178,6 +178,7 @@ possibly also Reynolds stresses) into single file;
\item \inltt{scalargrad}: Computes scalar gradient field;
\item \inltt{scaleinputfld}: Rescale input field by a constant factor;
\item \inltt{shear}: Computes time-averaged shear stress metrics: TAWSS, OSI, transWSS, TAAFI, TACFI, WSSG;
\item \inltt{streamfunction}: Calculates stream function of a 2D incompressible flow.
\item \inltt{surfdistance}: Computes height of a prismatic boundary layer mesh and projects onto the surface (for e.g. $y^+$ calculation).
\item \inltt{vorticity}: Computes the vorticity field.
\item \inltt{wss}: Computes wall shear stress field.
......@@ -502,10 +503,14 @@ To interpolate discrete point data to a field, use the interppointdatatofld modu
\begin{lstlisting}[style=BashInputStyle]
FieldConvert -m interppointdatatofld:frompts=file1.pts file1.xml file1.fld
\end{lstlisting}
or alternatively for csv data:
\begin{lstlisting}[style=BashInputStyle]
FieldConvert -m interppointdatatofld:frompts=file1.csv file1.xml file1.fld
\end{lstlisting}
%
This command will interpolate the data from \inltt{file1.pts} to the mesh
This command will interpolate the data from \inltt{file1.pts} (\inltt{file1.csv}) to the mesh
and expansions defined in \inltt{file1.xml} and output the field to \inltt{file1.fld}.
The file \inltt{file.pts} is of the form:
The file \inltt{file.pts} must be of the form:
%
\begin{lstlisting}[style=XMLStyle]
<?xml version="1.0" encoding="utf-8" ?>
......@@ -526,11 +531,20 @@ the second one contains the $a$-values, the third the $b$-values and so on.
In case of $n$-dimensional data, the $n$ coordinates are specified in the first $n$
columns accordingly.
%
An equivalant csv file is:
\begin{lstlisting}[style=BashInputStyle]
# x, a, b, c
1.0000,-1.0000,1.0000,-0.7778
2.0000,-0.9798,0.9798,-0.7980
3.0000,-0.9596,0.9596,-0.8182
4.0000,-0.9394,0.9394,-0.8384
\end{lstlisting}
%
In order to interpolate 1D data to a $n$D field, specify the matching coordinate in
the output field using the \inltt{interpcoord} argument:
%
\begin{lstlisting}[style=BashInputStyle]
FieldConvert -m interppointdatatofld:frompts=1D-file1.pts:interppointdatatofld=1 \
FieldConvert -m interppointdatatofld:frompts=1D-file1.pts:interpcoord=1 \
3D-file1.xml 3D-file1.fld
\end{lstlisting}
%
......@@ -568,6 +582,15 @@ The format of the file \inltt{file2.pts} is of the same form as for the
</POINTS>
</NEKTAR>
\end{lstlisting}
Similar to the \textit{interppointdatatofld} module, the \inltt{.pts} file can
be interchanged with a \inltt{.csv} file:
\begin{lstlisting}[style=BashInputStyle]
# x, y
0.0,0.0
0.5,0.0
1.0,0.0
\end{lstlisting}
There are three optional arguments \inltt{clamptolowervalue},
\inltt{clamptouppervalue} and \inltt{defaultvalue} the first two clamp the
interpolation between these two values and the third defines the default
......@@ -759,7 +782,8 @@ point, the first, second, and third columns contains the
$x,y,z$-coordinate and subsequent columns contain the field values, in
this case the $p$-value So in the general case of $n$-dimensional
data, the $n$ coordinates are specified in the first $n$ columns
accordingly followed by the field data.
accordingly followed by the field data. Alternatively, the \inltt{file.pts}
can be interchanged with a csv file.
The default argument is to use the equispaced (but potentially
collapsed) coordinates which can be obtained from the command.
......@@ -850,6 +874,26 @@ The argument \inltt{N} and \inltt{fromfld} are compulsory arguments that respect
The input \inltt{.fld} files are the outputs of the \textit{wss} module. If they do not contain the surface normals (an optional output of the \textit{wss} modle), then the \textit{shear} module will not compute the last metric, |WSSG|.
%
%
%
\subsection{Stream function of a 2D incompressible flow: \textit{streamfunction} module}
The streamfunction module calculates the stream function of a 2D incompressible flow, by
solving the Poisson equation
\[
\nabla^2 \psi = -\omega
\]
where $\omega$ is the vorticity. Note that this module applies the same boundary conditions
specified for the y-direction velocity component \inltt{v} to the stream function,
what may not be the most appropriate choice.
To use this module, the user can run
\begin{lstlisting}[style=BashInputStyle]
FieldConvert -m streamfunction test.xml test.fld test-streamfunc.fld
\end{lstlisting}
where the file \inltt{test-streamfunc.fld} can be processed in a similar
way as described in section \ref{s:utilities:fieldconvert:sub:convert}.
%
%
......
......@@ -347,7 +347,7 @@ OperatorImpMap CollectionOptimisation::SetWithTimings(
Array<OneD, NekDouble> outarray2(maxsize);
Array<OneD, NekDouble> outarray3(maxsize);
Timer t;
LibUtilities::Timer t;
if(verbose)
{
......
......@@ -37,10 +37,9 @@
#include <cstdlib>
#include <iomanip>
#include <boost/timer/timer.hpp>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <LibUtilities/BasicUtils/Timer.h>
#include <LibUtilities/Communication/Comm.h>
#include <MultiRegions/ExpList3D.h>
#include <Collections/Collection.h>
......@@ -49,11 +48,6 @@
using namespace std;
using namespace Nektar;
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
using boost::timer::format;
MultiRegions::ExpListSharedPtr SetupExpList(
int N,
LibUtilities::SessionReaderSharedPtr session,
......@@ -71,33 +65,21 @@ MultiRegions::ExpListSharedPtr SetupExpList(
return expList;
}
void printOutput(int N, int Ntest, cpu_timer &timer, bool fmt)
void printOutput(int N, int Ntest, LibUtilities::Timer &timer, bool fmt)
{
cpu_times times = timer.elapsed();
nanosecond_type total = times.user + times.system;
const double sec = 1000000000.0L;
// Normalize timings
double wall_sec = times.wall / sec;
double total_sec = total / sec;
wall_sec /= Ntest;
total_sec /= Ntest;
// Get timings
NekDouble total_sec = timer.TimePerTest(Ntest);
if (fmt)
{
cout << setw(6) << N-1
<< setw(18) << wall_sec
<< setw(18) << total_sec
<< endl;
}
else
{
cout << "P = " << N-1 << ": "
<< wall_sec << " (wall) "
<< total_sec << " (total), "
<< (100.0 * total_sec / wall_sec) << "% CPU"
<< total_sec << " s, "
<< endl;
}
}
......@@ -113,7 +95,7 @@ int main(int argc, char *argv[])
MultiRegions::ExpListSharedPtr expList;
cpu_timer timer;
LibUtilities::Timer timer;
int Ntest, maxOrder;
session->LoadParameter("Ntest", Ntest, 1000);
......@@ -141,12 +123,12 @@ int main(int argc, char *argv[])
Array<OneD, NekDouble> input (expList->GetNcoeffs());
Array<OneD, NekDouble> output(expList->GetNpoints());
timer.start();
timer.Start();
for (int i = 0; i < Ntest; ++i)
{
expList->BwdTrans(input, output);
}
timer.stop();
timer.Stop();
printOutput(N, Ntest, timer, fmt);
}
......@@ -158,12 +140,12 @@ int main(int argc, char *argv[])
Array<OneD, NekDouble> input (expList->GetNpoints());
Array<OneD, NekDouble> output(expList->GetNcoeffs());
timer.start();
timer.Start();
for (int i = 0; i < Ntest; ++i)
{
expList->IProductWRTBase(input, output);
}
timer.stop();
timer.Stop();
printOutput(N, Ntest, timer, fmt);
}
......@@ -181,12 +163,12 @@ int main(int argc, char *argv[])
input[i] = Array<OneD, NekDouble>(expList->GetNpoints());
}
timer.start();
timer.Start();
for (int i = 0; i < Ntest; ++i)
{
expList->IProductWRTDerivBase(input, output);
}
timer.stop();
timer.Stop();
printOutput(N, Ntest, timer, fmt);
}
......@@ -200,12 +182,12 @@ int main(int argc, char *argv[])
Array<OneD, NekDouble> output1(expList->GetNpoints());
Array<OneD, NekDouble> output2(expList->GetNpoints());
timer.start();
timer.Start();
for (int i = 0; i < Ntest; ++i)
{
expList->PhysDeriv(input, output0, output1, output2);
}
timer.stop();
timer.Stop();
printOutput(N, Ntest, timer, fmt);
}
......
......@@ -41,6 +41,7 @@ SET(FieldUtilsHeaders
ProcessModules/ProcessPointDataToFld.h
ProcessModules/ProcessPrintFldNorms.h
ProcessModules/ProcessScaleInFld.h
ProcessModules/ProcessStreamFunction.h
ProcessModules/ProcessSurfDistance.h
ProcessModules/ProcessVorticity.h
ProcessModules/ProcessScalGrad.h
......@@ -95,6 +96,7 @@ SET(FieldUtilsSources
ProcessModules/ProcessScaleInFld.cpp
ProcessModules/ProcessVorticity.cpp
ProcessModules/ProcessScalGrad.cpp
ProcessModules/ProcessStreamFunction.cpp
ProcessModules/ProcessSurfDistance.cpp
ProcessModules/ProcessMultiShear.cpp
ProcessModules/ProcessWSS.cpp
......
......@@ -39,6 +39,7 @@ using namespace std;
#include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <LibUtilities/BasicUtils/CsvIO.h>
#include <tinyxml.h>
......@@ -53,7 +54,11 @@ ModuleKey InputPts::m_className[5] = {
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eInputModule, "pts"), InputPts::create, "Reads Pts file."),
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eInputModule, "pts.gz"), InputPts::create, "Reads Pts file.")
ModuleKey(eInputModule, "pts.gz"), InputPts::create, "Reads Pts file."),
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eInputModule, "csv"), InputPts::create, "Reads csv file."),
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eInputModule, "csv.gz"), InputPts::create, "Reads csv file."),
};
/**
......@@ -63,6 +68,7 @@ ModuleKey InputPts::m_className[5] = {
InputPts::InputPts(FieldSharedPtr f) : InputModule(f)
{
m_allowedFiles.insert("pts");
m_allowedFiles.insert("csv");
}
/**
......@@ -79,10 +85,23 @@ void InputPts::Process(po::variables_map &vm)
{
string inFile = m_config["infile"].as<string>();
LibUtilities::PtsIOSharedPtr ptsIO =
MemoryManager<LibUtilities::PtsIO>::AllocateSharedPtr(m_f->m_comm);
ptsIO->Import(inFile, m_f->m_fieldPts);
// Determine appropriate field input
if (m_f->m_inputfiles.count("pts") != 0)
{
LibUtilities::CsvIOSharedPtr csvIO =
MemoryManager<LibUtilities::CsvIO>::AllocateSharedPtr(m_f->m_comm);
csvIO->Import(inFile, m_f->m_fieldPts);
}
else if (m_f->m_inputfiles.count("csv") != 0)
{
LibUtilities::PtsIOSharedPtr ptsIO =
MemoryManager<LibUtilities::PtsIO>::AllocateSharedPtr(m_f->m_comm);
ptsIO->Import(inFile, m_f->m_fieldPts);
}
else
{
ASSERTL0(false, "unknown input file type");
}
// save field names
for (int j = 0; j < m_f->m_fieldPts->GetNFields(); ++j)
......
......@@ -77,7 +77,7 @@ InputXml::~InputXml()
*/
void InputXml::Process(po::variables_map &vm)
{
Timer timerpart;
LibUtilities::Timer timerpart;
if (m_f->m_verbose)
{
if (m_f->m_comm->TreatAsRankZero())
......
......@@ -147,7 +147,7 @@ public:
/// Returns the output field
FIELD_UTILS_EXPORT LibUtilities::PtsFieldSharedPtr GetOutField() const;
/// Print statics of the interpolation weights
/// Returns if the weights have already been computed
FIELD_UTILS_EXPORT void PrintStatistics();
/// sets a callback funtion which gets called every time the interpolation
......
......@@ -45,7 +45,6 @@
#include <vector>
#include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <LibUtilities/BasicUtils/Timer.h>
#include <LibUtilities/Communication/CommSerial.h>
#include <StdRegions/StdNodalTriExp.h>
......
......@@ -6,7 +6,7 @@
//
// The MIT License
//
// Copyright (c) 2016 Kilian Lackhove
// Copyright (c) 2017 Kilian Lackhove
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
......@@ -40,14 +40,21 @@ using namespace std;
#include "OutputPts.h"
#include <LibUtilities/BasicUtils/FileSystem.h>
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <LibUtilities/BasicUtils/CsvIO.h>
namespace Nektar
{
namespace FieldUtils
{
ModuleKey OutputPts::m_className = GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eOutputModule, "pts"), OutputPts::create, "Writes a pts file.");
ModuleKey OutputPts::m_className[5] = {
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eOutputModule, "pts"), OutputPts::create, "Writes a pts file."),
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eOutputModule, "csv"), OutputPts::create, "Writes a csv file."),
};
OutputPts::OutputPts(FieldSharedPtr f) : OutputFileBase(f)
{
......@@ -62,8 +69,16 @@ void OutputPts::OutputFromPts(po::variables_map &vm)
// Extract the output filename and extension
string filename = m_config["outfile"].as<string>();
LibUtilities::PtsIO ptsIO(m_f->m_comm);
ptsIO.Write(filename, m_f->m_fieldPts);
if (boost::filesystem::path(filename).extension() == ".csv")
{
LibUtilities::CsvIO csvIO(m_f->m_comm);
csvIO.Write(filename, m_f->m_fieldPts);
}
else
{
LibUtilities::PtsIO ptsIO(m_f->m_comm);
ptsIO.Write(filename, m_f->m_fieldPts);
}
}
void OutputPts::OutputFromExp(po::variables_map &vm)
......@@ -126,3 +141,4 @@ fs::path OutputPts::GetFullOutName(std::string &filename,
}
}
......@@ -53,7 +53,7 @@ public:
{
return MemoryManager<OutputPts>::AllocateSharedPtr(f);
}
static ModuleKey m_className;
static ModuleKey m_className[];
OutputPts(FieldSharedPtr f);
virtual ~OutputPts();
......
......@@ -67,7 +67,7 @@ void ProcessCreateExp::Process(po::variables_map &vm)
if(m_f->m_graph)
{
int i, j;
Timer timerpart;
LibUtilities::Timer timerpart;
if (m_f->m_verbose)
{
if (m_f->m_comm->TreatAsRankZero())
......
......@@ -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");
......
......@@ -45,6 +45,8 @@ using namespace std;
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <LibUtilities/BasicUtils/CsvIO.h>
#include <boost/lexical_cast.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
......@@ -116,8 +118,15 @@ void ProcessInterpPoints::Process(po::variables_map &vm)
MemoryManager<SpatialDomains::DomainRange>::AllocateSharedPtr();
int coordim = m_f->m_fieldPts->GetDim();
int npts = m_f->m_fieldPts->GetNpoints();
std::vector<std::string> fieldNames = m_f->m_fieldPts->GetFieldNames();
for (auto it = fieldNames.begin(); it != fieldNames.end(); ++it)
{
m_f->m_fieldPts->RemoveField(*it);
}
Array<OneD, Array<OneD, NekDouble> > pts;
m_f->m_fieldPts->GetPts(pts);
rng->m_checkShape = false;
rng->m_zmin = -1;
rng->m_zmax = 1;
......@@ -216,14 +225,30 @@ void ProcessInterpPoints::CreateFieldPts(po::variables_map &vm)
int rank = m_f->m_comm->GetRank();
int nprocs = m_f->m_comm->GetSize();
// Check for command line point specification