Commit c657e4d9 authored by Claes Eskilsson's avatar Claes Eskilsson
Browse files

Merge branch 'master' into feature/ShallowWaterSolver

parents f2d95a59 d3bfd923
......@@ -24,27 +24,28 @@ IF (NEKTAR_USE_PETSC)
ENDIF (NEKTAR_USE_MPI)
EXTERNALPROJECT_ADD(
petsc-3.5.1
petsc-3.5.2
PREFIX ${TPSRC}
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPBUILD}/petsc-3.5.1
TMP_DIR ${TPBUILD}/petsc-3.5.1-tmp
SOURCE_DIR ${TPBUILD}/petsc-3.5.2
TMP_DIR ${TPBUILD}/petsc-3.5.2-tmp
INSTALL_DIR ${TPDIST}
BINARY_DIR ${TPBUILD}/petsc-3.5.1
URL http://www.nektar.info/thirdparty/petsc-lite-3.5.1.tar.gz
URL_MD5 "539b3bdb627407b7e4e9e830fd5ccf43"
BINARY_DIR ${TPBUILD}/petsc-3.5.2
URL http://www.nektar.info/thirdparty/petsc-lite-3.5.2.tar.gz
URL_MD5 "d707336a98d7cb31d843804d020edc94"
CONFIGURE_COMMAND ./configure
--with-cc=${PETSC_C_COMPILER}
--with-cxx=${PETSC_CXX_COMPILER}
--with-shared-libraries=0
--with-pic=1
--with-x=0
--with-ssl=0
--prefix=${TPDIST}
--with-petsc-arch=c-opt
--with-fc=0
${PETSC_NO_MPI}
)
BUILD_COMMAND MAKEFLAGS= make)
INCLUDE_DIRECTORIES(${TPDIST}/include)
SET(PETSC_LIBRARIES "${TPDIST}/lib/libpetsc.a")
......@@ -57,6 +58,7 @@ IF (NEKTAR_USE_PETSC)
MESSAGE(STATUS "Found PETSc: ${PETSC_LIBRARIES}")
ENDIF (NOT PETSC_FOUND)
INCLUDE_DIRECTORIES(${PETSC_INCLUDES})
ADD_CUSTOM_TARGET(petsc-3.5.2 ALL)
ENDIF (THIRDPARTY_BUILD_PETSC)
ENDIF( NEKTAR_USE_PETSC )
......
......@@ -97,11 +97,13 @@ 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{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 +176,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 +353,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]
......
\section{Analytic Expressions}
\label{sec:xml:analytic-expressions}
This section discusses particulars related to analytic expressions appearing in
Nektar++. Analytic expressions in Nektar++ are used to describe spatially or
temporally varying properties, for example
......
......@@ -242,20 +242,6 @@ the field data is specified. The expansion order used to generate the .rst file
must be the same as that for the simulation. The filename must be specified
relative to the location of the .xml file.
With the additional argument \inltt{TIMEDEPENDENT="1"}, different files can be
loaded for each timestep. The filenames are defined using
\href{http://www.boost.org/doc/libs/1_56_0/libs/format/doc/format.html#syntax}{boost::format syntax}
where the step time is used as variable. For example, the function
\inltt{Baseflow} would load the files \inltt{U0V0\_1.00000000E-05.fld},
\inltt{U0V0\_2.00000000E-05.fld} and so on.
\begin{lstlisting}[style=XMLStyle]
<FUNCTION NAME="Baseflow">
<F VAR="U0,V0" TIMEDEPENDENT="1"FILE="U0V0_%14.8R.fld"/>
</FUNCTION>
\end{lstlisting}
Other examples of this input feature can be the insertion of a forcing term,
\begin{lstlisting}[style=XMLStyle]
......@@ -278,7 +264,59 @@ or of a linear advection term
</FUNCTION>
\end{lstlisting}
[wiki:Reference/AnalyticExpressions This page] provides the list of acceptable mathematical functions and other related technical details.
\subsubsection{Remapping variable names}
Note that it is sometimes the case that the variables being used in the solver
do not match those saved in the FLD file. For example, if one runs a
three-dimensional incompressible Navier-Stokes simulation, this produces an FLD
file with the variables \inltt{u}, \inltt{v}, \inltt{w} and \inltt{p}. If we
wanted to use this velocity field as input for an advection velocity, the
advection-diffusion-reaction solver expects the variables \inltt{Vx}, \inltt{Vy}
and \inltt{Vz}.
We can manually specify this mapping by adding a colon to the
\begin{lstlisting}[style=XMLStyle]
<FUNCTION NAME="AdvectionVelocity">
<F VAR="Vx,Vy,Vz" VALUE="file.fld:u,v,w" />
</FUNCTION>
\end{lstlisting}
There are some caveats with this syntax:
\begin{itemize}
\item You must specify the same number of fields for both the variable, and
after the colon. For example, the following is not valid.
\begin{lstlisting}[style=XMLStyle,gobble=4]
<FUNCTION NAME="AdvectionVelocity">
<F VAR="Vx,Vy,Vz" VALUE="file.fld:u" />
</FUNCTION>\end{lstlisting}
\item This syntax is not valid with the wildcard operator \inltt{*}, so one
cannot write for example:
\begin{lstlisting}[style=XMLStyle,gobble=4]
<FUNCTION NAME="AdvectionVelocity">
<F VAR="*" VALUE="file.fld:u,v,w" />
</FUNCTION>
\end{lstlisting}
\end{itemize}
\subsubsection{Time-dependent file-based functions}
With the additional argument \inltt{TIMEDEPENDENT="1"}, different files can be
loaded for each timestep. The filenames are defined using
\href{http://www.boost.org/doc/libs/1_56_0/libs/format/doc/format.html#syntax}{boost::format
syntax} where the step time is used as variable. For example, the function
\inltt{Baseflow} would load the files \inltt{U0V0\_1.00000000E-05.fld},
\inltt{U0V0\_2.00000000E-05.fld} and so on.
\begin{lstlisting}[style=XMLStyle]
<FUNCTION NAME="Baseflow">
<F VAR="U0,V0" TIMEDEPENDENT="1" FILE="U0V0_%14.8R.fld" />
</FUNCTION>
\end{lstlisting}
Section~\ref{sec:xml:analytic-expressions} provides the list of acceptable
mathematical functions and other related technical details.
\subsection{Quasi-3D approach}
......@@ -375,3 +413,7 @@ available. In case of a 1D homogeneous extension, the homogeneous direction will
be the z-axis. In case of a 2D homogeneous extension, the homogeneous directions
will be the y-axis and the z-axis.
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../user-guide"
%%% End:
......@@ -112,6 +112,13 @@ ADD_NEKTAR_TEST(LinearAdvDiffReact2D_P7_Modes)
ADD_NEKTAR_TEST(Deriv3D_Homo1D)
ADD_NEKTAR_TEST(Deriv3D_Homo2D)
# PETSc solver tests
IF (NEKTAR_USE_PETSC)
ADD_NEKTAR_TEST(Helmholtz2D_CG_P7_Modes_AllBCs_petsc_full)
ADD_NEKTAR_TEST(Helmholtz2D_CG_P7_Modes_AllBCs_petsc_ml)
ADD_NEKTAR_TEST(Helmholtz2D_CG_P7_Modes_AllBCs_petsc_sc)
ENDIF (NEKTAR_USE_PETSC)
IF (NEKTAR_USE_MPI)
ADD_NEKTAR_TEST(Helmholtz1D_CG_P8_periodic_par3)
ADD_NEKTAR_TEST(Helmholtz2D_CG_P7_Modes_AllBCs_xxt_full)
......@@ -122,11 +129,10 @@ IF (NEKTAR_USE_MPI)
ADD_NEKTAR_TEST(Helmholtz3D_CG_Prism_iter_ml_par3)
ADD_NEKTAR_TEST_LENGTHY(Helmholtz3D_CG_Hex_AllBCs_xxt_sc_par3)
ADD_NEKTAR_TEST(Helmholtz2D_CG_P14_xxt_per)
#
# TODO: This test fails due to a bug with Dirichlet bnd conditions.
# To be resolved in a separate branch.
#
# ADD_NEKTAR_TEST(Helmholtz3D_CG_Tet_iter_global_par3)
# TODO: This test fails due to a bug with Dirichlet bnd conditions.
# To be resolved in a separate branch.
# ADD_NEKTAR_TEST(Helmholtz3D_CG_Tet_iter_global_par3)
ADD_NEKTAR_TEST_LENGTHY(Helmholtz2D_HDG_P7_Modes_AllBCs_par2)
ADD_NEKTAR_TEST(Helmholtz3D_HDG_Prism_par2)
......@@ -138,4 +144,8 @@ IF (NEKTAR_USE_MPI)
ADD_NEKTAR_TEST(Helmholtz3D_HDG_Hex_AllBCs_scotch_par2)
ENDIF (NEKTAR_USE_SCOTCH)
IF (NEKTAR_USE_PETSC)
ADD_NEKTAR_TEST(Helmholtz2D_CG_P7_Modes_AllBCs_petsc_sc_par3)
ADD_NEKTAR_TEST(Helmholtz3D_CG_Hex_AllBCs_petsc_sc_par3)
ENDIF (NEKTAR_USE_PETSC)
ENDIF (NEKTAR_USE_MPI)
......@@ -16,8 +16,6 @@ int main(int argc, char *argv[])
LibUtilities::CommSharedPtr vComm = vSession->GetComm();
string meshfile(vSession->GetFilename());
MultiRegions::ContField3DHomogeneous1DSharedPtr Exp_u, Exp_v, Exp_w;
StdRegions::ConstFactorMap factors;
......
......@@ -15,8 +15,6 @@ int main(int argc, char *argv[])
LibUtilities::CommSharedPtr vComm = vSession->GetComm();
string meshfile(vSession->GetFilename());
MultiRegions::ContField3DHomogeneous1DSharedPtr Exp_u, Exp_v, Exp_w;
StdRegions::ConstFactorMap factors;
......
......@@ -16,8 +16,6 @@ int main(int argc, char *argv[])
LibUtilities::CommSharedPtr vComm = vSession->GetComm();
string meshfile(vSession->GetFilename());
MultiRegions::ContField3DHomogeneous2DSharedPtr Exp_u, Exp_v, Exp_w;
StdRegions::ConstFactorMap factors;
......
......@@ -25,7 +25,6 @@ int main(int argc, char *argv[])
int coordim;
Array<OneD,NekDouble> sol;
Array<OneD,NekDouble> xc0,xc1,xc2;
std::string meshfile(vSession->GetFilename());
if(argc != 2)
{
......
......@@ -20,7 +20,6 @@ int main(int argc, char *argv[])
int i, j, nq, coordim;
Array<OneD,NekDouble> fce;
Array<OneD,NekDouble> xc0,xc1,xc2;
std::string meshfile(vSession->GetFilename());
if(argc != 2)
{
......
......@@ -21,7 +21,6 @@ int main(int argc, char *argv[])
int i, j, nq, coordim;
Array<OneD,NekDouble> fce;
Array<OneD,NekDouble> xc0,xc1,xc2;
std::string meshfile(vSession->GetFilename());
if(argc != 2)
{
......
......@@ -22,7 +22,6 @@ int main(int argc, char *argv[])
int nq, coordim;
Array<OneD,NekDouble> fce;
Array<OneD,NekDouble> xc0,xc1,xc2;
std::string meshfile(vSession->GetFilename());
if(argc != 3)
{
......
......@@ -15,7 +15,6 @@ int main(int argc, char *argv[])
{
LibUtilities::SessionReaderSharedPtr vSession
= LibUtilities::SessionReader::CreateInstance(argc, argv);
string meshfile(vSession->GetFilename());
MultiRegions::ExpList1DSharedPtr Exp,Sol;
int i,j;
......
......@@ -16,7 +16,6 @@ int main(int argc, char *argv[])
{
LibUtilities::SessionReaderSharedPtr vSession
= LibUtilities::SessionReader::CreateInstance(argc, argv);
string meshfile(vSession->GetFilename());
MultiRegions::ExpList2DSharedPtr Exp,Fce;
int i, j, nq, coordim;
......
......@@ -17,8 +17,6 @@ int main(int argc, char *argv[])
LibUtilities::SessionReaderSharedPtr vSession
= LibUtilities::SessionReader::CreateInstance(argc, argv);
string meshfile(vSession->GetFilename());
MultiRegions::ExpList3DSharedPtr Exp,Fce;
int i, j, nq, coordim;
Array<OneD,NekDouble> fce, tmp, tmp2;
......
......@@ -25,8 +25,6 @@ int main(int argc, char *argv[])
LibUtilities::SessionReaderSharedPtr vSession
= LibUtilities::SessionReader::CreateInstance(argc, argv);
string meshfile(vSession->GetFilename());
MultiRegions::ContField2DSharedPtr Exp,Fce;
int nq, coordim;
Array<OneD,NekDouble> fce;
......
......@@ -15,7 +15,6 @@ int main(int argc, char *argv[])
= LibUtilities::SessionReader::CreateInstance(argc, argv);
LibUtilities::CommSharedPtr vComm = vSession->GetComm();
string meshfile(vSession->GetFilename());
MultiRegions::DisContField1DSharedPtr Exp,Fce;
int i, nq, coordim;
......
......@@ -23,7 +23,6 @@ int main(int argc, char *argv[])
Array<OneD,NekDouble> fce;
Array<OneD,NekDouble> xc0,xc1,xc2;
StdRegions::ConstFactorMap factors;
string meshfile(vSession->GetFilename());
if( (argc != 2) && (argc != 3) && (argc != 4))
{
......
......@@ -17,7 +17,6 @@ int main(int argc, char *argv[])
= LibUtilities::SessionReader::CreateInstance(argc, argv);
LibUtilities::CommSharedPtr vComm = vSession->GetComm();
string meshfile(vSession->GetFilename());
MultiRegions::ContField3DHomogeneous2DSharedPtr Exp, Fce;
int nq;
......
......@@ -26,7 +26,6 @@ int main(int argc, char *argv[])
= LibUtilities::SessionReader::CreateInstance(argc, argv);
LibUtilities::CommSharedPtr vComm = vSession->GetComm();
string meshfile(vSession->GetFilename());
MultiRegions::ContField2DSharedPtr Exp,Fce;
int i, nq, coordim;
......
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