From 9f8e302b18e2b5edae0198fbe1766aabd8311644 Mon Sep 17 00:00:00 2001
From: Amaury Johnan <amjohnen@gmail.com>
Date: Thu, 31 Mar 2016 15:32:45 +0000
Subject: [PATCH] some modification in the includes (for quicker compilation)

---
 Geo/MElement.h                                |  4 +-
 Mesh/qualityMeasures.cpp                      |  1 +
 Numeric/BasisFactory.cpp                      | 42 +++++++++++++++++++
 Numeric/BasisFactory.h                        | 39 ++++-------------
 Numeric/CondNumBasis.cpp                      |  2 +-
 Numeric/CondNumBasis.h                        |  5 +--
 Numeric/FuncSpaceData.h                       |  1 -
 .../HighOrderMeshOptimizer/CADDistances.cpp   |  1 +
 contrib/HighOrderMeshOptimizer/OptHomMesh.cpp |  1 +
 9 files changed, 60 insertions(+), 36 deletions(-)

diff --git a/Geo/MElement.h b/Geo/MElement.h
index 7aff9cc4dc..b3d1e46fa0 100644
--- a/Geo/MElement.h
+++ b/Geo/MElement.h
@@ -11,16 +11,18 @@
 #include <string>
 
 #include "GmshMessage.h"
+#include "ElementType.h"
 #include "MVertex.h"
 #include "MEdge.h"
 #include "MFace.h"
+#include "FuncSpaceData.h"
 #include "nodalBasis.h"
 #include "polynomialBasis.h"
-#include "JacobianBasis.h"
 #include "MetricBasis.h"
 #include "GaussIntegration.h"
 
 class GModel;
+class JacobianBasis;
 
 // A mesh element.
 class MElement
diff --git a/Mesh/qualityMeasures.cpp b/Mesh/qualityMeasures.cpp
index 862ca1acc4..b1084ca229 100644
--- a/Mesh/qualityMeasures.cpp
+++ b/Mesh/qualityMeasures.cpp
@@ -13,6 +13,7 @@
 #include "MHexahedron.h"
 #include "Numeric.h"
 #include "polynomialBasis.h"
+#include "JacobianBasis.h"
 #include "GmshMessage.h"
 #include <limits>
 #include <string.h>
diff --git a/Numeric/BasisFactory.cpp b/Numeric/BasisFactory.cpp
index 97ed21a7e1..604ab7f064 100644
--- a/Numeric/BasisFactory.cpp
+++ b/Numeric/BasisFactory.cpp
@@ -7,9 +7,11 @@
 #include "GmshDefines.h"
 #include "polynomialBasis.h"
 #include "pyramidalBasis.h"
+#include "bezierBasis.h"
 #include "miniBasis.h"
 #include "MetricBasis.h"
 #include "CondNumBasis.h"
+#include "JacobianBasis.h"
 #include <map>
 #include <cstddef>
 
@@ -82,6 +84,25 @@ const JacobianBasis* BasisFactory::getJacobianBasis(FuncSpaceData fsd)
   return J;
 }
 
+const JacobianBasis* BasisFactory::getJacobianBasis(int tag, int order)
+{
+  const int type = ElementType::ParentTypeFromTag(tag);
+  if (type != TYPE_PYR)
+    return getJacobianBasis(FuncSpaceData(true, tag, order));
+  else
+    return getJacobianBasis(FuncSpaceData(true, tag, false, order+1, order));
+}
+
+const JacobianBasis* BasisFactory::getJacobianBasis(int tag)
+{
+  const int order = JacobianBasis::jacobianOrder(tag);
+  const int type = ElementType::ParentTypeFromTag(tag);
+  if (type != TYPE_PYR)
+    return getJacobianBasis(FuncSpaceData(true, tag, order));
+  else
+    return getJacobianBasis(FuncSpaceData(true, tag, false, order+2, order));
+}
+
 const MetricBasis* BasisFactory::getMetricBasis(int tag)
 {
   std::map<int, MetricBasis*>::const_iterator it = ms.find(tag);
@@ -112,6 +133,16 @@ const GradientBasis* BasisFactory::getGradientBasis(FuncSpaceData data)
   return G;
 }
 
