Salome HOME
23118: EDF 11115 SMESH: Hexahedric mesh produces degenerate elements in quadratic...
[modules/smesh.git] / src / StdMeshers / StdMeshers_UseExisting_1D2D.cxx
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  SMESH SMESH : implementaion of SMESH idl descriptions
21 // File      : StdMeshers_UseExisting_1D2D.cxx
22 // Module    : SMESH
23 // Created   : Fri Oct 20 11:37:07 2006
24 // Author    : Edward AGAPOV (eap)
25 //
26 #include "StdMeshers_UseExisting_1D2D.hxx"
27
28 #include "SMESH_Mesh.hxx"
29 #include "SMESH_subMesh.hxx"
30
31 //=======================================================================
32 //function : StdMeshers_UseExisting_1D
33 //purpose  : 
34 //=======================================================================
35
36 StdMeshers_UseExisting_1D::StdMeshers_UseExisting_1D
37                                    (int hypId, int studyId, SMESH_Gen* gen)
38   :SMESH_1D_Algo(hypId, studyId, gen)
39 {
40   _name = "UseExisting_1D";
41   _shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
42   _requireShape = false;
43 }
44
45 //=======================================================================
46 //function : CheckHypothesis
47 //purpose  : 
48 //=======================================================================
49
50 bool StdMeshers_UseExisting_1D::CheckHypothesis(SMESH_Mesh& ,
51                                                 const TopoDS_Shape& ,
52                                                 Hypothesis_Status& aStatus)
53 {
54   return (aStatus = HYP_OK) == HYP_OK;
55 }
56
57 //=======================================================================
58 //function : Compute
59 //purpose  : 
60 //=======================================================================
61
62 bool StdMeshers_UseExisting_1D::Compute(SMESH_Mesh& mesh, const TopoDS_Shape& edge)
63 {
64   // This algorithm exists to allow mesh generation by mesh
65   // edition functions in TUI mode
66   mesh.GetSubMesh( edge )->SetIsAlwaysComputed( true );
67   return true;
68 }
69
70
71 //=======================================================================
72 //function : Evaluate
73 //purpose  : 
74 //=======================================================================
75
76 bool StdMeshers_UseExisting_1D::Evaluate(SMESH_Mesh&,
77                                          const TopoDS_Shape&,
78                                          MapShapeNbElems&)
79 {
80   // This algorithm exists to allow mesh generation by mesh
81   // edition functions in TUI mode
82   return false;
83 }
84
85
86 //=======================================================================
87 //function : StdMeshers_UseExisting_2D
88 //purpose  : 
89 //=======================================================================
90
91 StdMeshers_UseExisting_2D::StdMeshers_UseExisting_2D
92                                    (int hypId, int studyId, SMESH_Gen* gen)
93   :SMESH_2D_Algo(hypId, studyId, gen)
94 {
95   _name = "UseExisting_2D";
96   _shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
97   _requireShape = false;
98 }
99
100 //=======================================================================
101 //function : CheckHypothesis
102 //purpose  : 
103 //=======================================================================
104
105 bool StdMeshers_UseExisting_2D::CheckHypothesis(SMESH_Mesh& ,
106                                                 const TopoDS_Shape& ,
107                                                 Hypothesis_Status& aStatus)
108 {
109   return (aStatus = HYP_OK) == HYP_OK;
110 }
111
112 //=======================================================================
113 //function : Compute
114 //purpose  : 
115 //=======================================================================
116
117 bool StdMeshers_UseExisting_2D::Compute(SMESH_Mesh& mesh, const TopoDS_Shape& face)
118 {
119   // This algorithm exists to allow mesh generation by mesh edition
120   // functions in TUI mode
121   mesh.GetSubMesh( face )->SetIsAlwaysComputed( true );
122   return true;
123 }
124
125
126 //=======================================================================
127 //function : Evaluate
128 //purpose  : 
129 //=======================================================================
130
131 bool StdMeshers_UseExisting_2D::Evaluate(SMESH_Mesh&,
132                                          const TopoDS_Shape&,
133                                          MapShapeNbElems&)
134 {
135   // This algorithm exists to allow mesh generation by mesh edition
136   // functions in TUI mode
137   return false;
138 }