move namespaces in meshing.hpp into headers

This commit is contained in:
Christopher Lackner 2023-09-04 13:43:47 +02:00
parent 78e92c76df
commit 95ca834605
55 changed files with 310 additions and 640 deletions

@ -1 +1 @@
Subproject commit 80dc998efced8ceb2be59756668a7e90e8bef917
Subproject commit db412e6e8648a5687d73ef4cf28738d1e7f0e53f

View File

@ -9,6 +9,8 @@
// Automatic differentiation datatype
namespace netgen
{
/**
Datatype for automatic differentiation.
@ -284,18 +286,6 @@ inline AutoDiff<D,SCAL> operator* (const AutoDiff<D,SCAL> & x, const AutoDiff<D,
return res;
}
/// AutoDiff times AutoDiff
template<int D, typename SCAL>
inline AutoDiff<D,SCAL> sqr (const AutoDiff<D,SCAL> & x) throw()
{
AutoDiff<D,SCAL> res;
SCAL hx = x.Value();
res.Value() = hx*hx;
hx *= 2;
for (int i = 0; i < D; i++)
res.DValue(i) = hx*x.DValue(i);
return res;
}
/// Inverse of AutoDiff
template<int D, typename SCAL>
@ -329,14 +319,28 @@ inline AutoDiff<D,SCAL> operator/ (double x, const AutoDiff<D,SCAL> & y)
return x * Inv(y);
}
} //namespace netgen
namespace std
{
/// AutoDiff times AutoDiff
template<int D, typename SCAL>
inline netgen::AutoDiff<D,SCAL> sqr (const netgen::AutoDiff<D,SCAL> & x) throw()
{
netgen::AutoDiff<D,SCAL> res;
SCAL hx = x.Value();
res.Value() = hx*hx;
hx *= 2;
for (int i = 0; i < D; i++)
res.DValue(i) = hx*x.DValue(i);
return res;
}
template<int D, typename SCAL>
inline AutoDiff<D,SCAL> fabs (const AutoDiff<D,SCAL> & x)
inline netgen::AutoDiff<D,SCAL> fabs (const netgen::AutoDiff<D,SCAL> & x)
{
double abs = fabs (x.Value());
AutoDiff<D,SCAL> res( abs );
netgen::AutoDiff<D,SCAL> res( abs );
if (abs != 0.0)
for (int i = 0; i < D; i++)
res.DValue(i) = x.DValue(i) / abs;
@ -346,6 +350,7 @@ inline AutoDiff<D,SCAL> fabs (const AutoDiff<D,SCAL> & x)
return res;
}
} //namespace std
//@}
#endif

View File

@ -7,12 +7,14 @@
/* Date: 01. Jun. 95 */
/**************************************************************************/
#include <core/array.hpp>
#include <core/archive.hpp>
namespace netgen
{
// template <class T, int B1, int B2> class IndirectArray;
template <class TA1, class TA2> class IndirectArray;
template <class TA1, class TA2> class NgIndirectArray;
@ -119,9 +121,9 @@ namespace netgen
}
template <typename T2, int B2>
IndirectArray<NgFlatArray, NgFlatArray<T2,B2> > operator[] (const NgFlatArray<T2,B2> & ia) const
NgIndirectArray<NgFlatArray, NgFlatArray<T2,B2> > operator[] (const NgFlatArray<T2,B2> & ia) const
{
return IndirectArray<NgFlatArray, NgFlatArray<T2,B2> > (*this, ia);
return NgIndirectArray<NgFlatArray, NgFlatArray<T2,B2> > (*this, ia);
}
@ -206,10 +208,10 @@ namespace netgen
return ( Pos(elem) >= 0 );
}
operator FlatArray<T> () const
operator ngcore::FlatArray<T> () const
{
static_assert (BASE==0);
return FlatArray<T>(size, data);
return ngcore::FlatArray<T>(size, data);
}
};
@ -422,7 +424,7 @@ namespace netgen
// Only provide this function if T is archivable
template<typename T2=T>
auto DoArchive(Archive& archive) -> typename std::enable_if<is_archivable<T2>, void>::type
auto DoArchive(ngcore::Archive& archive) -> typename std::enable_if<ngcore::is_archivable<T2>, void>::type
{
if(archive.Output())
archive << size;
@ -531,13 +533,13 @@ namespace netgen
*/
template <class TA1, class TA2>
class IndirectArray
class NgIndirectArray
{
const TA1 & array;
const TA2 & ia;
public:
IndirectArray (const TA1 & aa, const TA2 & aia)
NgIndirectArray (const TA1 & aa, const TA2 & aia)
: array(aa), ia(aia) { ; }
int Size() const { return ia.Size(); }
[[deprecated("Use *Range().begin() instead")]]
@ -553,7 +555,7 @@ namespace netgen
template <typename T1, typename T2>
inline ostream & operator<< (ostream & s, const IndirectArray<T1,T2> & ia)
inline ostream & operator<< (ostream & s, const NgIndirectArray<T1,T2> & ia)
{
for (int i = ia.Begin(); i < ia.End(); i++)
s << i << ": " << ia[i] << endl;

View File

@ -7,6 +7,10 @@
/* Date: 04. Apr. 97 */
/**************************************************************************/
#include <mydefs.hpp>
#include "ngarray.hpp"
namespace netgen
{

View File

@ -7,9 +7,11 @@
/* Date: 01. Jun. 95 */
/**************************************************************************/
#include <core/utils.hpp>
namespace netgen
{
using namespace ngcore;
/*
templates, global types, defines and variables
*/

View File

@ -7,7 +7,7 @@
namespace netgen
{
using namespace std;
using namespace ngcore;
using netgen::Point;
using netgen::Vec;

View File

@ -11,7 +11,7 @@ target_sources(nglib PRIVATE
install(FILES
adtree.hpp geom2d.hpp geom3d.hpp geomfuncs.hpp
geomobjects.hpp geomops2.hpp geomops.hpp geomtest3d.hpp gprim.hpp
geomobjects.hpp geomops.hpp geomtest3d.hpp gprim.hpp
splinegeometry.hpp spline.hpp transform3d.hpp
DESTINATION ${NG_INSTALL_DIR_INCLUDE}/gprim COMPONENT netgen_devel
)

View File

@ -8,6 +8,10 @@
/* Redesigned by Wolfram Muehlhuber, May 1998 */
/* *************************************************************************/
#include <general/optmem.hpp>
#include <general/template.hpp>
#include "geomfuncs.hpp"
namespace netgen
{

View File

@ -7,6 +7,12 @@
/* Date: 5. Aug. 95 */
/* *************************************************************************/
#include <mydefs.hpp>
#include <general/template.hpp>
#include "geomobjects.hpp"
#include <meshing/global.hpp>
namespace netgen
{
@ -15,7 +21,7 @@ namespace netgen
#define EPSGEOM 1E-5
// extern void MyError (const char * ch);
void MyError (const char * ch);
class Point2d;
class Vec2d;

View File

@ -7,6 +7,9 @@
/* Date: 5. Aug. 95 */
/* *************************************************************************/
#include <mydefs.hpp>
#include "geom2d.hpp"
namespace netgen
{

View File

@ -7,6 +7,8 @@
/* Date: 20. Jul. 02 */
/* *************************************************************************/
#include "geomobjects.hpp"
#include "geomops.hpp"
namespace netgen
{

View File

@ -7,10 +7,14 @@
/* Date: 20. Jul. 02 */
/* *************************************************************************/
#include <core/archive.hpp>
#include <core/array.hpp>
#include <general/ngarray.hpp>
namespace netgen
{
using namespace ngcore;
template <int D, typename T = double> class Vec;
template <int D, typename T = double> class Point;
@ -170,6 +174,26 @@ namespace netgen
Vec<D> GetNormal () const;
};
template <int D>
inline ostream & operator<< (ostream & ost, const Vec<D> & a)
{
ost << "(";
for (int i = 0; i < D-1; i++)
ost << a(i) << ", ";
ost << a(D-1) << ")";
return ost;
}
template <int D>
inline ostream & operator<< (ostream & ost, const Point<D> & a)
{
ost << "(";
for (int i = 0; i < D-1; i++)
ost << a(i) << ", ";
ost << a(D-1) << ")";
return ost;
}
template<int D>
inline Vec<D> operator-(const Point<D>& p1, const Point<D>& p2)
{
@ -338,7 +362,7 @@ namespace netgen
}
template <typename T1, typename T2>
void Set (const IndirectArray<T1, T2> & points)
void Set (const NgIndirectArray<T1, T2> & points)
{
// Set (points[points.Begin()]);
Set (points[*points.Range().begin()]);
@ -348,7 +372,7 @@ namespace netgen
}
template <typename T1, typename T2>
void Add (const IndirectArray<T1, T2> & points)
void Add (const NgIndirectArray<T1, T2> & points)
{
// for (int i = points.Begin(); i < points.End(); i++)
for (int i : points.Range())

View File

@ -1,428 +0,0 @@
#ifndef FILE_GEOMOPS
#define FILE_GEOMOPS
/* *************************************************************************/
/* File: geomops.hpp */
/* Author: Joachim Schoeberl */
/* Date: 20. Jul. 02 */
/* *************************************************************************/
/*
Point - Vector operations
*/
template <class TA, class TB>
class SumExpr : public VecExpr<SumExpr<TA, TB> >
{
const TA a;
const TB b;
public:
SumExpr (const TA aa, const TB ab) : a(aa), b(ab) { ; }
double operator() (int i) const { return a(i) + b(i); }
};
template <typename TA, typename TB>
inline SumExpr<TA,TB>
operator+ (const VecExpr<TA> & a, const VecExpr<TB> & b)
{
return SumExpr<TA,TB> (static_cast <const TA&> (a), static_cast <const TB&> (b));
}
/*
template <int D1, int D2>
inline SumExpr<const Vec<D1>&, const Vec<D2>&>
operator+ (const Vec<D1> & a, const Vec<D2> & b)
{
return SumExpr<const Vec<D1>&, const Vec<D2>&> (a, b);
}
*/
/*
template <int D>
inline Vec<D> operator+ (const Vec<D> & a, const Vec<D> & b)
{
Vec<D> res;
for (int i = 0; i < D; i++)
res(i) = a(i) + b(i);
return res;
}
*/
template <int D>
inline Point<D> operator+ (const Point<D> & a, const Vec<D> & b)
{
Point<D> res;
for (int i = 0; i < D; i++)
res(i) = a(i) + b(i);
return res;
}
template <int D>
inline Vec<D> operator- (const Point<D> & a, const Point<D> & b)
{
Vec<D> res;
for (int i = 0; i < D; i++)
res(i) = a(i) - b(i);
return res;
}
template <int D>
inline Point<D> operator- (const Point<D> & a, const Vec<D> & b)
{
Point<D> res;
for (int i = 0; i < D; i++)
res(i) = a(i) - b(i);
return res;
}
template <int D>
inline Vec<D> operator- (const Vec<D> & a, const Vec<D> & b)
{
Vec<D> res;
for (int i = 0; i < D; i++)
res(i) = a(i) - b(i);
return res;
}
template <int D>
inline Vec<D> operator* (double s, const Vec<D> & b)
{
Vec<D> res;
for (int i = 0; i < D; i++)
res(i) = s * b(i);
return res;
}
template <int D>
inline double operator* (const Vec<D> & a, const Vec<D> & b)
{
double sum = 0;
for (int i = 0; i < D; i++)
sum += a(i) * b(i);
return sum;
}
template <int D>
inline Vec<D> operator- (const Vec<D> & b)
{
Vec<D> res;
for (int i = 0; i < D; i++)
res(i) = -b(i);
return res;
}
template <int D>
inline Point<D> & operator+= (Point<D> & a, const Vec<D> & b)
{
for (int i = 0; i < D; i++)
a(i) += b(i);
return a;
}
template <int D, typename T>
inline Point<D> & operator+= (Point<D> & a, const VecExpr<T> & b)
{
for (int i = 0; i < D; i++)
a(i) += b(i);
return a;
}
template <int D>
inline Vec<D> & operator+= (Vec<D> & a, const Vec<D> & b)
{
for (int i = 0; i < D; i++)
a(i) += b(i);
return a;
}
template <int D>
inline Point<D> & operator-= (Point<D> & a, const Vec<D> & b)
{
for (int i = 0; i < D; i++)
a(i) -= b(i);
return a;
}
template <int D, typename T>
inline Point<D> & operator-= (Point<D> & a, const VecExpr<T> & b)
{
for (int i = 0; i < D; i++)
a(i) -= b(i);
return a;
}
template <int D>
inline Vec<D> & operator-= (Vec<D> & a, const Vec<D> & b)
{
for (int i = 0; i < D; i++)
a(i) -= b(i);
return a;
}
template <int D>
inline Vec<D> & operator*= (Vec<D> & a, double s)
{
for (int i = 0; i < D; i++)
a(i) *= s;
return a;
}
template <int D>
inline Vec<D> & operator/= (Vec<D> & a, double s)
{
for (int i = 0; i < D; i++)
a(i) /= s;
return a;
}
// Matrix - Vector operations
/*
template <int H, int W>
inline Vec<H> operator* (const Mat<H,W> & m, const Vec<W> & v)
{
Vec<H> res;
for (int i = 0; i < H; i++)
{
res(i) = 0;
for (int j = 0; j < W; j++)
res(i) += m(i,j) * v(j);
}
return res;
}
*/
// thanks to VC60 partial template specialization features !!!
inline Vec<2> operator* (const Mat<2,2> & m, const Vec<2> & v)
{
Vec<2> res;
for (int i = 0; i < 2; i++)
{
res(i) = 0;
for (int j = 0; j < 2; j++)
res(i) += m(i,j) * v(j);
}
return res;
}
inline Vec<2> operator* (const Mat<2,3> & m, const Vec<3> & v)
{
Vec<2> res;
for (int i = 0; i < 2; i++)
{
res(i) = 0;
for (int j = 0; j < 3; j++)
res(i) += m(i,j) * v(j);
}
return res;
}
inline Vec<3> operator* (const Mat<3,2> & m, const Vec<2> & v)
{
Vec<3> res;
for (int i = 0; i < 3; i++)
{
res(i) = 0;
for (int j = 0; j < 2; j++)
res(i) += m(i,j) * v(j);
}
return res;
}
inline Vec<3> operator* (const Mat<3,3> & m, const Vec<3> & v)
{
Vec<3> res;
for (int i = 0; i < 3; i++)
{
res(i) = 0;
for (int j = 0; j < 3; j++)
res(i) += m(i,j) * v(j);
}
return res;
}
/*
template <int H1, int W1, int H2, int W2>
inline Mat<H1,W2> operator* (const Mat<H1,W1> & a, const Mat<H2,W2> & b)
{
Mat<H1,W2> m;
for (int i = 0; i < H1; i++)
for (int j = 0; j < W2; j++)
{
double sum = 0;
for (int k = 0; k < W1; k++)
sum += a(i,k) * b(k, j);
m(i,j) = sum;
}
return m;
}
*/
inline Mat<2,2> operator* (const Mat<2,2> & a, const Mat<2,2> & b)
{
Mat<2,2> m;
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++)
{
double sum = 0;
for (int k = 0; k < 2; k++)
sum += a(i,k) * b(k, j);
m(i,j) = sum;
}
return m;
}
inline Mat<2,2> operator* (const Mat<2,3> & a, const Mat<3,2> & b)
{
Mat<2,2> m;
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++)
{
double sum = 0;
for (int k = 0; k < 3; k++)
sum += a(i,k) * b(k, j);
m(i,j) = sum;
}
return m;
}
inline Mat<3,2> operator* (const Mat<3,2> & a, const Mat<2,2> & b)
{
Mat<3,2> m;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 2; j++)
{
double sum = 0;
for (int k = 0; k < 2; k++)
sum += a(i,k) * b(k, j);
m(i,j) = sum;
}
return m;
}
inline Mat<3,3> operator* (const Mat<3,3> & a, const Mat<3,3> & b)
{
Mat<3,3> m;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
{
double sum = 0;
for (int k = 0; k < 3; k++)
sum += a(i,k) * b(k, j);
m(i,j) = sum;
}
return m;
}
template <int H, int W>
inline Mat<W,H> Trans (const Mat<H,W> & m)
{
Mat<W,H> res;
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++)
res(j,i) = m(i,j);
return res;
}
template <int D>
inline ostream & operator<< (ostream & ost, const Vec<D> & a)
{
ost << "(";
for (int i = 0; i < D-1; i++)
ost << a(i) << ", ";
ost << a(D-1) << ")";
return ost;
}
template <int D>
inline ostream & operator<< (ostream & ost, const Point<D> & a)
{
ost << "(";
for (int i = 0; i < D-1; i++)
ost << a(i) << ", ";
ost << a(D-1) << ")";
return ost;
}
template <int D>
inline ostream & operator<< (ostream & ost, const Box<D> & b)
{
ost << b.PMin() << " - " << b.PMax();
return ost;
}
template <int H, int W>
inline ostream & operator<< (ostream & ost, const Mat<H,W> & m)
{
ost << "(";
for (int i = 0; i < H; i++)
{
for (int j = 0; j < W; j++)
ost << m(i,j) << " ";
ost << endl;
}
return ost;
}
#endif

View File

@ -7,6 +7,8 @@
/* Date: 13. Feb. 98 */
/* *************************************************************************/
#include "geom3d.hpp"
#include "geomobjects.hpp"
namespace netgen
{

View File

@ -11,6 +11,9 @@
Affine - Linear mapping in 3D space
*/
#include "geom3d.hpp"
#include "geomfuncs.hpp"
namespace netgen
{

View File

@ -11,7 +11,11 @@
Data type dense matrix
*/
#include <mydefs.hpp>
#include "vector.hpp"
namespace netgen
{
class DenseMatrix
{
protected:
@ -406,5 +410,5 @@ extern ostream & operator<< (ostream & ost, const MatrixFixWidth<WIDTH> & m)
extern DLL_HEADER void CalcAtA (const DenseMatrix & a, DenseMatrix & m2);
extern DLL_HEADER void CalcInverse (const DenseMatrix & m1, DenseMatrix & m2);
} // namespace netgen
#endif

View File

@ -21,12 +21,9 @@
#include "../include/myadt.hpp"
namespace netgen
{
#include "vector.hpp"
#include "densemat.hpp"
#include "polynomial.hpp"
}
#endif

View File

@ -7,6 +7,8 @@
/* Date: 25. Nov. 99 */
/* *************************************************************************/
namespace netgen
{
class QuadraticPolynomial1V
{
@ -41,5 +43,5 @@ public:
double MaxUnitSquare ();
double MaxUnitTriangle ();
};
} // namespace netgen
#endif

View File

@ -7,8 +7,11 @@
/* Date: 01. Oct. 94 */
/* *************************************************************************/
#include <core/archive.hpp>
namespace netgen
{
using namespace ngcore;
template <typename T>
class TFlatVector
@ -209,7 +212,7 @@ inline ostream & operator<< (ostream & ost, const FlatVector & v)
return ost;
}
} //namespace netgen
#endif

View File

@ -3,8 +3,9 @@
*/
#include <mystdlib.h>
#include "meshing.hpp"
#include <gprim/geom2d.hpp>
#include <gprim/geomfuncs.hpp>
#include "adfront2.hpp"
namespace netgen
{

View File

@ -1,5 +1,5 @@
#ifndef FILE_ADFRONT2
#define FILE_ADFRONT2
#ifndef NETGEN_ADFRONT2_HPP
#define NETGEN_ADFRONT2_HPP
/**************************************************************************/
/* File: adfront2.hpp */
@ -14,6 +14,12 @@
*/
#include <gprim/geomobjects.hpp>
#include <gprim/adtree.hpp>
#include "meshtype.hpp"
namespace netgen
{
///
class FrontPoint2
{
@ -275,9 +281,5 @@ public:
void PrintOpenSegments (ostream & ost) const;
};
#endif
} // namespace netgen
#endif // NETGEN_ADFRONT2_HPP

View File

@ -1,6 +1,7 @@
#include <mystdlib.h>
#include "meshing.hpp"
#include <gprim/geomtest3d.hpp>
#include "adfront3.hpp"
/* ********************** FrontPoint ********************** */

View File

@ -11,7 +11,13 @@
Advancing front class for volume meshing
*/
#include <gprim/geomobjects.hpp>
#include <gprim/adtree.hpp>
#include "meshtype.hpp"
#include "geomsearch.hpp"
namespace netgen
{
/// Point in advancing front
class FrontPoint3
@ -315,7 +321,5 @@ private:
void RebuildInternalTables();
};
} // namespace netgen
#endif

View File

@ -7,10 +7,18 @@
/* Date: 23. Aug. 09 */
/**************************************************************************/
#include <gprim/geomobjects.hpp>
#include <gprim/transform3d.hpp>
#include "meshtype.hpp"
#include "meshclass.hpp"
struct Tcl_Interp;
namespace netgen
{
class Refinement;
struct ShapeProperties
{
optional<string> name;

View File

@ -1,5 +1,7 @@
#include <mystdlib.h>
#include "meshing.hpp"
#include <core/array.hpp>
#include "bisect.hpp"
#include "validate.hpp"
#define noDEBUG

View File

@ -1,5 +1,13 @@
#ifndef BISECT
#define BISECT
#ifndef NETGEN_BISECT_HPP
#define NETGEN_BISECT_HPP
#include <mydefs.hpp>
#include <general/parthreads.hpp>
#include "basegeom.hpp"
#include "meshclass.hpp"
namespace netgen
{
class BisectionOptions
{
@ -59,4 +67,6 @@ public:
virtual void LocalizeEdgePoints(Mesh & /* mesh */) const {;}
};
#endif
} // namespace netgen
#endif // NETGEN_BISECT_HPP

View File

@ -1,10 +1,14 @@
#include <mystdlib.h>
#include "meshing.hpp"
#include "debugging.hpp"
#include "global.hpp"
#include <set>
#include <regex>
#include <mystdlib.h>
#include "global.hpp"
#include "debugging.hpp"
#include "boundarylayer.hpp"
#include "meshfunc.hpp"
namespace netgen
{

View File

@ -1,6 +1,8 @@
#ifndef FILE_BOUNDARYLAYER
#define FILE_BOUNDARYLAYER
#ifndef NETGEN_BOUNDARYLAYER_HPP
#define NETGEN_BOUNDARYLAYER_HPP
namespace netgen
{
///
DLL_HEADER extern void InsertVirtualBoundaryLayer (Mesh & mesh);
@ -88,4 +90,5 @@ class BoundaryLayerTool
Vec<3> getEdgeTangent(PointIndex pi, int edgenr);
};
#endif
} // namespace netgen
#endif // NETGEN_BOUNDARYLAYER_HPP

View File

@ -1,6 +1,6 @@
#include <mystdlib.h>
#include "meshing.hpp"
#include "clusters.hpp"
namespace netgen
{

View File

@ -1,5 +1,5 @@
#ifndef CLUSTERS
#define CLUSTERS
#ifndef NETGEN_CLUSTERS_HPP
#define NETGEN_CLUSTERS_HPP
/**************************************************************************/
/* File: clusers.hh */
@ -13,6 +13,10 @@
nodes, edges, faces, elements
*/
#include "meshclass.hpp"
namespace netgen
{
class AnisotropicClusters
{
@ -38,5 +42,5 @@ public:
int GetElementRepresentant (int enr) const
{ return cluster_reps.Get(nv+ned+nfa+enr); }
};
#endif
} // namespace netgen
#endif // NETGEN_CLUSTERS_HPP

View File

@ -7,9 +7,8 @@
namespace netgen
{
using namespace std;
// bool rational = true;
static void ComputeGaussRule (int n, NgArray<double> & xi, NgArray<double> & wi)
{
xi.SetSize (n);

View File

@ -1,5 +1,5 @@
#ifndef CURVEDELEMS
#define CURVEDELEMS
#ifndef NETGEN_CURVEDELEMS_HPP
#define NETGEN_CURVEDELEMS_HPP
/**************************************************************************/
/* File: curvedelems.hpp */
@ -8,11 +8,16 @@
/* Date: 27. Sep. 02, Feb 2006 */
/**************************************************************************/
#include <mydefs.hpp>
#include <general/ngarray.hpp>
#include <gprim/geomobjects.hpp>
#include "meshtype.hpp"
namespace netgen
{
class Refinement;
class Mesh;
class CurvedElements
{
@ -259,6 +264,5 @@ private:
bool EvaluateMapping (SurfaceElementInfo & info, const Point<2,T> xi, Point<DIM_SPACE,T> & x, Mat<DIM_SPACE,2,T> & jac) const;
};
#endif
} //namespace netgen
#endif // NETGEN_CURVEDELEMS_HPP

View File

@ -6,6 +6,7 @@
namespace netgen
{
using namespace std;
void DelaunayTrig::CalcCenter (FlatArray<Point<2>, PointIndex> points)
{
Point<2> p1 = points[pnums[0]];

View File

@ -1,6 +1,10 @@
#ifndef NETGEN_FINDIP_HPP
#define NETGEN_FINDIP_HPP
// find inner point
namespace netgen
{
inline void Minimize (const NgArray<Vec3d> & a,
const NgArray<double> & c,
@ -188,5 +192,7 @@ inline int FindInnerPoint (POINTArray & points,
return (f < -1e-5 * hmax);
}
} // namespace netgen
#endif // FILE_FINDINNERPOINT_HPP

View File

@ -1,5 +1,11 @@
#ifndef NETGEN_FINDIP2_HPP
#define NETGEN_FINDIP2_HPP
// find inner point
namespace netgen
{
template <typename POINTArray, typename FACEArray>
inline int FindInnerPoint2 (POINTArray & points,
FACEArray & faces,
@ -93,3 +99,5 @@ inline int FindInnerPoint2 (POINTArray & points,
return (fmin < -1e-3 * hmax);
}
} // namespace netgen
#endif // NETGEN_FINDIP2_HPP

View File

@ -1,5 +1,6 @@
#include <mystdlib.h>
#include "meshing.hpp"
#include "geomsearch.hpp"
#include "adfront3.hpp"
namespace netgen

View File

@ -1,5 +1,5 @@
#ifndef FILE_GEOMSEARCH
#define FILE_GEOMSEARCH
#ifndef NETGEN_GEOMSEARCH_HPP
#define NETGEN_GEOMSEARCH_HPP
/**************************************************************************/
/* File: geomsearch.hh */
@ -7,6 +7,11 @@
/* Date: 19. Nov. 97 */
/**************************************************************************/
#include "meshtype.hpp"
namespace netgen
{
class FrontPoint3;
class FrontFace;
class MiniElement2d;
@ -60,58 +65,5 @@ private:
int reset;
int hashcount;
};
#endif
} // namespace netgen
#endif // NETGEN_GEOMSEARCH_HPP

View File

@ -1,11 +1,12 @@
#include <mystdlib.h>
#include "meshing.hpp"
#include "global.hpp"
#include <netgen_version.hpp>
#include "msghandler.hpp"
#include "meshtype.hpp"
namespace netgen
{
class NetgenGeometry;
class TraceGlobal
{
string name;

View File

@ -1,5 +1,5 @@
#ifndef FILE_GLOBAL
#define FILE_GLOBAL
#ifndef NETGEN_GLOBAL_HPP
#define NETGEN_GLOBAL_HPP
/**************************************************************************/
@ -12,9 +12,11 @@
global functions and variables
*/
#include <mydefs.hpp>
namespace netgen
{
using namespace ngcore;
///
DLL_HEADER extern double GetTime ();
DLL_HEADER extern void ResetTime ();
@ -47,6 +49,9 @@ namespace netgen
DLL_HEADER extern volatile multithreadt multithread;
class DebugParameters;
class Mesh;
DLL_HEADER extern string ngdir;
DLL_HEADER extern DebugParameters debugparam;
DLL_HEADER extern bool verbose;
@ -61,6 +66,6 @@ namespace netgen
// global communicator for netgen (dummy if no MPI)
// extern DLL_HEADER NgMPI_Comm ng_comm;
}
} // namespace netgen
#endif
#endif // NETGEN_GLOBAL_HPP

View File

@ -1,6 +1,5 @@
#include <mystdlib.h>
#include "meshing.hpp"
#include "hprefinement.hpp"
namespace netgen
{

View File

@ -11,7 +11,11 @@
HP Refinement
*/
#include "bisect.hpp"
#include "meshtype.hpp"
namespace netgen
{
enum HPREF_ELEMENT_TYPE {
@ -324,5 +328,6 @@ inline void HPRefinement (Mesh & mesh, Refinement * ref, int levels,
HPRefinement (mesh, ref, SPLIT_HP, levels, fac1, setorders, ref_level);
}
} // namespace netgen
#endif

View File

@ -1,5 +1,10 @@
#ifndef FILE_IMPROVE2
#define FILE_IMPROVE2
#ifndef NETGEN_IMPROVE2_HPP
#define NETGEN_IMPROVE2_HPP
#include "meshtype.hpp"
namespace netgen
{
inline void AppendEdges( const Element2d & elem, PointIndex pi, Array<std::tuple<PointIndex,PointIndex>> & edges )
{
@ -169,7 +174,5 @@ extern double CalcTriangleBadness (const Point<3> & p1,
const Vec<3> & n,
double metricweight,
double h);
#endif
} // namespace netgen
#endif // NETGEN_IMPROVE2_HPP

View File

@ -1,6 +1,8 @@
#ifndef FILE_IMPROVE3
#define FILE_IMPROVE3
namespace netgen
{
extern double CalcTotalBad (const Mesh::T_POINTS & points,
const Array<Element, ElementIndex> & elements,
@ -136,6 +138,5 @@ public:
inline void UnSetNV(void) {onplane = false;}
};
} // namespace netgen
#endif

View File

@ -5,6 +5,7 @@
#include "../general/gzstream.h"
#include <core/register_archive.hpp>
#include "basegeom.hpp"
namespace netgen
{
@ -292,6 +293,12 @@ namespace netgen
// #endif
}
shared_ptr<NetgenGeometry> Mesh :: GetGeometry() const
{
static auto global_geometry = make_shared<NetgenGeometry>();
return geometry ? geometry : global_geometry;
}
void Mesh :: SetCommunicator(NgMPI_Comm acomm)
{
this->comm = acomm;

View File

@ -1,5 +1,5 @@
#ifndef MESHCLASS
#define MESHCLASS
#ifndef NETGEN_MESHCLASS_HPP
#define NETGEN_MESHCLASS_HPP
/**************************************************************************/
/* File: meshclass.hpp */
@ -13,8 +13,16 @@
#include<filesystem>
#include <gprim/adtree.hpp>
#include <gprim/transform3d.hpp>
#include "meshtype.hpp"
#include "localh.hpp"
#include "topology.hpp"
namespace netgen
{
class NetgenGeometry;
using namespace std;
static constexpr int MPI_TAG_MESH = 210;
@ -874,11 +882,7 @@ namespace netgen
NgMutex & MajorMutex () { return majormutex; }
shared_ptr<NetgenGeometry> GetGeometry() const
{
static auto global_geometry = make_shared<NetgenGeometry>();
return geometry ? geometry : global_geometry;
}
DLL_HEADER shared_ptr<NetgenGeometry> GetGeometry() const;
void SetGeometry (shared_ptr<NetgenGeometry> geom)
{
geometry = geom;
@ -993,6 +997,4 @@ namespace netgen
}
#endif
#endif // NETGEN_MESHCLASS_HPP

View File

@ -7,7 +7,12 @@
/* Date: 26. Jan. 98 */
/**************************************************************************/
#include <mydefs.hpp>
#include "meshing3.hpp"
#include "meshtype.hpp"
namespace netgen
{
/*
Functions for mesh-generations strategies
*/
@ -36,6 +41,6 @@ enum MESHING_STEP {
MESHCONST_MESHVOLUME = 5,
MESHCONST_OPTVOLUME = 6
};
} // namespace netgen
#endif

View File

@ -15,6 +15,7 @@ namespace netgen
// extern int printmessage_importance;
// class CSGeometry;
using namespace std;
class NetgenGeometry;
}
@ -26,12 +27,12 @@ namespace netgen
#include "meshclass.hpp"
#include "global.hpp"
namespace netgen
{
#include "meshtool.hpp"
#include "ruler2.hpp"
#include "adfront2.hpp"
#include "meshing2.hpp"
#include "improve2.hpp"
@ -40,8 +41,6 @@ namespace netgen
#include "adfront3.hpp"
#include "ruler3.hpp"
#define _INCLUDE_MORE
#include "findip.hpp"
#include "findip2.hpp"
@ -50,21 +49,17 @@ namespace netgen
#include "curvedelems.hpp"
#include "clusters.hpp"
#include "meshfunc.hpp"
#include "bisect.hpp"
#include "hprefinement.hpp"
#include "boundarylayer.hpp"
#include "specials.hpp"
}
#include "validate.hpp"
#include "basegeom.hpp"
#include "surfacegeom.hpp"
#include "paralleltop.hpp"
#endif

View File

@ -1,5 +1,5 @@
#ifndef FILE_MESHING2
#define FILE_MESHING2
#ifndef NETGEN_MESHING2_HPP
#define NETGEN_MESHING2_HPP
/**************************************************************************/
/* File: meshing2.hpp */
@ -7,6 +7,8 @@
/* Date: 01. Okt. 95 */
/**************************************************************************/
namespace netgen
{
enum MESHING2_RESULT
@ -151,19 +153,6 @@ protected:
};
} // namespace netgen
#endif
#endif // NETGEN_MESHING2_HPP

View File

@ -1,8 +1,11 @@
#ifndef FILE_MESHING3
#define FILE_MESHING3
#include "adfront3.hpp"
#include "ruler3.hpp"
namespace netgen
{
enum MESHING3_RESULT
{
@ -114,18 +117,6 @@ extern int FindInnerPoint (POINTArray & grouppoints,
*/
} // namespace netgen
#endif

View File

@ -1,7 +1,13 @@
#ifndef FILE_MESHTOOL
#define FILE_MESHTOOL
#ifndef NETGEN_MESHTOOL_HPP
#define NETGEN_MESHTOOL_HPP
// #include "../general/ngarray.hpp"
// #include "../gprim/geom3d.hpp"
// #include "../gprim/geomobjects.hpp"
// #include "meshtype.hpp"
// #include "meshclass.hpp"
namespace netgen {
///
extern void MeshQuality2d (const Mesh & mesh);
@ -78,4 +84,6 @@ extern int CheckSurfaceMesh2 (const Mesh & mesh);
extern int CheckMesh3D (const Mesh & mesh);
///
extern void RemoveProblem (Mesh & mesh, int domainnr);
#endif
} // namespace netgen
#endif // NETGEN_MESHTOOL_HPP

View File

@ -8,6 +8,13 @@
/* Date: 01. Okt. 95 */
/**************************************************************************/
#include <mydefs.hpp>
#include <general/template.hpp>
#include <gprim/geom3d.hpp>
#include <linalg.hpp>
#include "msghandler.hpp"
namespace netgen
{

View File

@ -7,6 +7,8 @@
/* Date: 20. Nov. 99 */
/**************************************************************************/
#include <general/mystring.hpp>
namespace netgen
{

View File

@ -1,6 +1,8 @@
#ifndef FILE_NETRULE
#define FILE_NETRULE
namespace netgen
{
///
class netrule
{
@ -165,5 +167,6 @@ public:
/** Draws 2D rules.
Visual testing of 2D meshing rules */
extern void DrawRules ();
} // namespace netgen
#endif

View File

@ -1,6 +1,8 @@
#ifndef FILE_RULER3
#define FILE_RULER3
namespace netgen
{
/**
3D element generation rule.
@ -204,7 +206,6 @@ public:
// friend void Plot3DRule (const ROT3D & r, char key);
};
} // namespace netgen
#endif

View File

@ -7,10 +7,11 @@
*/
namespace netgen {
///
DLL_HEADER extern void CutOffAndCombine (Mesh & mesh, const Mesh & othermesh);
DLL_HEADER extern void HelmholtzMesh (Mesh & mesh);
} // namespace netgen
#endif