Commit 9cddc721 authored by Michael Turner's avatar Michael Turner
Browse files

merge conflict and changelog

parents a2c26803 57f65371
......@@ -23,6 +23,7 @@ v4.4.0
to boundary conditions (!615)
- Allow expansions to be loaded directly from field file (!617)
- New options for load balancing (DOF or BOUNDARY) in mesh partitioner (!617)
- Rework nodal utilities to support nodal prismatic elements (!660)
- Update Body/Field forces at each timestep (!665)
**ADRSolver:**
......@@ -48,6 +49,9 @@ v4.4.0
mesh (!669)
- Improvements to mesh linearisation module (!659)
- Add support for Gmsh high-order output (!679)
- Move CAD classes to factory format (!676)
- Add option to `linearise` module to linearise only prisms (!688)
- Add option to `linearise` to use element quality (!690)
**FieldConvert:**
- Move all modules to a new library, FieldUtils, to support post-processing
......@@ -55,6 +59,11 @@ v4.4.0
- Add module to stretch homogeneous direction (!609)
- Add module to add composite ID of elements as a field (!674)
v4.3.5
------
**Documentation**
- Update build instructions in user guide for Windows (!692)
v4.3.4
------
**Library:**
......
......@@ -15,7 +15,7 @@ IF(NEKTAR_USE_MESHGEN)
ELSE()
SET(BUILD_OCC ON)
ENDIF()
OPTION(THIRDPARTY_BUILD_OCC "Build OpenCascade library from ThirdParty."
${BUILD_OCC})
......@@ -33,7 +33,7 @@ IF(NEKTAR_USE_MESHGEN)
IF(WIN32)
MESSAGE(SEND_ERROR "Cannot currently use OpenCascade with Nektar++ on Windows")
ENDIF()
EXTERNALPROJECT_ADD(
opencascade-6.9
PREFIX ${TPSRC}
......
......@@ -12,6 +12,7 @@ dependencies are required:
\item texlive-base
\item texlive-latex-extra
\item texlive-science
\item texlive-fonts-recommended
\item imagemagick
\end{itemize}
......
......@@ -369,7 +369,7 @@ automatically in the build process.
& & \multicolumn{2}{c}{Installation} & \\ \cmidrule(r){3-4}
Package & Req. & User & Auto. & Note \\
\midrule
MS Visual Studio & \cmark & \cmark & & 2012 and 2013 known working\\
MS Visual Studio & \cmark & \cmark & & 2012, 2013 and 2015 known working\\
CMake $\geq 3.0$ & \cmark & \cmark & & \\
BLAS & \cmark & \cmark & \cmark & \\
LAPACK & \cmark & \cmark & \cmark & \\
......@@ -382,10 +382,10 @@ ModMETIS & \cmark & \cmark & \cmark & \\
\subsubsection{Detailed instructions}
\begin{enumerate}
\item Install Microsoft Visual Studio 2013 (preferred) or 2012 (known to
\item Install Microsoft Visual Studio 2015 (preferred), 2013 or 2012 (known to
work). This can be obtained from Microsoft free of charge by using their
Express developer tools from
\url{http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx}.
Community developer tools from
\url{https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx}.
\item Install WinRAR from \url{http://www.rarlab.com/download.htm}.
\item Install CMake 3.0+ from \url{http://www.cmake.org/download/}. When
prompted, select the option to add CMake to the system PATH.
......@@ -395,14 +395,21 @@ ModMETIS & \cmark & \cmark & \cmark & \\
to the PATH.
\item (Optional) If you do not wish to build boost during the compilation
process (which can take some time), then boost binaries can be found at
\url{http://sourceforge.net/projects/boost/files/boost-binaries/1.57.0/}. By
\url{http://sourceforge.net/projects/boost/files/boost-binaries/1.61.0/}. By
default these install into \inlsh{C:\textbackslash local\textbackslash
boost\_1\_57\_0}. If you use these libraries, you will need to:
boost\_1\_61\_0}. If you use these libraries, you will need to:
\begin{itemize}
\item Rename \texttt{libs-msvc12.0} to \texttt{lib}
\item Rename \texttt{libs-msvc14.0} to \texttt{lib}
\item Inside the \texttt{lib} directory, create duplicates of
\texttt{boost\_zlib.dll} and \texttt{boost\_bzip2.dll} called
\texttt{zlib.dll} and \texttt{libbz2.dll}.
\texttt{zlib.dll} and \texttt{libbz2.dll}
\item Add a \inlsh{BOOST\_HOME} environment variable. To do so,
navigate to \emph{Control Panel > System and Security > System}, select
\emph{Advanced System Settings}, and in the \emph{Advanced} tab click the
\emph{Environment Variables}. In the \emph{System Variables} box, click
\emph{New}. In the \emph{New System Variable} window, type \inlsh{BOOST\_HOME}
next to \emph{Variable name} and \inlsh{C:\textbackslash local\textbackslash
boost\_1\_61\_0} next to\emph{Variable value}.
\end{itemize}
\item Unpack \inlsh{nektar++-\nekver.tar.gz} using WinRAR.
......@@ -415,8 +422,8 @@ ModMETIS & \cmark & \cmark & \cmark & \\
\item Create a \inlsh{builds} directory within the \inlsh{nektar++-\nekver}
subdirectory.
\item Open a Visual Studio terminal. From the start menu, this can be found in
\emph{All Programs > Visual Studio 2013 > Visual Studio Tools > Developer
Command Prompt for VS2013}.
\emph{All Programs > Visual Studio 2015 > Visual Studio Tools > Developer
Command Prompt for VS2015}.
\item Change directory into the \texttt{builds} directory and run the CMake
graphical utility:
\begin{lstlisting}[style=BashInputStyle]
......@@ -424,8 +431,8 @@ ModMETIS & \cmark & \cmark & \cmark & \\
cmake-gui ..
\end{lstlisting}
\item Select the build system you want to generate build scripts for. Note
that \emph{Visual Studio 2013} is listed as \emph{Visual Studio 12} in the
drop-down list. If you have a 64-bit installation of Windows 7, you should
that \emph{Visual Studio 2015} is listed as \emph{Visual Studio 14} in the
drop-down list. If you have a 64-bit installation of Windows, you should
select the \emph{Win64} variant, otherwise 32-bit executables will be
generated. Select the option to use the native compilers.
\item Click the \emph{Configure} button, then the \emph{Generate} button.
......@@ -450,7 +457,7 @@ ModMETIS & \cmark & \cmark & \cmark & \\
\item \inlsh{builds\textbackslash dist\textbackslash lib\textbackslash nektar++-\nekver}
\item \inlsh{builds\textbackslash dist\textbackslash bin}
\item Optionally, if you installed Boost from the binary packages,
\inlsh{C:\textbackslash local\textbackslash boost\_1\_57\_0 \textbackslash lib}
\inlsh{C:\textbackslash local\textbackslash boost\_1\_61\_0 \textbackslash lib}
\end{itemize}
\item To run the test suite, open a \textbf{new} command line window, change
to the \inlsh{builds} directory, and then issue the command
......
......@@ -542,17 +542,32 @@ The module parameters are:
\subsection{Linearisation}
The ability to remove all the high-order information in a mesh can be useful
at times.
The ability to remove all the high-order information in a mesh can be useful at
times when mesh generation is tricky or impossible in the presence of curvature
To do this in NekMesh use the command:
\begin{lstlisting}[style=BashInputStyle]
NekMesh -m linearise high-order-mesh.xml linear-mesh.xml
NekMesh -m linearise:all high-order-mesh.xml linear-mesh.xml
\end{lstlisting}
The output will contain only the linear mesh information, all curved information
is removed.
is removed. Alternatively
\begin{lstlisting}[style=BashInputStyle]
NekMesh -m linearise:invalid high-order-mesh.xml linear-mesh.xml
\end{lstlisting}
attempts to remove curvature from elements only where necessary. This is a
simple algorithm that removes curvature from invalid elements and repeats until
all elements are valid. Either \inlsh{all} or \inlsh{invalid} must be specified.
\begin{itemize}
\item \inlsh{all}: remove curvature from all elements.
\item \inlsh{invalid}: remove curvature from invalid elements.
\item \inlsh{prismonly}: consider only prisms when removing curvature. This is
useful in the presence of a prismatic boundary layer.
\end{itemize}
\subsection{Extracting interface between tetrahedra and prismatic elements}
......
......@@ -11,20 +11,7 @@ SET(PartitionAnalyseSources
SET(FoundationSources
FoundationDemo.cpp)
SET(NodalTriFeketeSources
NodalTriFeketeDemo.cpp)
SET(NodalTriElecSources
NodalTriElecDemo.cpp)
SET(NodalTriEvenlySpacedSources
NodalTriEvenlySpacedDemo.cpp)
SET(NodalTetEvenlySpacedSources
NodalTetEvenlySpacedDemo.cpp)
SET(NodalTetElecSources
NodalTetElecDemo.cpp)
SET(NodalDemoSources NodalDemo.cpp)
SET(TimeIntegrationDemoSources
TimeIntegrationDemo.cpp)
......@@ -43,24 +30,22 @@ TARGET_LINK_LIBRARIES(PartitionAnalyse LibUtilities)
ADD_NEKTAR_EXECUTABLE(FoundationDemo demos FoundationSources )
TARGET_LINK_LIBRARIES(FoundationDemo LibUtilities)
ADD_NEKTAR_EXECUTABLE(NodalTriFeketeDemo demos NodalTriFeketeSources )
TARGET_LINK_LIBRARIES(NodalTriFeketeDemo LibUtilities)
ADD_NEKTAR_EXECUTABLE(NodalTriElecDemo demos NodalTriElecSources)
TARGET_LINK_LIBRARIES(NodalTriElecDemo LibUtilities)
ADD_NEKTAR_EXECUTABLE(NodalTriEvenlySpacedDemo demos NodalTriEvenlySpacedSources)
TARGET_LINK_LIBRARIES(NodalTriEvenlySpacedDemo LibUtilities)
ADD_NEKTAR_EXECUTABLE(NodalTetEvenlySpacedDemo demos NodalTetEvenlySpacedSources)
TARGET_LINK_LIBRARIES(NodalTetEvenlySpacedDemo LibUtilities)
ADD_NEKTAR_EXECUTABLE(NodalTetElecDemo demos NodalTetElecSources)
TARGET_LINK_LIBRARIES(NodalTetElecDemo LibUtilities)
ADD_NEKTAR_EXECUTABLE(NodalDemo demos NodalDemoSources)
TARGET_LINK_LIBRARIES(NodalDemo LibUtilities)
ADD_NEKTAR_EXECUTABLE(TimeIntegrationDemo demos TimeIntegrationDemoSources)
TARGET_LINK_LIBRARIES(TimeIntegrationDemo LibUtilities)
ADD_NEKTAR_TEST(NodalDemo_Tri_Deriv_P8)
ADD_NEKTAR_TEST(NodalDemo_Tri_Integral_P6)
ADD_NEKTAR_TEST(NodalDemo_Tri_Interp_P7)
ADD_NEKTAR_TEST(NodalDemo_Prism_Deriv_P8)
ADD_NEKTAR_TEST(NodalDemo_Prism_Integral_P6)
ADD_NEKTAR_TEST(NodalDemo_Prism_Interp_P7)
ADD_NEKTAR_TEST(NodalDemo_Tet_Deriv_P8)
ADD_NEKTAR_TEST(NodalDemo_Tet_Integral_P6)
ADD_NEKTAR_TEST(NodalDemo_Tet_Interp_P7)
IF(NEKTAR_USE_HDF5)
ADD_NEKTAR_EXECUTABLE(FieldIOBenchmarker demos FieldIOBenchmarkerSources)
TARGET_LINK_LIBRARIES(FieldIOBenchmarker LibUtilities)
......
///////////////////////////////////////////////////////////////////////////////
//
// File: NodalDemo.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: Demo for testing functionality of NodalUtil classes
//
///////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <boost/program_options.hpp>
#include <boost/algorithm/string.hpp>
#include <LibUtilities/Foundations/ManagerAccess.h>
#include <LibUtilities/Foundations/NodalUtil.h>
#include <LibUtilities/Foundations/Foundations.hpp>
#include <LibUtilities/Foundations/Points.h>
#include <LibUtilities/BasicUtils/ShapeType.hpp>
using namespace std;
using namespace Nektar;
using namespace Nektar::LibUtilities;
namespace po = boost::program_options;
int main(int argc, char *argv[])
{
po::options_description desc("Available options");
desc.add_options()
("help,h", "Produce this help message.")
("integral,i", "Evaluate the integral of a known function and "
"return error.")
("order,o", po::value<int>(),
"Order to evaluate at.")
("type,t", po::value<int>(),
"Points type of the nodal element.")
("deriv,d", "Evaluate the derivative of a known function and "
"return error.")
("interp,p", po::value<string>(),
"Interpolate function at a known point of the form"
"x,y,z and return error.");
po::variables_map vm;
try
{
po::store(po::command_line_parser(argc, argv).
options(desc).run(), vm);
po::notify(vm);
}
catch (const std::exception& e)
{
cerr << e.what() << endl;
cerr << desc;
return 1;
}
if (!vm.count("order"))
{
cerr << "Must supply an element order." << endl;
return 1;
}
int order = vm["order"].as<int>();
map<PointsType, ShapeType> nodalTypes;
map<PointsType, ShapeType>::iterator nIt;
nodalTypes[eNodalTriElec] = eTriangle;
nodalTypes[eNodalTriFekete] = eTriangle;
nodalTypes[eNodalTriEvenlySpaced] = eTriangle;
nodalTypes[eNodalTetEvenlySpaced] = eTetrahedron;
nodalTypes[eNodalTetElec] = eTetrahedron;
nodalTypes[eNodalPrismEvenlySpaced] = ePrism;
if (!vm.count("type"))
{
cerr << "Must supply a points type. Valid points types are:" << endl;
for (nIt = nodalTypes.begin(); nIt != nodalTypes.end(); ++nIt)
{
cerr << " - " << (int)nIt->first << " ("
<< kPointsTypeStr[nIt->first] << ")" << endl;
}
return 1;
}
PointsType pointsType = (PointsType)vm["type"].as<int>();
if (nodalTypes.find(pointsType) == nodalTypes.end())
{
cerr << "Invalid points type. Valid points types are:" << endl;
for (nIt = nodalTypes.begin(); nIt != nodalTypes.end(); ++nIt)
{
cerr << " - " << (int)nIt->first << " ("
<< kPointsTypeStr[nIt->first] << ")" << endl;
}
return 1;
}
// Generate nodal points.
PointsKey pointsKey(order + 1, pointsType);
PointsSharedPtr points = PointsManager()[pointsKey];
Array<OneD, NekDouble> r, s, t;
points->GetPoints(r, s, t);
// Generate nodal utility.
ShapeType shape = nodalTypes[pointsType];
NodalUtil *util = NULL;
if (shape == eTriangle)
{
util = new NodalUtilTriangle(order, r, s);
}
else if (shape == eTetrahedron)
{
util = new NodalUtilTetrahedron(order, r, s, t);
}
else if (shape == ePrism)
{
util = new NodalUtilPrism(order, r, s, t);
}
ASSERTL1(util, "Unknown shape type!");
const int nPoints = r.num_elements();
const int dim = shape == eTriangle ? 2 : 3;
if (vm.count("integral"))
{
NekVector<NekDouble> weights = util->GetWeights();
NekDouble integral = 0.0;
for (int i = 0; i < nPoints; ++i)
{
NekDouble integrand = dim == 2 ?
exp(r[i]) * sin(s[i]) : exp(r[i] + s[i] + t[i]);
integral += weights[i] * integrand;
}
NekDouble exact = 0.0;
switch(shape)
{
case eTriangle:
exact = -0.5 * (sin(1.0) + cos(1.0) + M_E * M_E *
(sin(1.0) - cos(1.0))) / M_E;
break;
case eTetrahedron:
exact = 1.0 / M_E - 1.0 / M_E / M_E / M_E;
break;
case ePrism:
exact = M_E - 1.0 / M_E / M_E / M_E;
break;
default:
exact = 0.0;
break;
}
cout << "L inf error : " << fabs(exact - integral) << endl;
}
else if (vm.count("deriv"))
{
Array<OneD, NekVector<NekDouble> > exact(dim);
NekVector<NekDouble> input(nPoints), output(nPoints);
for (int i = 0; i < dim; ++i)
{
exact[i] = NekVector<NekDouble>(nPoints);
}
if (dim == 2)
{
// Exact solution: u(x,y) = sin(x) * cos(y)
for (int i = 0; i < nPoints; ++i)
{
input[i] = sin(r[i]) * cos(s[i]);
exact[0][i] = cos(r[i]) * cos(s[i]);
exact[1][i] = -sin(r[i]) * sin(s[i]);
}
}
else
{
// Exact solution: u(x,y) = sin(x) * cos(y) * sin(z)
for (int i = 0; i < nPoints; ++i)
{
input[i] = sin(r[i]) * cos(s[i]) * sin(t[i]);
exact[0][i] = cos(r[i]) * cos(s[i]) * sin(t[i]);
exact[1][i] = -sin(r[i]) * sin(s[i]) * sin(t[i]);
exact[2][i] = sin(r[i]) * cos(s[i]) * cos(t[i]);
}
}
char *vars[3] = { "u", "v", "w" };
for (int i = 0; i < dim; ++i)
{
boost::shared_ptr<NekMatrix<NekDouble> > deriv =
util->GetDerivMatrix(i);
output = *deriv * input;
NekVector<NekDouble> tmp = output - exact[i];
cout << "L 2 error (variable " << vars[i] << ") : " << tmp.L2Norm()
<< endl;
}
}
else if (vm.count("interp"))
{
string pointStr = vm["interp"].as<string>();
vector<string> point;
boost::split(point, pointStr, boost::is_any_of(","));
if (point.size() != dim)
{
cerr << "Point " << pointStr << " does not have correct dimensions"
<< endl;
return 1;
}
Array<OneD, Array<OneD, NekDouble> > tmp(dim);
for (int i = 0; i < dim; ++i)
{
tmp[i] = Array<OneD, NekDouble>(1);
try
{
tmp[i][0] = boost::lexical_cast<NekDouble>(point[i]);
}
catch(boost::bad_lexical_cast &)
{
cerr << "Could not convert " << point[i] << " to a coordinate"
<< endl;
return 1;
}
}
NekVector<NekDouble> input(nPoints);
for (int i = 0; i < nPoints; ++i)
{
input[i] = dim == 2 ? exp(r[i]) * exp(s[i]) :
exp(r[i]) * exp(s[i]) * exp(t[i]);
}
boost::shared_ptr<NekMatrix<NekDouble> > interp =
util->GetInterpolationMatrix(tmp);
NekVector<NekDouble> output = *interp * input;
NekDouble exact = dim == 2 ? exp(tmp[0][0]) * exp(tmp[1][0]) :
exp(tmp[0][0]) * exp(tmp[1][0]) * exp(tmp[2][0]);
cout << "L inf error : " << fabs(exact - output[0]) << endl;
}
else
{
cerr << "You must specify one of --integral, --deriv or --interp"
<< endl;
cerr << desc;
return 1;
}
return 0;
}
#include <iostream>
#include <iomanip>
using namespace std;
#include <LibUtilities/Foundations/NodalUtil.h>
#include <LibUtilities/Foundations/NodalTetElec.h>
#include <LibUtilities/Foundations/Foundations.hpp>
#include <LibUtilities/Foundations/Points.h>
using namespace Nektar;
using namespace boost;
using namespace Nektar::LibUtilities;
int main(int argc, char *argv[]){
// Argument check: Display a help message if the count is wrong
if(argc != 3)
{
cerr << "Usage: NodalTetElecDemo Points3D-Type nPtsPerSide" << endl;
cerr << "Where type is an integer value which dictates the basis as:" << endl;
for(int i=0; i<SIZE_PointsType; ++i)
{
cerr << setw(30) << kPointsTypeStr[i] << " =" << i << endl;
}
cerr << "Note type = 1 ~ 14 are for one dimensional basis, and 15 and 16 are for two dimensional basis " << endl;
cerr << "\n Example: NodalTetElecDemo 17 4" << endl;
cerr << "\n\t Tests 3D NodalTetElec on 4 points per side" << endl;
return 1; // Aborts main() function
}
// Read in the type for the points from the caller
PointsType pointsType = (PointsType) atoi(argv[1]);
if(pointsType == eNoPointsType)
{
cerr << "pointsType = " << pointsType << endl;
cerr << "kPointsTypeStr[" <<pointsType<< "]=" << kPointsTypeStr[pointsType] << endl;
ErrorUtil::Error(ErrorUtil::efatal,__FILE__, __LINE__,
"No Points Type requested",0);
}
// Read in the number of points per side at which the function will be evaluated
int nPtsPerSide = atoi(argv[2]);
// Show the set up to the user
cout << "Points Type: " << kPointsTypeStr[pointsType] << endl;
cout << "Number of points per side: " << nPtsPerSide << endl;
// Display the example test function to the user
if( pointsType == eNodalTetElec)
{
cout << "Uniform grid on a Tetrahedron points" << endl;
}
int degree = nPtsPerSide-1;
boost::shared_ptr<Points<NekDouble> > points = PointsManager()[PointsKey(nPtsPerSide, pointsType)];
NodalTetElec *nTete = dynamic_cast<NodalTetElec*>(points.get());
Array<OneD, const NekDouble> ax, ay, az;
nTete->GetPoints(ax,ay, az);
NekVector<NekDouble> x = ToVector(ax), y = ToVector(ay), z = ToVector(az);
// /////////////////////////////////////////////
// Test Interpolation
//
// Make a uniform grid on the Tetrahedron
int nGridPtsPerSide =6;
int nGridPts = nGridPtsPerSide * (nGridPtsPerSide + 1) * (nGridPtsPerSide + 2) / 6;