+const GradientBasis* BasisFactory::getGradientBasis(int tag, int order)
+{
+  return getGradientBasis(FuncSpaceData(true, tag, order));
+}
+
+const GradientBasis* BasisFactory::getGradientBasis(int tag)
+{
+  return getGradientBasis(FuncSpaceData(tag));
+}
+
 const bezierBasis* BasisFactory::getBezierBasis(FuncSpaceData fsd)
 {
   FuncSpaceData data = fsd.getForPrimaryElement();
@@ -124,6 +155,17 @@ const bezierBasis* BasisFactory::getBezierBasis(FuncSpaceData fsd)
   return B;
 }
 
+const bezierBasis* BasisFactory::getBezierBasis(int parentTag, int order)
+{
+  int primaryTag = ElementType::getTag(parentTag, 1);
+  return getBezierBasis(FuncSpaceData(true, primaryTag, order));
+}
+
+const bezierBasis* BasisFactory::getBezierBasis(int tag)
+{
+  return getBezierBasis(FuncSpaceData(tag));
+}
+
 void BasisFactory::clearAll()
 {
   std::map<int, nodalBasis*>::iterator itF = fs.begin();
diff --git a/Numeric/BasisFactory.h b/Numeric/BasisFactory.h
index c75bcd2e4d..1ca2457dd2 100644
--- a/Numeric/BasisFactory.h
+++ b/Numeric/BasisFactory.h
@@ -6,13 +6,14 @@
 #ifndef BASISFACTORY_H
 #define BASISFACTORY_H
 
-#include "JacobianBasis.h"
-#include "FuncSpaceData.h"
+#include <map>
 class nodalBasis;
 class MetricBasis;
 class GradientBasis;
 class bezierBasis;
 class CondNumBasis;
+class JacobianBasis;
+class FuncSpaceData;
 
 class BasisFactory
 {
@@ -34,21 +35,8 @@ class BasisFactory
   // Warning: bases returned by BasisFactory::getJacobianBasis(int tag) are the
   // only safe bases for using Bezier on the jacobian determinant!
   static const JacobianBasis* getJacobianBasis(FuncSpaceData);
-  static const JacobianBasis* getJacobianBasis(int tag, int order) {
-    const int type = ElementType::ParentTypeFromTag(tag);
-    if (type != TYPE_PYR)
-      return getJacobianBasis(FuncSpaceData(true, tag, order));
-    else
-      return getJacobianBasis(FuncSpaceData(true, tag, false, order+1, order));
-  }
-  static const JacobianBasis* getJacobianBasis(int tag) {
-    const int order = JacobianBasis::jacobianOrder(tag);
-    const int type = ElementType::ParentTypeFromTag(tag);
-    if (type != TYPE_PYR)
-      return getJacobianBasis(FuncSpaceData(true, tag, order));
-    else
-      return getJacobianBasis(FuncSpaceData(true, tag, false, order+2, order));
-  }
+  static const JacobianBasis* getJacobianBasis(int tag, int order);
+  static const JacobianBasis* getJacobianBasis(int tag);
 
   // Metric
   static const MetricBasis* getMetricBasis(int tag);
@@ -58,22 +46,13 @@ class BasisFactory
 
   // Gradients
   static const GradientBasis* getGradientBasis(FuncSpaceData);
-  static const GradientBasis* getGradientBasis(int tag, int order) {
-    return getGradientBasis(FuncSpaceData(true, tag, order));
-  }
-  static const GradientBasis* getGradientBasis(int tag) {
-    return getGradientBasis(FuncSpaceData(tag));
-  }
+  static const GradientBasis* getGradientBasis(int tag, int order);
+  static const GradientBasis* getGradientBasis(int tag);
 
   // Bezier
   static const bezierBasis* getBezierBasis(FuncSpaceData);
-  static const bezierBasis* getBezierBasis(int parentTag, int order) {
-    int primaryTag = ElementType::getTag(parentTag, 1);
-    return getBezierBasis(FuncSpaceData(true, primaryTag, order));
-  }
-  static const bezierBasis* getBezierBasis(int tag) {
-    return getBezierBasis(FuncSpaceData(tag));
-  }
+  static const bezierBasis* getBezierBasis(int parentTag, int order);
+  static const bezierBasis* getBezierBasis(int tag);
 
   static void clearAll();
 };
diff --git a/Numeric/CondNumBasis.cpp b/Numeric/CondNumBasis.cpp
index 2a514f962c..eb4f72e94b 100644
--- a/Numeric/CondNumBasis.cpp
+++ b/Numeric/CondNumBasis.cpp
@@ -312,7 +312,7 @@ inline void calcGradInvCondNum3D(double dxdX, double dxdY, double dxdZ,
 
 
 CondNumBasis::CondNumBasis(int tag, int cnOrder) :
-    _tag(tag), _dim(ElementType::DimensionFromTag(tag)),
+    _dim(ElementType::DimensionFromTag(tag)),
     _condNumOrder(cnOrder >= 0 ? cnOrder : condNumOrder(tag))
 {
   if ( ElementType::ParentTypeFromTag(tag) == TYPE_TRIH){
diff --git a/Numeric/CondNumBasis.h b/Numeric/CondNumBasis.h
index 82a7359960..ab59858315 100644
--- a/Numeric/CondNumBasis.h
+++ b/Numeric/CondNumBasis.h
@@ -8,15 +8,14 @@
 
 #include <map>
 #include <vector>
-#include "JacobianBasis.h"
 #include "fullMatrix.h"
-
+#include "JacobianBasis.h"
 
 class CondNumBasis {
  private:
   const GradientBasis *_gradBasis;
 
-  const int _tag, _dim, _condNumOrder;
+  const int _dim, _condNumOrder;
 
   fullVector<double> primGradShapeBarycenterX, primGradShapeBarycenterY,
                      primGradShapeBarycenterZ;
diff --git a/Numeric/FuncSpaceData.h b/Numeric/FuncSpaceData.h
index fbc55f6d0f..546deb052c 100644
--- a/Numeric/FuncSpaceData.h
+++ b/Numeric/FuncSpaceData.h
@@ -35,7 +35,6 @@ private:
   // otherwise,
   //   the space is {X^i Y^j Z^k | i,j <= '_nij', k <= '_nk'}, (hex-like space)
   // where X = xi/(1-zeta), Y = eta/(1-zeta) and Z = (1-zeta).
-  // Note that (x, y, z) are here the reference coordinates.
 
 public:
 
diff --git a/contrib/HighOrderMeshOptimizer/CADDistances.cpp b/contrib/HighOrderMeshOptimizer/CADDistances.cpp
index 242b0584a8..1969f5793c 100644
--- a/contrib/HighOrderMeshOptimizer/CADDistances.cpp
+++ b/contrib/HighOrderMeshOptimizer/CADDistances.cpp
@@ -10,6 +10,7 @@
 #include "MTriangle.h"
 #include "MQuadrangle.h"
 #include "BasisFactory.h"
+#include "JacobianBasis.h"
 #include "GModel.h"
 #if defined(HAVE_ANN)
 #include "ANN/ANN.h"
diff --git a/contrib/HighOrderMeshOptimizer/OptHomMesh.cpp b/contrib/HighOrderMeshOptimizer/OptHomMesh.cpp
index 9ffdebb4e0..6c8534f6eb 100644
--- a/contrib/HighOrderMeshOptimizer/OptHomMesh.cpp
+++ b/contrib/HighOrderMeshOptimizer/OptHomMesh.cpp
@@ -35,6 +35,7 @@
 #include "ParamCoord.h"
 #include "OptHomMesh.h"
 #include "BasisFactory.h"
+#include "JacobianBasis.h"
 #include "OptHomIntegralBoundaryDist.h"
 
 Mesh::Mesh(const std::map<MElement*,GEntity*> &element2entity,
-- 
GitLab