Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / HEXABLOCK / HexElements.hxx
old mode 100755 (executable)
new mode 100644 (file)
index fb3a54c..6696c5d
@@ -1,12 +1,12 @@
 
 // Class : Gestion des tableaux d'hexaedres
 
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -30,7 +30,8 @@
 
 BEGIN_NAMESPACE_HEXA
 
-class Elements : public EltBase
+class Qpattern;
+class HexaExport Elements : public EltBase
 {
 public:
    virtual Hexa*   getHexa   (int nro);
@@ -62,10 +63,12 @@ public:
 #ifndef SWIG
 public:
    int findHexa   (Hexa*   elt);
-   int findQuad   (Quad*   elt);
-   int findEdge   (Edge*   elt);
+   int findQuad   (Quad*   elt);   // indexQuad   ?
+   int findEdge   (Edge*   elt);   // indexVertex ?
 
    int findVertex (double vx, double vy, double vz);
+   Edge* findEdge   (Vertex* v1, Vertex* v2);
+   Quad* findQuad   (Edge*   e1, Edge*   e2);
 
    Elements (Document* doc, int nx, int ny, int nz);
    Elements (Elements* orig);
@@ -85,34 +88,13 @@ public:
 
    int saveVtk  (cpchar nomfic, int& nro);
 
-   int makeCartesianGrid (Vertex* orig, Vector* v1, Vector* v2, Vector* v3,
-                      int px, int py, int pz, int mx=0, int my=0, int mz=0);
-
-   int makeCylinder (Cylinder* cyl, Vector* base, int nr, int na, int nl);
-   int makePipe     (Cylinder* cyl, Vector* base, int nr, int na, int nl);
-
-   int makeCylindricalGrid (Vertex* c, Vector* b, Vector* h,
-         double dr, double da, double dl, int nr, int na, int nl, bool fill);
-
-   int makeSphericalGrid (Vertex* v, Vector* dv, int nb, double k=1); // perime
-   int makeSphericalGrid (Vertex* v, double rayon, int nb, double k=1); // perime
-
-   int  joinQuads (Quads& q0, int nb, Vertex* v1, Vertex* v2, Vertex* v3,
-                   Vertex* v4, Quad* dest);
    int coupler  (int nro, Quad* other, StrOrient* orient);
 
-   int  prismQuads (Quads& start, Vector* dv, int nb);
-   int  prismQuadsVec (Quads& start, Vector* dv, RealVector& tlen, int crit);
-
    int  cutHexas   (const Edges& edges, int nbcuts);
 
    void setVertex (Vertex* node, int nx, int ny, int nz);
 
    void transfoVertices (double* orig, double* base, double* haut);
-                            // DELETE les 2 suivants 
-   void transfoVertices (Vertex* orig, Vector* vi, Vector* vj, Vector* vk);
-   void transfoVertices (Vertex* orig, Vector* base, Vector* haut);
-
 
    void setVertex (Vertex* node, int nro);
    void setEdge   (Edge*   edge, int nro);
@@ -124,12 +106,6 @@ public:
               // Evols Hexa3
 
    int getCylPoint (int nr, int na, int nh, double& px, double& py, double& pz);
-   int revolutionQuads (Quads& start, Vertex* center, Vector* axis,
-                        RealVector &angles);
-
-   int makeRind (EnumGrid type, Vertex* center, Vector* vx, Vector* vz,
-                 double rext, double rint,  double radhole,
-                 Vertex* plorig, double angle, int nrad, int nang, int nhaut);
 
    static int controlRind (EnumGrid type, Vertex* cx, Vector* vx, Vector* vz,
                            double rext, double rint, double radhole,
@@ -137,17 +113,20 @@ public:
                            int nrad, int nang, int nhaut,
                            double &phi0, double &phi1);
 
-   int makeCylindricalGrid (Vertex* c, Vector* b, Vector* h,
-                            RealVector& tdr, RealVector& tda, RealVector& tdh,
-                            bool fill=false);
-
-   int replaceHexas (Quads& pattern, Vertex* p1, Vertex* c1,
+   int replaceHexas (Quads& pattern, Vertex* p1, Vertex* c1, // To Delete
                      Vertex* p2, Vertex* c2,  Vertex* p3, Vertex* c3);
 
+   int replaceHexas (Quads& pattern, Quads& target, Vertex* p1, Vertex* c1,
+                     Vertex* p2, Vertex* c2);
+
    int replaceHexa  (int nh, Pattern* pat, Hexa* hexa);
    int replaceQuad  (int nh, Pattern* pat, Quad* quad, Vertex* tvert[]);
    int extrudeQuad  (Pattern* pat);
 
+   int replaceHexa  (int nh, Qpattern* pat);
+   int replaceQuad  (int nh, Qpattern* pat);
+   int extrudeQuad  (Qpattern* pat);
+
    void repVertex (int nh, int nro, Vertex* node);
    void repEdgeH  (int nh, int nro, Edge* node);
    void repEdgeV  (int nh, int nro, Edge* node);
@@ -223,6 +202,10 @@ public:
    void checkDisco  (Hexa* cell,    Quad*   element);
    void checkDisco  (Hexa* cell,    Edge*   element);
    void checkDisco  (Hexa* cell,    Vertex* element);
+   void checkContour (Quads& tquad, Vertex* v1, Vertex* v2, bool target, 
+                      Edges& tedge);
+   void checkContour (Quads& tquad, Vertex* v1, Vertex* v2, bool target, 
+                      Vertices& tvertex);
 
 protected :
                                         // Evols Hexa3
@@ -275,18 +258,9 @@ protected :
 
    void resize (EnumGrid type, int nx, int ny=0, int nz=0, int nplus=0);
 
-   int makeCartesianNodes (Vertex* orig, Vector* v1, Vector* v2, Vector* v3,
-                      int px, int py, int pz, int mx=0, int my=0, int mz=0);
-
    int makeCylindricalNodes (Vertex* c, Vector* b, Vector* h,
          double dr, double da, double dl, int nr, int na, int nl, bool fill);
 
-   int makeBasicCylinder (double dr, double da, double dl, int nr, int na,
-                                                           int nl, bool fill);
-
-   int addStrate (Quad* i_quad[], Edge* i_edge[], Vertex* i_node[],  // DEL
-                  Vertex* center,  double lambda);
-
    int addStrate (Quad* i_quad[], Edge* i_edge[], Vertex* i_node[],
                   double* center,  double lambda);