Commit f7ba77fb authored by Spencer Sherwin's avatar Spencer Sherwin
Browse files

Updated documentation on modules equispacedoutput and isocontour and removed isocontourutils

parent 054d826d
......@@ -97,11 +97,14 @@ Specifically, FieldConvert has these additional functionalities
\item \inltt{C0Projection}: Computes the C0 projection of a given output file;
\item \inltt{QCriterion}: Computes the Q-Criterion for a given output file;
\item \inltt{concatenate}: Concatenate a \nekpp binary output (.chk or .fld) field file into single file;
\item \inltt{equispacedoutput}: Write data as equi-spaced output using simplices to represent the data for connecting points;
\item \inltt{extract}: Extract a boundary field;
\item \inltt{interpfield}: Interpolates one field to another, requires fromxml, fromfld to be defined;
\item \inltt{interppointdatatofld}: Interpolates given discrete data using a finite difference approximation to a fld file given an xml file;
\item \inltt{interppoints}: Interpolates a set of points to another, requires fromfld and fromxml to be defined, a line or plane of points can be defined;
\item \inltt{scaleinputfld}: rescale input field by a constant factor.
\item \inltt{isocontour}: Extract an isocontour of ``fieldid'' variable and at value ``fieldvalue''. Optionally ``fieldstr'' can be specified for a string defiition or ``smooth'' for smoothing;
\item \inltt{isocontourutil}: Process isocontour with different utilities such as smoothing;
\item \inltt{scaleinputfld}: Rescale input field by a constant factor.
\item \inltt{vorticity}: Computes the vorticity field.
\end{enumerate}
The module list above can be seen by running the command
......@@ -174,6 +177,24 @@ to visualise either in Tecplot or in Paraview the result.
%
%
%
\subsubsection{Equi-spaced output of data: \textit{equispacedoutput} module}
This module interpolates the output data to an truly equispaced set of
points (not equispaced along the collapsed coordinate
system). Therefore a tetrahedron is represented by a tetrahedral
number of poinst. This produces much smaller output files. The points
are then connected together by simplices (triangles and tetrahedrons).
\begin{lstlisting}[style=BashInputStyle]
FieldConvert -m equispacedouptput test.xml test.fld test-boundary.dat
\end{lstlisting}
\begin{notebox}
Currently this option is only set up for triangles, quadrilaterals,
tetrahedrons and prisms. It also only is currently used in tecplot
output.
\end{notebox}
\subsubsection{Extract a boundary region: \textit{extract} module}
The boundary region of a domain can be extracted from the output
data using the following command line
......@@ -333,12 +354,49 @@ where \inltt{npts1,npts2} is the number of equispaced points in each
direction and $(x0,y0,z0)$, $(x1,y1,z1)$, $(x2,y2,z2)$ and $(x3,y3,z3)$
define the plane of points specified in a clockwise or anticlockwise direction.
%
\begin{notebox}
\begin{notebox}
This module does not run in parallel.
\end{notebox}
%
%
%
\subsubsection{Isoncontour extraction: \textit{iscontour} module}
Extract an isocontour from a field file. This option automatically
take the field to an equispaced distribution of points connected by
linear simplicies of triangles or tetrahedrons. The linear simplices
are then inspected to extract the isocontour of interest. To specify
the field \inltt{fieldid} can be provided giving the id of the field
of interest and \inltt{fieldvalue} provides the value of the
isocontour to be extracted.
\begin{lstlisting}[style=BashInputStyle]
FieldConvert -m isocontour:fieldid=2:fieldvalue=0.5 test.xml test.fld \
test-isocontour.dat
\end{lstlisting}
Alternatively \inltt{fieldstr}=''u+v'' can be specified to calculate
the field $u^2$ and extract its isocontour. You can also specify
\inltt{fieldname}=''UplusV'' to define the name of the isocontour in
the .dat file, i.e.
\begin{lstlisting}[style=BashInputStyle]
FieldConvert -m isocontour:fieldstr="u+v":fieldvalue=0.5:\
fieldname="UplusV" test.xml test.fld test-isocontour.dat
\end{lstlisting}
Optionally \inltt{smooth} can be specified to smooth the isocontour
with default values \inltt{smoothnegdiffusion}=0.495,
\inltt{smoothnegdiffusion}=0.5 and \inltt{smoothiter}=100. This option
automatically calls a \inltt{globalcondense} option which remove
multiply defined verties from the simplex definition which arise as
isocontour are generated element by element.
\begin{notebox}
Currently this option is only set up for triangles, quadrilaterals,
tetrahedrons and prisms.
\end{notebox}
\subsubsection{Scale a given .fld: \textit{scaleinputfld} module}
\begin{lstlisting}[style=BashInputStyle]
......
......@@ -17,7 +17,6 @@ SET(FieldConvertHeaders
ProcessInterpPoints.h
ProcessInterpPointDataToFld.h
ProcessIsoContour.h
ProcessIsoContourUtils.h
ProcessJacobianEnergy.h
ProcessScaleInFld.h
ProcessVorticity.h
......@@ -44,7 +43,6 @@ SET(FieldConvertSources
ProcessInterpPoints.cpp
ProcessInterpPointDataToFld.cpp
ProcessIsoContour.cpp
ProcessIsoContourUtils.cpp
ProcessJacobianEnergy.cpp
ProcessScaleInFld.cpp
ProcessVorticity.cpp
......
......@@ -51,7 +51,7 @@ ModuleKey ProcessEquiSpacedOutput::className =
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eProcessModule, "equispacedoutput"),
ProcessEquiSpacedOutput::create,
"write data as equi-spaced output");
"Write data as equi-spaced output using simplices to represent the data for connecting points");
ProcessEquiSpacedOutput::ProcessEquiSpacedOutput(FieldSharedPtr f)
......
......@@ -51,7 +51,7 @@ ModuleKey ProcessIsoContour::className =
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eProcessModule, "isocontour"),
ProcessIsoContour::create,
"Extract an isocontour of fieldid variable and at value fieldvalue");
"Extract an isocontour of fieldid variable and at value fieldvalue, Optionally fieldstr can be specified for a string defiition or smooth for smoothing");
ProcessIsoContour::ProcessIsoContour(FieldSharedPtr f) :
ProcessEquiSpacedOutput(f)
......@@ -732,7 +732,6 @@ void Iso::globalcondense(vector<IsoSharedPtr> &iso)
for(i = 0; i < niso; ++i)
{
for(j = i+1; j < niso; ++j)
//for(j = 0; j < niso; ++j)
{
NekDouble diff=sqrt((sph[i][0]-sph[j][0])*(sph[i][0]-sph[j][0])+
(sph[i][1]-sph[j][1])*(sph[i][1]-sph[j][1])+
......
////////////////////////////////////////////////////////////////////////////////
//
// File: ProcessIsoContourUtils.cpp
//
// For more information, please see: http://www.nektar.info/
//
// The MIT License
//
// 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).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Set up fields as interpolation to equispaced output
//
////////////////////////////////////////////////////////////////////////////////
#include <string>
#include <iostream>
using namespace std;
#include "ProcessIsoContourUtils.h"
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
namespace Nektar
{
namespace Utilities
{
ModuleKey ProcessIsoContourUtils::className =
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eProcessModule, "isocontourutil"),
ProcessIsoContourUtils::create,
"process isocontour with different utilities");
ProcessIsoContourUtils::ProcessIsoContourUtils(FieldSharedPtr f)
{
m_f = f;
m_config["globalcondense"] = ConfigOption(true, "NotSet",
"Globally condense contour to unique "
"values");
m_config["smooth"] = ConfigOption(true, "NotSet",
"Smooth isocontour (implies global "
"condense)");
m_config["smoothiter"] = ConfigOption(false, "100",
"Number of smoothing cycle, "
"default = 100");
m_config["smoothposdiffusion"] = ConfigOption(false, "0.5",
"Postive diffusion coefficient "
"(0 < lambda < 1), default = 0.5");
m_config["smoothnegdiffusion"] = ConfigOption(false, "0.495",
"Negative diffusion coefficient "
"(0 < mu < 1), default = 0.495");
}
ProcessIsoContourUtils::~ProcessIsoContourUtils(void)
{
}
void ProcessIsoContourUtils::Process(po::variables_map &vm)
{
vector<IsoSharedPtr> iso;
ASSERTL0(m_f->m_fieldPts != NullFieldPts,
"Need to specify an input .dat file with isocontourutil module");
LoadFieldPtsToIso(iso);
bool smoothing = m_config["smooth"].m_beenSet;
bool globalcondense = m_config["globalcondense"].m_beenSet;
if(smoothing||globalcondense)
{
vector<IsoSharedPtr> glob_iso;
int nfields = m_f->m_fieldPts->m_pts.num_elements();
IsoSharedPtr g_iso = MemoryManager<Iso>::AllocateSharedPtr(nfields-3);
g_iso->globalcondense(iso);
if(smoothing)
{
int niter = m_config["smoothiter"].as<int>();
NekDouble lambda = m_config["smoothposdiffusion"].as<NekDouble>();
NekDouble mu = m_config["smoothnegdiffusion"].as<NekDouble>();
g_iso->smooth(niter,lambda,-mu);
}
glob_iso.push_back(g_iso);
ResetFieldPts(glob_iso);
}
else
{
WARNINGL0(false,"No actions set");
}
}
void ProcessIsoContourUtils::LoadFieldPtsToIso(vector<IsoSharedPtr> &iso)
{
int nfields = m_f->m_fieldPts->m_pts.num_elements();
// set output to triangle block.
int nvertoffset = 0;
for(int n = 0; n < m_f->m_fieldPts->m_ptsConn.size(); ++n)
{
IsoSharedPtr newiso = MemoryManager<Iso>::AllocateSharedPtr(nfields-3);
int nconn = m_f->m_fieldPts->m_ptsConn[n].num_elements();
newiso->set_ntris(nconn/3);
int nvert = Vmath::Vmax(nconn,m_f->m_fieldPts->m_ptsConn[n],1)+1;
nvert -= nvertoffset;
newiso->resize_fields(nvert);
newiso->set_nvert(nvert);
for(int i = 0; i < nvert; ++i)
{
newiso->set_fields(i,m_f->m_fieldPts->m_pts,nvertoffset+i);
}
newiso->resize_vid(nconn);
for(int i = 0; i < nconn; ++i)
{
newiso->set_vid(i,m_f->m_fieldPts->m_ptsConn[n][i]-nvertoffset);
}
nvertoffset += nvert;
iso.push_back(newiso);
}
}
}
}
///////////////////////////////////////////////////////////////////////////////
//
// File: ProcessIsoContourUtils.h
//
// For more information, please see: http://www.nektar.info/
//
// The MIT License
//
// 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).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes vorticity field.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef UTILITIES_PREPROCESSING_FIELDCONVERT_PROCESSISOCONTOURUTILS
#define UTILITIES_PREPROCESSING_FIELDCONVERT_PROCESSISOCONTOURUTILS
#include "Module.h"
#include "ProcessIsoContour.h"
namespace Nektar
{
namespace Utilities
{
/**
* @brief This processing module process isocoout utilities.
*/
class ProcessIsoContourUtils : public ProcessIsoContour
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<ProcessIsoContourUtils>::AllocateSharedPtr(f);
}
static ModuleKey className;
ProcessIsoContourUtils(FieldSharedPtr f);
virtual ~ProcessIsoContourUtils();
/// Write mesh to output file.
virtual void Process(po::variables_map &vm);
private:
void LoadFieldPtsToIso(vector<IsoSharedPtr> &iso);
};
}
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment