Commit aae2a832 by Spencer Sherwin

Merge branch 'feature/projection-meshing' into 'master'

feature/projection-meshing

See merge request !826
parents e2bd965e 46207821
......@@ -41,6 +41,7 @@ v5.0.0
- Update for the CAD system, more advance self-healing and analysis (!822)
- Additional curve types in GEO reader: BSpline, Circle, Ellipse (!800)
- Fix default command line argument value (!823)
- Add projection meshing module which can curve linear meshes with CAD (!826)
**FieldConvert**:
- Add input module for Semtex field files (!777)
......
......@@ -671,6 +671,21 @@ but the basic usage is:
where type can be \texttt{hyperelastic}, \texttt{linearelastic},
\texttt{winslow} or \texttt{roca}.
\subsection{Mesh projection}
This module can take any linear mesh, providing that it is a close
representation of the CAD and project the boundary of the mesh onto the CAD.
This will curve the surface of the mesh. The method has a number of failsafes
ensuring that even bad CAD or poor linear meshes should be able to be curved to
some degree. If the method encounters an issue, such as the linear mesh being a
large distance from the CAD, it will simply leave that element straight sided. A
well made CAD model and accurate linear mesh should be curved with little issue.
The module needs to be informed of the CAD file to project the mesh to and the
order at which to curve the surface:
\begin{lstlisting}[style=BashInputStyle]
NekMesh -m projectcad:file=cadfile.step:order=x inital.xml optimised.xml
\end{lstlisting}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......
......@@ -248,6 +248,11 @@ public:
return it->second;
}
}
/// Is this element connected to a boundary
NEKMESHUTILS_EXPORT bool HasBoundaryLinks()
{
return m_boundaryLinks.size() > 0;
}
/// Set the list of tags associated with this element.
NEKMESHUTILS_EXPORT void SetTagList(const std::vector<int> &tags)
{
......
......@@ -45,10 +45,7 @@ ENDIF (NEKTAR_USE_VTK)
IF (NEKTAR_USE_MESHGEN)
SET(NekMeshSources ${NekMeshSources}
ProcessModules/ProcessVarOpti/NodeOptiCAD.cpp
ProcessModules/ProcessVarOpti/ProcessVarOpti.cpp
ProcessModules/ProcessVarOpti/PreProcessing.cpp
ProcessModules/ProcessVarOpti/NodeOpti.cpp
ProcessModules/ProcessVarOpti/ElUtil.cpp
ProcessModules/ProcessProjectCAD.cpp
InputModules/InputMCF.cpp)
ENDIF (NEKTAR_USE_MESHGEN)
......
////////////////////////////////////////////////////////////////////////////////
//
// File: ProcessJac.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: Calculate jacobians of elements.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef UTILITIES_NEKMESH_PROCESSPROJECTCAD
#define UTILITIES_NEKMESH_PROCESSPROJECTCAD
#include <NekMeshUtils/Module/Module.h>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
typedef bg::model::point<float, 3, bg::cs::cartesian> point;
typedef bg::model::box<point> box;
typedef std::pair<box, unsigned> boxI;
namespace Nektar
{
namespace Utilities
{
class ProcessProjectCAD : public NekMeshUtils::ProcessModule
{
public:
/// Creates an instance of this class
static std::shared_ptr<Module> create(NekMeshUtils::MeshSharedPtr m)
{
return MemoryManager<ProcessProjectCAD>::AllocateSharedPtr(m);
}
static NekMeshUtils::ModuleKey className;
ProcessProjectCAD(NekMeshUtils::MeshSharedPtr m);
virtual ~ProcessProjectCAD();
/// Write mesh to output file.
virtual void Process();
private:
bool findAndProject(bgi::rtree<boxI, bgi::quadratic<16> > &rtree,
Array<OneD, NekDouble> in,
int &surf);
bool IsNotValid(std::vector<NekMeshUtils::ElementSharedPtr> &els);
};
}
}
#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 sign in to comment