diff --git a/libsrc/core/register_archive.hpp b/libsrc/core/register_archive.hpp index 80f46fc0..7fbc4c87 100644 --- a/libsrc/core/register_archive.hpp +++ b/libsrc/core/register_archive.hpp @@ -63,11 +63,11 @@ namespace ngcore { return typeid(T) == ti ? nT : Archive::Caster::tryUpcast(ti, nT); }; - info.upcaster = [/*this*/](const std::type_info& ti, void* p) -> void* + info.upcaster = [](const std::type_info& ti, void* p) -> void* { return typeid(T) == ti ? p : Archive::Caster::tryUpcast(ti, static_cast(p)); }; - info.downcaster = [/*this*/](const std::type_info& ti, void* p) -> void* + info.downcaster = [](const std::type_info& ti, void* p) -> void* { return typeid(T) == ti ? p : Archive::Caster::tryDowncast(ti, p); }; - info.cargs_archiver = [this](Archive &ar, void* p) { + info.cargs_archiver = [](Archive &ar, void* p) { if constexpr(detail::has_GetCArgs_v) ar << static_cast(p)->GetCArgs(); }; diff --git a/libsrc/general/autodiff.hpp b/libsrc/general/autodiff.hpp index e2ba63d0..c7f0e269 100644 --- a/libsrc/general/autodiff.hpp +++ b/libsrc/general/autodiff.hpp @@ -9,6 +9,8 @@ // Automatic differentiation datatype +namespace netgen +{ /** Datatype for automatic differentiation. @@ -284,18 +286,6 @@ inline AutoDiff operator* (const AutoDiff & x, const AutoDiff -inline AutoDiff sqr (const AutoDiff & x) throw() -{ - AutoDiff 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 @@ -329,14 +319,31 @@ inline AutoDiff operator/ (double x, const AutoDiff & y) return x * Inv(y); } +} // namespace netgen - - +namespace ngcore +{ +/// AutoDiff times AutoDiff template -inline AutoDiff fabs (const AutoDiff & x) +inline netgen::AutoDiff sqr (const netgen::AutoDiff & x) throw() +{ + netgen::AutoDiff 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; +} +} // namespace ngcore + +namespace std +{ +template +inline netgen::AutoDiff fabs (const netgen::AutoDiff & x) { double abs = fabs (x.Value()); - AutoDiff res( abs ); + netgen::AutoDiff res( abs ); if (abs != 0.0) for (int i = 0; i < D; i++) res.DValue(i) = x.DValue(i) / abs; @@ -345,7 +352,5 @@ inline AutoDiff fabs (const AutoDiff & x) res.DValue(i) = 0.0; return res; } - -//@} - +} // namespace std #endif diff --git a/libsrc/general/hashtabl.hpp b/libsrc/general/hashtabl.hpp index 34c3f641..ce13a7b7 100644 --- a/libsrc/general/hashtabl.hpp +++ b/libsrc/general/hashtabl.hpp @@ -7,6 +7,8 @@ /* Date: 01. Jun. 95 */ /**************************************************************************/ +#include "table.hpp" + namespace netgen { @@ -1410,7 +1412,7 @@ inline size_t HashValue (INDEX_3 i3, size_t size) { return (i3[0]+15*size_t(i3[1 The array should be allocated with the double size of the expected number of entries. */ template - class ClosedHashTable + class NgClosedHashTable { protected: /// @@ -1423,16 +1425,16 @@ inline size_t HashValue (INDEX_3 i3, size_t size) { return (i3[0]+15*size_t(i3[1 NgArray cont; public: /// - ClosedHashTable (size_t asize = 128) + NgClosedHashTable (size_t asize = 128) : size(asize), used(0), hash(asize), cont(asize) { for (auto & v : hash) SetInvalid(v); } - ClosedHashTable (ClosedHashTable && ht2) = default; + NgClosedHashTable (NgClosedHashTable && ht2) = default; - ClosedHashTable (NgFlatArray _hash, NgFlatArray _cont) + NgClosedHashTable (NgFlatArray _hash, NgFlatArray _cont) : size(_hash.Size()), used(0), hash(_hash.Size(), _hash.Addr(0)), cont(_cont.Size(), _cont.Addr(0)) { for (auto & v : hash) @@ -1440,7 +1442,7 @@ inline size_t HashValue (INDEX_3 i3, size_t size) { return (i3[0]+15*size_t(i3[1 } - ClosedHashTable & operator= (ClosedHashTable && ht2) = default; + NgClosedHashTable & operator= (NgClosedHashTable && ht2) = default; /// size_t Size() const @@ -1474,7 +1476,7 @@ inline size_t HashValue (INDEX_3 i3, size_t size) { return (i3[0]+15*size_t(i3[1 void DoubleSize() { - ClosedHashTable tmp(2*Size()); + NgClosedHashTable tmp(2*Size()); for (auto both : *this) tmp[both.first] = both.second; *this = std::move(tmp); @@ -1609,10 +1611,10 @@ inline size_t HashValue (INDEX_3 i3, size_t size) { return (i3[0]+15*size_t(i3[1 class Iterator { - const ClosedHashTable & tab; + const NgClosedHashTable & tab; size_t nr; public: - Iterator (const ClosedHashTable & _tab, size_t _nr) + Iterator (const NgClosedHashTable & _tab, size_t _nr) : tab(_tab), nr(_nr) { while (nr < tab.Size() && !tab.UsedPos(nr)) nr++; @@ -1639,7 +1641,7 @@ inline size_t HashValue (INDEX_3 i3, size_t size) { return (i3[0]+15*size_t(i3[1 template ostream & operator<< (ostream & ost, - const ClosedHashTable & tab) + const NgClosedHashTable & tab) { for (size_t i = 0; i < tab.Size(); i++) if (tab.UsedPos(i)) diff --git a/libsrc/general/ngarray.hpp b/libsrc/general/ngarray.hpp index 6e244ec8..e84d9838 100644 --- a/libsrc/general/ngarray.hpp +++ b/libsrc/general/ngarray.hpp @@ -7,12 +7,13 @@ /* Date: 01. Jun. 95 */ /**************************************************************************/ +#include namespace netgen { // template class IndirectArray; - template class IndirectArray; + template class NgIndirectArray; @@ -119,9 +120,9 @@ namespace netgen } template - IndirectArray > operator[] (const NgFlatArray & ia) const + NgIndirectArray > operator[] (const NgFlatArray & ia) const { - return IndirectArray > (*this, ia); + return NgIndirectArray > (*this, ia); } @@ -206,10 +207,10 @@ namespace netgen return ( Pos(elem) >= 0 ); } - operator FlatArray () const + operator ngcore::FlatArray () const { static_assert (BASE==0); - return FlatArray(size, data); + return ngcore::FlatArray(size, data); } }; @@ -421,8 +422,9 @@ namespace netgen } // Only provide this function if T is archivable - template - auto DoArchive(Archive& archive) -> typename std::enable_if, void>::type + template + auto DoArchive(ARCHIVE& archive) + -> typename std::enable_if_t, void> { if(archive.Output()) archive << size; @@ -531,13 +533,13 @@ namespace netgen */ template - 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 - inline ostream & operator<< (ostream & s, const IndirectArray & ia) + inline ostream & operator<< (ostream & s, const NgIndirectArray & ia) { for (int i = ia.Begin(); i < ia.End(); i++) s << i << ": " << ia[i] << endl; diff --git a/libsrc/general/optmem.hpp b/libsrc/general/optmem.hpp index b2be31d3..f566ca14 100644 --- a/libsrc/general/optmem.hpp +++ b/libsrc/general/optmem.hpp @@ -7,6 +7,10 @@ /* Date: 04. Apr. 97 */ /**************************************************************************/ +#include + +#include "ngarray.hpp" + namespace netgen { diff --git a/libsrc/general/template.hpp b/libsrc/general/template.hpp index 61166f54..ccb35ab7 100644 --- a/libsrc/general/template.hpp +++ b/libsrc/general/template.hpp @@ -7,9 +7,11 @@ /* Date: 01. Jun. 95 */ /**************************************************************************/ +#include + namespace netgen { - + using namespace ngcore; /* templates, global types, defines and variables */ diff --git a/libsrc/geom2d/csg2d.hpp b/libsrc/geom2d/csg2d.hpp index 737c6afb..63acefee 100644 --- a/libsrc/geom2d/csg2d.hpp +++ b/libsrc/geom2d/csg2d.hpp @@ -7,7 +7,7 @@ namespace netgen { - +using namespace std; using namespace ngcore; using netgen::Point; using netgen::Vec; diff --git a/libsrc/gprim/CMakeLists.txt b/libsrc/gprim/CMakeLists.txt index b23480a4..2cd38884 100644 --- a/libsrc/gprim/CMakeLists.txt +++ b/libsrc/gprim/CMakeLists.txt @@ -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 ) diff --git a/libsrc/gprim/adtree.hpp b/libsrc/gprim/adtree.hpp index 594cf76d..c0abcb47 100644 --- a/libsrc/gprim/adtree.hpp +++ b/libsrc/gprim/adtree.hpp @@ -8,6 +8,11 @@ /* Redesigned by Wolfram Muehlhuber, May 1998 */ /* *************************************************************************/ +#include +#include +#include + +#include "geomfuncs.hpp" namespace netgen { @@ -430,7 +435,7 @@ public: // float cmin[dim], cmax[dim]; Point cmin, cmax; // NgArray*> ela; - ClosedHashTable*> ela; + NgClosedHashTable*> ela; BlockAllocator ball{sizeof(T_ADTreeNode)}; public: @@ -759,7 +764,7 @@ public: Leaf() : n_elements(0) { } - void Add( ClosedHashTable &leaf_index, const Point<2*dim> &ap, T aindex ) + void Add( NgClosedHashTable &leaf_index, const Point<2*dim> &ap, T aindex ) { p[n_elements] = ap; index[n_elements] = aindex; @@ -794,7 +799,7 @@ public: private: Node root; - ClosedHashTable leaf_index; + NgClosedHashTable leaf_index; Point global_min, global_max; double tol; diff --git a/libsrc/gprim/geom2d.hpp b/libsrc/gprim/geom2d.hpp index 890a456b..d382676c 100644 --- a/libsrc/gprim/geom2d.hpp +++ b/libsrc/gprim/geom2d.hpp @@ -7,6 +7,12 @@ /* Date: 5. Aug. 95 */ /* *************************************************************************/ +#include + +#include +#include "geomobjects.hpp" +#include + 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; diff --git a/libsrc/gprim/geom3d.hpp b/libsrc/gprim/geom3d.hpp index 068848d5..ca3c26f6 100644 --- a/libsrc/gprim/geom3d.hpp +++ b/libsrc/gprim/geom3d.hpp @@ -7,6 +7,9 @@ /* Date: 5. Aug. 95 */ /* *************************************************************************/ +#include +#include "geom2d.hpp" + namespace netgen { diff --git a/libsrc/gprim/geomfuncs.hpp b/libsrc/gprim/geomfuncs.hpp index 2a647b25..34301312 100644 --- a/libsrc/gprim/geomfuncs.hpp +++ b/libsrc/gprim/geomfuncs.hpp @@ -7,6 +7,8 @@ /* Date: 20. Jul. 02 */ /* *************************************************************************/ +#include "geomobjects.hpp" +#include "geomops.hpp" namespace netgen { diff --git a/libsrc/gprim/geomobjects.hpp b/libsrc/gprim/geomobjects.hpp index 32a22318..f675794a 100644 --- a/libsrc/gprim/geomobjects.hpp +++ b/libsrc/gprim/geomobjects.hpp @@ -7,10 +7,13 @@ /* Date: 20. Jul. 02 */ /* *************************************************************************/ +#include + +#include namespace netgen { - + using namespace ngcore; template class Vec; template class Point; @@ -68,7 +71,8 @@ namespace netgen operator const T* () const { return x; } - void DoArchive(Archive& archive) + template + void DoArchive(ARCHIVE& archive) { for(int i=0; i GetNormal () const; }; + template + inline ostream & operator<< (ostream & ost, const Vec & a) + { + ost << "("; + for (int i = 0; i < D-1; i++) + ost << a(i) << ", "; + ost << a(D-1) << ")"; + return ost; + } + + template + inline ostream & operator<< (ostream & ost, const Point & a) + { + ost << "("; + for (int i = 0; i < D-1; i++) + ost << a(i) << ", "; + ost << a(D-1) << ")"; + return ost; + } + template inline Vec operator-(const Point& p1, const Point& p2) { @@ -338,7 +362,7 @@ namespace netgen } template - void Set (const IndirectArray & points) + void Set (const NgIndirectArray & points) { // Set (points[points.Begin()]); Set (points[*points.Range().begin()]); @@ -348,7 +372,7 @@ namespace netgen } template - void Add (const IndirectArray & points) + void Add (const NgIndirectArray & points) { // for (int i = points.Begin(); i < points.End(); i++) for (int i : points.Range()) diff --git a/libsrc/gprim/geomops2.hpp b/libsrc/gprim/geomops2.hpp deleted file mode 100644 index c615da14..00000000 --- a/libsrc/gprim/geomops2.hpp +++ /dev/null @@ -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 SumExpr : public VecExpr > -{ - 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 -inline SumExpr -operator+ (const VecExpr & a, const VecExpr & b) -{ - return SumExpr (static_cast (a), static_cast (b)); -} - -/* -template -inline SumExpr&, const Vec&> -operator+ (const Vec & a, const Vec & b) -{ - return SumExpr&, const Vec&> (a, b); -} -*/ - - - - - -/* -template -inline Vec operator+ (const Vec & a, const Vec & b) -{ - Vec res; - for (int i = 0; i < D; i++) - res(i) = a(i) + b(i); - return res; -} -*/ - -template -inline Point operator+ (const Point & a, const Vec & b) -{ - Point res; - for (int i = 0; i < D; i++) - res(i) = a(i) + b(i); - return res; -} - - -template -inline Vec operator- (const Point & a, const Point & b) -{ - Vec res; - for (int i = 0; i < D; i++) - res(i) = a(i) - b(i); - return res; -} - -template -inline Point operator- (const Point & a, const Vec & b) -{ - Point res; - for (int i = 0; i < D; i++) - res(i) = a(i) - b(i); - return res; -} - -template -inline Vec operator- (const Vec & a, const Vec & b) -{ - Vec res; - for (int i = 0; i < D; i++) - res(i) = a(i) - b(i); - return res; -} - - -template -inline Vec operator* (double s, const Vec & b) -{ - Vec res; - for (int i = 0; i < D; i++) - res(i) = s * b(i); - return res; -} - - -template -inline double operator* (const Vec & a, const Vec & b) -{ - double sum = 0; - for (int i = 0; i < D; i++) - sum += a(i) * b(i); - return sum; -} - - - -template -inline Vec operator- (const Vec & b) -{ - Vec res; - for (int i = 0; i < D; i++) - res(i) = -b(i); - return res; -} - - -template -inline Point & operator+= (Point & a, const Vec & b) -{ - for (int i = 0; i < D; i++) - a(i) += b(i); - return a; -} - - -template -inline Point & operator+= (Point & a, const VecExpr & b) -{ - for (int i = 0; i < D; i++) - a(i) += b(i); - return a; -} - -template -inline Vec & operator+= (Vec & a, const Vec & b) -{ - for (int i = 0; i < D; i++) - a(i) += b(i); - return a; -} - - - - - -template -inline Point & operator-= (Point & a, const Vec & b) -{ - for (int i = 0; i < D; i++) - a(i) -= b(i); - return a; -} - -template -inline Point & operator-= (Point & a, const VecExpr & b) -{ - for (int i = 0; i < D; i++) - a(i) -= b(i); - return a; -} - - - - - -template -inline Vec & operator-= (Vec & a, const Vec & b) -{ - for (int i = 0; i < D; i++) - a(i) -= b(i); - return a; -} - - - -template -inline Vec & operator*= (Vec & a, double s) -{ - for (int i = 0; i < D; i++) - a(i) *= s; - return a; -} - - -template -inline Vec & operator/= (Vec & a, double s) -{ - for (int i = 0; i < D; i++) - a(i) /= s; - return a; -} - - - - -// Matrix - Vector operations - -/* -template -inline Vec operator* (const Mat & m, const Vec & v) -{ - Vec 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 -inline Mat operator* (const Mat & a, const Mat & b) -{ - Mat 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 -inline Mat Trans (const Mat & m) -{ - Mat res; - for (int i = 0; i < H; i++) - for (int j = 0; j < W; j++) - res(j,i) = m(i,j); - return res; -} - - - - - - - - - - - -template -inline ostream & operator<< (ostream & ost, const Vec & a) -{ - ost << "("; - for (int i = 0; i < D-1; i++) - ost << a(i) << ", "; - ost << a(D-1) << ")"; - return ost; -} - -template -inline ostream & operator<< (ostream & ost, const Point & a) -{ - ost << "("; - for (int i = 0; i < D-1; i++) - ost << a(i) << ", "; - ost << a(D-1) << ")"; - return ost; -} - -template -inline ostream & operator<< (ostream & ost, const Box & b) -{ - ost << b.PMin() << " - " << b.PMax(); - return ost; -} - -template -inline ostream & operator<< (ostream & ost, const Mat & 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 diff --git a/libsrc/gprim/geomtest3d.hpp b/libsrc/gprim/geomtest3d.hpp index 954d32e7..837c402b 100644 --- a/libsrc/gprim/geomtest3d.hpp +++ b/libsrc/gprim/geomtest3d.hpp @@ -7,6 +7,8 @@ /* Date: 13. Feb. 98 */ /* *************************************************************************/ +#include "geom3d.hpp" +#include "geomobjects.hpp" namespace netgen { diff --git a/libsrc/gprim/transform3d.hpp b/libsrc/gprim/transform3d.hpp index b5886d29..0e8a6610 100644 --- a/libsrc/gprim/transform3d.hpp +++ b/libsrc/gprim/transform3d.hpp @@ -11,6 +11,9 @@ Affine - Linear mapping in 3D space */ +#include "geom3d.hpp" +#include "geomfuncs.hpp" + namespace netgen { diff --git a/libsrc/linalg/densemat.hpp b/libsrc/linalg/densemat.hpp index 5b3bb6a5..73b5ee93 100644 --- a/libsrc/linalg/densemat.hpp +++ b/libsrc/linalg/densemat.hpp @@ -11,7 +11,11 @@ Data type dense matrix */ +#include +#include "vector.hpp" +namespace netgen +{ class DenseMatrix { protected: @@ -406,5 +410,5 @@ extern ostream & operator<< (ostream & ost, const MatrixFixWidth & m) extern DLL_HEADER void CalcAtA (const DenseMatrix & a, DenseMatrix & m2); extern DLL_HEADER void CalcInverse (const DenseMatrix & m1, DenseMatrix & m2); - +} // namespace netgen #endif diff --git a/libsrc/linalg/linalg.hpp b/libsrc/linalg/linalg.hpp index 95d0c823..10bc6c50 100644 --- a/libsrc/linalg/linalg.hpp +++ b/libsrc/linalg/linalg.hpp @@ -21,12 +21,9 @@ #include "../include/myadt.hpp" -namespace netgen -{ #include "vector.hpp" #include "densemat.hpp" #include "polynomial.hpp" -} #endif diff --git a/libsrc/linalg/polynomial.hpp b/libsrc/linalg/polynomial.hpp index 3108d4dd..a97db58e 100644 --- a/libsrc/linalg/polynomial.hpp +++ b/libsrc/linalg/polynomial.hpp @@ -7,6 +7,8 @@ /* Date: 25. Nov. 99 */ /* *************************************************************************/ +namespace netgen +{ class QuadraticPolynomial1V { @@ -41,5 +43,5 @@ public: double MaxUnitSquare (); double MaxUnitTriangle (); }; - +} // namespace netgen #endif diff --git a/libsrc/linalg/vector.hpp b/libsrc/linalg/vector.hpp index 97ad05ed..670c4660 100644 --- a/libsrc/linalg/vector.hpp +++ b/libsrc/linalg/vector.hpp @@ -7,8 +7,8 @@ /* Date: 01. Oct. 94 */ /* *************************************************************************/ - - +namespace netgen +{ template class TFlatVector @@ -139,7 +139,8 @@ public: ~Vector () { if (ownmem) delete [] data; } - virtual void DoArchive(Archive& ar) + template + void DoArchive(ARCHIVE& ar) { auto size = s; ar & ownmem & size; @@ -209,7 +210,7 @@ inline ostream & operator<< (ostream & ost, const FlatVector & v) return ost; } - +} //namespace netgen #endif diff --git a/libsrc/meshing/adfront2.cpp b/libsrc/meshing/adfront2.cpp index ab27334b..390e0879 100644 --- a/libsrc/meshing/adfront2.cpp +++ b/libsrc/meshing/adfront2.cpp @@ -3,8 +3,9 @@ */ #include -#include "meshing.hpp" - +#include +#include +#include "adfront2.hpp" namespace netgen { diff --git a/libsrc/meshing/adfront2.hpp b/libsrc/meshing/adfront2.hpp index 95914535..081aaa25 100644 --- a/libsrc/meshing/adfront2.hpp +++ b/libsrc/meshing/adfront2.hpp @@ -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 +#include +#include "meshtype.hpp" + +namespace netgen +{ /// class FrontPoint2 { @@ -275,9 +281,5 @@ public: void PrintOpenSegments (ostream & ost) const; }; - - -#endif - - - +} // namespace netgen +#endif // NETGEN_ADFRONT2_HPP diff --git a/libsrc/meshing/adfront3.cpp b/libsrc/meshing/adfront3.cpp index c0776ebf..df77fdde 100644 --- a/libsrc/meshing/adfront3.cpp +++ b/libsrc/meshing/adfront3.cpp @@ -1,6 +1,7 @@ #include -#include "meshing.hpp" +#include +#include "adfront3.hpp" /* ********************** FrontPoint ********************** */ diff --git a/libsrc/meshing/adfront3.hpp b/libsrc/meshing/adfront3.hpp index 5960ca5c..859a8b42 100644 --- a/libsrc/meshing/adfront3.hpp +++ b/libsrc/meshing/adfront3.hpp @@ -11,7 +11,13 @@ Advancing front class for volume meshing */ +#include +#include +#include "meshtype.hpp" +#include "geomsearch.hpp" +namespace netgen +{ /// Point in advancing front class FrontPoint3 @@ -315,7 +321,5 @@ private: void RebuildInternalTables(); }; - - - +} // namespace netgen #endif diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index bb9a508c..7dbc1e17 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -7,10 +7,18 @@ /* Date: 23. Aug. 09 */ /**************************************************************************/ +#include +#include + +#include "meshtype.hpp" +#include "meshclass.hpp" + struct Tcl_Interp; namespace netgen { + class Refinement; + struct ShapeProperties { optional name; diff --git a/libsrc/meshing/bisect.cpp b/libsrc/meshing/bisect.cpp index fcabc286..5b8abfde 100644 --- a/libsrc/meshing/bisect.cpp +++ b/libsrc/meshing/bisect.cpp @@ -1,5 +1,7 @@ #include -#include "meshing.hpp" +#include +#include "bisect.hpp" +#include "validate.hpp" #define noDEBUG diff --git a/libsrc/meshing/bisect.hpp b/libsrc/meshing/bisect.hpp index eef60d73..2e10a87b 100644 --- a/libsrc/meshing/bisect.hpp +++ b/libsrc/meshing/bisect.hpp @@ -1,5 +1,13 @@ -#ifndef BISECT -#define BISECT +#ifndef NETGEN_BISECT_HPP +#define NETGEN_BISECT_HPP + +#include +#include +#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 diff --git a/libsrc/meshing/boundarylayer.cpp b/libsrc/meshing/boundarylayer.cpp index 2feb7937..1cf942af 100644 --- a/libsrc/meshing/boundarylayer.cpp +++ b/libsrc/meshing/boundarylayer.cpp @@ -1,10 +1,14 @@ -#include -#include "meshing.hpp" -#include "debugging.hpp" -#include "global.hpp" #include #include +#include + +#include "global.hpp" +#include "debugging.hpp" + +#include "boundarylayer.hpp" +#include "meshfunc.hpp" + namespace netgen { diff --git a/libsrc/meshing/boundarylayer.hpp b/libsrc/meshing/boundarylayer.hpp index 394d99f5..87790a2d 100644 --- a/libsrc/meshing/boundarylayer.hpp +++ b/libsrc/meshing/boundarylayer.hpp @@ -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); @@ -89,4 +91,5 @@ class BoundaryLayerTool Vec<3> getEdgeTangent(PointIndex pi, int edgenr); }; -#endif +} // namespace netgen +#endif // NETGEN_BOUNDARYLAYER_HPP diff --git a/libsrc/meshing/clusters.cpp b/libsrc/meshing/clusters.cpp index 3bb98f9e..b64fbc3f 100644 --- a/libsrc/meshing/clusters.cpp +++ b/libsrc/meshing/clusters.cpp @@ -1,6 +1,6 @@ #include -#include "meshing.hpp" +#include "clusters.hpp" namespace netgen { diff --git a/libsrc/meshing/clusters.hpp b/libsrc/meshing/clusters.hpp index 21854f39..e9cc901c 100644 --- a/libsrc/meshing/clusters.hpp +++ b/libsrc/meshing/clusters.hpp @@ -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 diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index af5ed1c0..612862e0 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -7,9 +7,8 @@ namespace netgen { - + using namespace std; // bool rational = true; - static void ComputeGaussRule (int n, NgArray & xi, NgArray & wi) { xi.SetSize (n); diff --git a/libsrc/meshing/curvedelems.hpp b/libsrc/meshing/curvedelems.hpp index 59fbb86d..423732bd 100644 --- a/libsrc/meshing/curvedelems.hpp +++ b/libsrc/meshing/curvedelems.hpp @@ -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 +#include +#include +#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 & x, Mat & jac) const; }; - - -#endif +} //namespace netgen +#endif // NETGEN_CURVEDELEMS_HPP diff --git a/libsrc/meshing/delaunay2d.cpp b/libsrc/meshing/delaunay2d.cpp index db6bcc71..7a7b2b2d 100644 --- a/libsrc/meshing/delaunay2d.cpp +++ b/libsrc/meshing/delaunay2d.cpp @@ -6,6 +6,7 @@ namespace netgen { + using namespace std; void DelaunayTrig::CalcCenter (FlatArray, PointIndex> points) { Point<2> p1 = points[pnums[0]]; diff --git a/libsrc/meshing/findip.hpp b/libsrc/meshing/findip.hpp index 71de05f9..41390380 100644 --- a/libsrc/meshing/findip.hpp +++ b/libsrc/meshing/findip.hpp @@ -1,6 +1,10 @@ +#ifndef NETGEN_FINDIP_HPP +#define NETGEN_FINDIP_HPP + // find inner point - +namespace netgen +{ inline void Minimize (const NgArray & a, const NgArray & c, @@ -188,5 +192,7 @@ inline int FindInnerPoint (POINTArray & points, return (f < -1e-5 * hmax); } +} // namespace netgen +#endif // FILE_FINDINNERPOINT_HPP diff --git a/libsrc/meshing/findip2.hpp b/libsrc/meshing/findip2.hpp index 62009b25..e27f82e2 100644 --- a/libsrc/meshing/findip2.hpp +++ b/libsrc/meshing/findip2.hpp @@ -1,5 +1,11 @@ +#ifndef NETGEN_FINDIP2_HPP +#define NETGEN_FINDIP2_HPP + // find inner point +namespace netgen +{ + template 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 diff --git a/libsrc/meshing/geomsearch.cpp b/libsrc/meshing/geomsearch.cpp index bfeeecc9..88e9ebe9 100644 --- a/libsrc/meshing/geomsearch.cpp +++ b/libsrc/meshing/geomsearch.cpp @@ -1,5 +1,6 @@ #include -#include "meshing.hpp" +#include "geomsearch.hpp" +#include "adfront3.hpp" namespace netgen diff --git a/libsrc/meshing/geomsearch.hpp b/libsrc/meshing/geomsearch.hpp index 5adba567..fc817b5b 100644 --- a/libsrc/meshing/geomsearch.hpp +++ b/libsrc/meshing/geomsearch.hpp @@ -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 diff --git a/libsrc/meshing/global.cpp b/libsrc/meshing/global.cpp index 9bbce766..bdde3046 100644 --- a/libsrc/meshing/global.cpp +++ b/libsrc/meshing/global.cpp @@ -1,11 +1,12 @@ #include -#include "meshing.hpp" +#include "global.hpp" #include - +#include "msghandler.hpp" +#include "meshtype.hpp" namespace netgen { - + class NetgenGeometry; class TraceGlobal { string name; diff --git a/libsrc/meshing/global.hpp b/libsrc/meshing/global.hpp index e19c094b..1ab2ad32 100644 --- a/libsrc/meshing/global.hpp +++ b/libsrc/meshing/global.hpp @@ -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 + 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 diff --git a/libsrc/meshing/hprefinement.cpp b/libsrc/meshing/hprefinement.cpp index ecb6505b..a558167b 100644 --- a/libsrc/meshing/hprefinement.cpp +++ b/libsrc/meshing/hprefinement.cpp @@ -1,6 +1,5 @@ #include #include "meshing.hpp" -#include "hprefinement.hpp" namespace netgen { diff --git a/libsrc/meshing/hprefinement.hpp b/libsrc/meshing/hprefinement.hpp index 5d1e498a..4b3f8395 100644 --- a/libsrc/meshing/hprefinement.hpp +++ b/libsrc/meshing/hprefinement.hpp @@ -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 diff --git a/libsrc/meshing/improve2.hpp b/libsrc/meshing/improve2.hpp index 444062a2..539b0055 100644 --- a/libsrc/meshing/improve2.hpp +++ b/libsrc/meshing/improve2.hpp @@ -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> & 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 diff --git a/libsrc/meshing/improve3.hpp b/libsrc/meshing/improve3.hpp index 605c523c..43820406 100644 --- a/libsrc/meshing/improve3.hpp +++ b/libsrc/meshing/improve3.hpp @@ -1,6 +1,8 @@ #ifndef FILE_IMPROVE3 #define FILE_IMPROVE3 +namespace netgen +{ extern double CalcTotalBad (const Mesh::T_POINTS & points, const Array & elements, @@ -136,6 +138,5 @@ public: inline void UnSetNV(void) {onplane = false;} }; - - +} // namespace netgen #endif diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 87d25274..d69c74ea 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -5,6 +5,7 @@ #include "../general/gzstream.h" #include +#include "basegeom.hpp" namespace netgen { @@ -292,6 +293,12 @@ namespace netgen // #endif } + shared_ptr Mesh :: GetGeometry() const + { + static auto global_geometry = make_shared(); + return geometry ? geometry : global_geometry; + } + void Mesh :: SetCommunicator(NgMPI_Comm acomm) { this->comm = acomm; diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 22ac8960..d6d62ba5 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -1,5 +1,5 @@ -#ifndef MESHCLASS -#define MESHCLASS +#ifndef NETGEN_MESHCLASS_HPP +#define NETGEN_MESHCLASS_HPP /**************************************************************************/ /* File: meshclass.hpp */ @@ -13,8 +13,16 @@ #include +#include +#include + +#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 GetGeometry() const - { - static auto global_geometry = make_shared(); - return geometry ? geometry : global_geometry; - } + DLL_HEADER shared_ptr GetGeometry() const; void SetGeometry (shared_ptr geom) { geometry = geom; @@ -993,6 +997,4 @@ namespace netgen } -#endif - - +#endif // NETGEN_MESHCLASS_HPP diff --git a/libsrc/meshing/meshfunc.hpp b/libsrc/meshing/meshfunc.hpp index fdbdef4e..81157eee 100644 --- a/libsrc/meshing/meshfunc.hpp +++ b/libsrc/meshing/meshfunc.hpp @@ -7,7 +7,12 @@ /* Date: 26. Jan. 98 */ /**************************************************************************/ +#include +#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 diff --git a/libsrc/meshing/meshing.hpp b/libsrc/meshing/meshing.hpp index 52a0dfc2..48dc76f2 100644 --- a/libsrc/meshing/meshing.hpp +++ b/libsrc/meshing/meshing.hpp @@ -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 diff --git a/libsrc/meshing/meshing2.hpp b/libsrc/meshing/meshing2.hpp index 2af29296..e35d5fab 100644 --- a/libsrc/meshing/meshing2.hpp +++ b/libsrc/meshing/meshing2.hpp @@ -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 diff --git a/libsrc/meshing/meshing3.hpp b/libsrc/meshing/meshing3.hpp index 65b153b9..cc28a276 100644 --- a/libsrc/meshing/meshing3.hpp +++ b/libsrc/meshing/meshing3.hpp @@ -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 - - - - - - - - - - diff --git a/libsrc/meshing/meshtool.hpp b/libsrc/meshing/meshtool.hpp index 4bfac0e3..135d36ec 100644 --- a/libsrc/meshing/meshtool.hpp +++ b/libsrc/meshing/meshtool.hpp @@ -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 diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 5c174b30..5945827d 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -8,6 +8,13 @@ /* Date: 01. Okt. 95 */ /**************************************************************************/ +#include +#include +#include +#include + +#include "msghandler.hpp" + namespace netgen { diff --git a/libsrc/meshing/msghandler.hpp b/libsrc/meshing/msghandler.hpp index bab57174..04f0eda9 100644 --- a/libsrc/meshing/msghandler.hpp +++ b/libsrc/meshing/msghandler.hpp @@ -7,6 +7,8 @@ /* Date: 20. Nov. 99 */ /**************************************************************************/ +#include + namespace netgen { diff --git a/libsrc/meshing/ruler2.hpp b/libsrc/meshing/ruler2.hpp index 3d9ca6af..8e3b3c41 100644 --- a/libsrc/meshing/ruler2.hpp +++ b/libsrc/meshing/ruler2.hpp @@ -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 diff --git a/libsrc/meshing/ruler3.hpp b/libsrc/meshing/ruler3.hpp index 91ee4653..03a3ad82 100644 --- a/libsrc/meshing/ruler3.hpp +++ b/libsrc/meshing/ruler3.hpp @@ -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 diff --git a/libsrc/meshing/specials.hpp b/libsrc/meshing/specials.hpp index fd10634d..feed8146 100644 --- a/libsrc/meshing/specials.hpp +++ b/libsrc/meshing/specials.hpp @@ -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 diff --git a/libsrc/meshing/topology.cpp b/libsrc/meshing/topology.cpp index 7d73ac96..74e416ad 100644 --- a/libsrc/meshing/topology.cpp +++ b/libsrc/meshing/topology.cpp @@ -1059,7 +1059,7 @@ namespace netgen // auto begin = r.First(); // auto end = r.Next(); // INDEX_3_CLOSED_HASHTABLE vert2face(2*max_face_on_vertex+10); - ClosedHashTable vert2face(2*max_face_on_vertex+10); + NgClosedHashTable vert2face(2*max_face_on_vertex+10); // for (PointIndex v = begin+PointIndex::BASE; // v < end+PointIndex::BASE; v++) for (PointIndex v : r+PointIndex::BASE) @@ -1124,7 +1124,7 @@ namespace netgen // auto begin = r.First(); // auto end = r.Next(); // INDEX_3_CLOSED_HASHTABLE vert2face(2*max_face_on_vertex+10); - ClosedHashTable vert2face(2*max_face_on_vertex+10); + NgClosedHashTable vert2face(2*max_face_on_vertex+10); /* for (PointIndex v = begin+PointIndex::BASE; v < end+PointIndex::BASE; v++) diff --git a/libsrc/stlgeom/stltool.hpp b/libsrc/stlgeom/stltool.hpp index e3e57385..dc654815 100644 --- a/libsrc/stlgeom/stltool.hpp +++ b/libsrc/stlgeom/stltool.hpp @@ -190,13 +190,13 @@ private: STLGeometry * geometry; const STLChart * chart; // NgArray boundary; - ClosedHashTable boundary_ht; + NgClosedHashTable boundary_ht; unique_ptr> searchtree; public: STLBoundary(STLGeometry * ageometry); ~STLBoundary() {} - void Clear() { /* boundary.SetSize(0); */ boundary_ht = ClosedHashTable(); } + void Clear() { /* boundary.SetSize(0); */ boundary_ht = NgClosedHashTable(); } void SetChart (const STLChart * achart) { chart = achart; } //don't check, if already exists! // void AddNewSegment(const STLBoundarySeg & seg) {boundary.Append(seg);};