hp2FEM
0.1
|
00001 #ifndef _MESH_H_ 00002 #define _MESH_H_ 00003 // --------------------------------------------- 00004 // company : 00005 // user : 00006 // date : 22 Mar 2015 17:22 00007 // file : Mesh.h 00008 // markers : Full 00009 // language : C++ 00010 // generator : Metamill 6.0 00011 // --------------------------------------------- 00012 00013 //#UBLK-BEG-HEADERH 00014 //============================================================== 00015 // Description : 00016 //-------------------------------------------------------------- 00017 // Author : Gilberto Luis 00018 // Created : 07 Jun 2011 00019 //-------------------------------------------------------------- 00020 // Change history : 00021 // 07 Jun 2011 (Gilberto Luis) Initial version generated 00022 // 00023 //============================================================== 00024 //#UBLK-END-HEADERH 00025 00026 /*================================================================================================= 00027 = = 00028 = Copyright 2010-2015 Marco Lucio Bittencourt / Fabiano Fernandes Bargos = 00029 = Gilberto Luis Valente / Jorge Luis Suzuki / Allan Patrick Cordeiro Dias = 00030 = = 00031 = Licensed under the Apache License, Version 2.0 (the "License"); = 00032 = you may not use this file except in compliance with the License. = 00033 = You may obtain a copy of the License at = 00034 = = 00035 = http://www.apache.org/licenses/LICENSE-2.0 = 00036 = = 00037 = Unless required by applicable law or agreed to in writing, software = 00038 = distributed under the License is distributed on an "AS IS" BASIS, = 00039 = WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. = 00040 = See the License for the specific language governing permissions and = 00041 = limitations under the License. = 00042 = = 00043 =================================================================================================*/ 00044 00045 00046 #include <cstdio> 00047 #include "acdp/acdp.h" 00048 #include "enumerations/ElementShape_E.h" 00049 #include "enumerations/MeshID_E.h" 00050 #include "enumerations/MeshType_E.h" 00051 #include "enumerations/pMesh_E.h" 00052 #include "enumerations/Entity_E.h" 00053 #include "enumerations/Kinematics_E.h" 00054 #include "ds/Vector.h" 00055 #include "ds/BuiltInArray.h" 00056 #include "ds/OneIndexTable.h" 00057 #include "fegroups/ElementTopologicalIndices.h" 00058 00059 00068 class Mesh 00069 { 00070 //#UBLK-BEG-CLASSDEF mm:da31bdf9-3abe-11e0-87c1-fb85dddc7efb 00071 //#UBLK-END-CLASSDEF 00072 00073 public: 00074 00075 // METHOD=mm:35d3010b-5717-11e0-8f97-d10de8031633 00076 Mesh(); 00077 00078 // METHOD=mm:977d49d0-9041-43a2-8d97-882a039c2cc3 00079 Mesh(MeshID_E MshID); 00080 00081 // METHOD=mm:7c286b23-5717-11e0-8f97-d10de8031633 00082 Mesh(unsigned long NumberElements, ElementShape_E ElementShape, MeshType_E MeshType, pMesh_E pDistribution, unsigned long MaxPolyOrder = 0); 00083 00084 // METHOD=mm:68cae7e7-571a-11e0-8f97-d10de8031633 00085 Mesh(Mesh& Instance); 00086 00087 // METHOD=mm:59e436a7-571a-11e0-8f97-d10de8031633 00088 ~Mesh(); 00089 00090 // METHOD=mm:947ede7d-5947-11e0-8e1d-d62c684a44a5 00091 Mesh& operator=(Mesh& Instance); 00092 00093 // METHOD=mm:082303e5-3b70-11e0-8f62-9cadaf298b92 00094 operator ElementTopologicalIndices&(); 00095 00096 // METHOD=mm:5382f77a-1660-45ca-a965-2b16acf75013 00097 ElementTopologicalIndices& GetElementLocalTopIndices(); 00098 00099 // METHOD=mm:8cecd8a7-87f5-45b8-85c0-99c832597324 00100 MeshID_E GetMeshID(); 00101 00102 // METHOD=mm:e0cf1a3d-3adc-11e0-87c1-fb85dddc7efb 00103 MeshType_E GetMeshType(); 00104 00105 // METHOD=mm:40269dc8-b2da-11e0-8de7-934e0679c860 00106 unsigned long GetDimension(); 00107 00108 // METHOD=mm:f3e1fd4d-3adc-11e0-87c1-fb85dddc7efb 00109 pMesh_E GetpDistribution(); 00110 00111 // METHOD=mm:4ed92859-3b99-11e0-8f62-9cadaf298b92 00112 ElementShape_E GetElementShape(); 00113 00114 // METHOD=mm:a9577f17-3aca-11e0-87c1-fb85dddc7efb 00115 unsigned long GetMaxPolyOrder(); 00116 00117 // METHOD=mm:87957917-bfd9-499f-88fa-8fee2c8ef138 00118 unsigned long GetNumberElements(); 00119 00120 // METHOD=mm:d2784c41-3dc7-11e0-891a-d4865a8b0383 00121 unsigned long GetElementOrder(unsigned long ElementNumber); 00122 00123 // METHOD=mm:630215c7-3aca-11e0-87c1-fb85dddc7efb 00124 long* GetElementIncidence(unsigned long ElementNumber, unsigned long& NumberNodes); 00125 00126 // METHOD=mm:1ccf5067-5721-11e0-8f97-d10de8031633 00127 long* GetElementEquations(unsigned long ElementNumber, unsigned long& NumberEquations); 00128 00129 // METHOD=mm:d7f7f943-5721-11e0-8f97-d10de8031633 00130 double* GetElementCoordinates(unsigned long ElementNumber, unsigned long& NumberCoords); 00131 00132 // METHOD=mm:cd151e93-6bfe-47e1-b24a-cc3db8eec00a 00133 double* GetNodeCoordinates(unsigned long LocalElementNumber, unsigned long NodeNumber, unsigned long& NumberDofs); 00134 00135 // METHOD=mm:3ce508a1-b5e6-4059-af77-d8daeabfdb77 00136 double* GetElementDeformedCoordinates(unsigned long ElementNumber, unsigned long& NumberCoords); 00137 00138 // METHOD=mm:1448116c-0a7a-4f16-a8c8-60385d292d06 00139 void GetEdgeCoordinates(unsigned long ElemNumber, unsigned long EdgeNumber, double* EdgeCoords, unsigned long& NumEdgeCoords); 00140 00141 // METHOD=mm:55ec5071-b660-4ba3-b6ee-102ba458da30 00142 void GetFaceCoordinates(unsigned long ElemNumber, unsigned long FaceNumber, double* FaceCoords, unsigned long& NumFaceCoords); 00143 00144 // METHOD=mm:191a4f77-3acc-11e0-87c1-fb85dddc7efb 00145 unsigned long GetNumberTopologicalEntities(Entity_E TopoEntity); 00146 00147 // METHOD=mm:d7ac1eb7-5722-11e0-8f97-d10de8031633 00148 unsigned long GetNumberNodesOnTopologicalEntities(unsigned long ElementNumber, Entity_E TopoEntity); 00149 00150 // METHOD=mm:85cb79c9-939c-11e0-9aa5-836670cd1ba3 00151 BuiltInArray<unsigned long>& GetElementOrder(); 00152 00153 // METHOD=mm:34f7a4cf-c6f7-43c0-87ea-06a60684db66 00154 BuiltInArray<long>& GetPolynomialOrders(); 00155 00156 // METHOD=mm:dad04868-3aca-11e0-87c1-fb85dddc7efb 00157 OneIndexTable<long>& GetIncidence(); 00158 00159 // METHOD=mm:b0a13583-5721-11e0-8f97-d10de8031633 00160 OneIndexTable<double>& GetCoordinates(); 00161 00162 // METHOD=mm:18e9eec3-b3a7-11e0-95eb-b1923d4223ae 00163 OneIndexTable<double>& GetDeformCoordinates(); 00164 00165 // METHOD=mm:67e97a35-5721-11e0-8f97-d10de8031633 00166 OneIndexTable<long>& GetEquations(); 00167 00168 // METHOD=mm:0a95f71a-95bf-11e0-80be-86b977f78968 00169 BuiltInArray<unsigned long>& GetNumberElementNodes(); 00170 00171 // METHOD=mm:5293545e-29e2-4a8c-bcdd-9fae62631524 00172 unsigned long GetPosTotalNumberDOFsByGroup(); 00173 00174 // METHOD=mm:b7ae741b-8d46-11e0-9f9f-e86fbb3dda02 00175 void SetMeshType(MeshType_E MeshType); 00176 00177 // METHOD=mm:52a0de01-b2da-11e0-8de7-934e0679c860 00178 void SetDimension(unsigned long Dimension); 00179 00180 // METHOD=mm:5aff7be6-8d47-11e0-9f9f-e86fbb3dda02 00181 void SetpDistribution(pMesh_E pMsh); 00182 00183 // METHOD=mm:f6b6bc97-8bc8-11e0-93aa-c146ba6a39e4 00184 void SetMaxPolyOrder(unsigned long MaxPolyOrder); 00185 00186 // METHOD=mm:11058f6c-96b3-11e0-94fb-815c29ec5d4a 00187 void SetNumberElements(unsigned long NElems); 00188 00189 // METHOD=mm:464d5e8b-9395-11e0-9aa5-836670cd1ba3 00190 void SetNumberElementNodes(BuiltInArray<unsigned long>& NElemNodes, long NElems); 00191 00192 // METHOD=mm:a3302852-3ae8-411b-86b2-5bfd7cf625a8 00193 void SetNumberElementNodes(unsigned long NElemNodes, long NElems); 00194 00195 // METHOD=mm:cecc06f0-9395-11e0-9aa5-836670cd1ba3 00196 void SetElementShape(ElementShape_E Element); 00197 00198 // METHOD=mm:55797eb6-98e7-11e0-8faf-d83ab2ff7587 00199 void SetPolynomialOrders(BuiltInArray<unsigned long>& ElemOrders); 00200 00201 // METHOD=mm:0a4f4043-ade4-430c-93d3-c8ca87303bde 00202 void SetElementOrder(BuiltInArray<unsigned long>& ElementOrder); 00203 00204 // METHOD=mm:7605b800-c419-4a44-bd84-e321d6fda81b 00205 void SetSizeElemCoordsTable(); 00206 00207 // METHOD=mm:ad291559-c0f3-4aa1-945f-bf75393d7e4d 00208 void SetSizeElemIncidTable(); 00209 00210 // METHOD=mm:3360ffbe-98c3-45ee-aabd-565cacd191d8 00211 void SetAllElementsCoords(double * const coords); 00212 00213 // METHOD=mm:6a81e9c6-5b1f-4c5a-a11c-45d9bbd5b89d 00214 void SetElementCoords(unsigned long ElemNum, unsigned long nNodes, double * const coords); 00215 00216 // METHOD=mm:aa8ae776-4e26-4d91-b4f3-c6726a17a7dd 00217 void SetElementIncidence(unsigned long ElemNum, unsigned long NodePos, unsigned long NodeNum); 00218 00219 // METHOD=mm:ad04dfc7-5c84-403c-b90c-9e6bc50d2947 00220 void SetEquations(OneIndexTable<long> ElementIncid, unsigned long NumberDOFs); 00221 00222 // METHOD=mm:94a1c0f2-06a7-411a-b5d8-2c85882f4284 00223 void SetEquations(OneIndexTable<long> ElementIncid, OneIndexTable<unsigned long> NodalDOFNumbers); 00224 00225 // METHOD=mm:8d734a34-fcdb-4755-b266-c3795b40cc61 00226 void SetMeshID(MeshID_E MshID); 00227 00228 // METHOD=mm:fdac1157-593a-11e0-8e1d-d62c684a44a5 00229 void UpdateCoordinates(Vector& Displacement); 00230 00231 // METHOD=mm:ad406a13-3659-4d29-aff3-ddd56a0529ca 00232 void UpdateCoordinates(Vector& Displacement, long NumberFreeDOFs); 00233 00234 // METHOD=mm:52581538-5f49-4060-a48b-344c9ff7e8b7 00235 void Save(FILE* File); 00236 00237 // METHOD=mm:966634b0-7c69-44ce-89e1-e1f2e2cd8b14 00238 void Restore(FILE* File); 00239 00240 // METHOD=mm:567ec0e1-3acc-11e0-87c1-fb85dddc7efb 00241 void Read(FILE* FEMFile, FILE* DEFFile, ElementShape_E ElementShape, unsigned long NumberElements, unsigned long GroupNumber, unsigned long Dimension); 00242 00243 // METHOD=mm:a121a0fc-9372-11e0-9aa5-836670cd1ba3 00244 void ReadIncidence(FILE* FEMFile); 00245 00246 // METHOD=mm:4dd4d86d-c384-11e0-9a2f-d79375ab2f00 00247 void Print(FILE* File); 00248 00249 // METHOD=mm:b01a5d29-4ba8-4e33-bbd6-84493c7524ac 00250 void Free(); 00251 00252 00253 protected: 00254 00258 // attr=mm:fcda5670-13b7-49ad-b2fd-371552deb570 00259 MeshID_E MeshID; 00260 00264 // attr=mm:da9e8a1f-3b98-11e0-8f62-9cadaf298b92 00265 ElementShape_E ElemShape; 00266 00270 // attr=mm:2be2a172-b2da-11e0-8de7-934e0679c860 00271 unsigned long Dim; 00272 00276 // attr=mm:8b930bdd-3adc-11e0-87c1-fb85dddc7efb 00277 MeshType_E MshType; 00278 00282 // attr=mm:9fd70a6d-3adc-11e0-87c1-fb85dddc7efb 00283 pMesh_E pMesh; 00284 00288 // attr=mm:d18dc541-3abf-11e0-87c1-fb85dddc7efb 00289 unsigned long MaxOrder; 00290 00294 // attr=mm:35616155-96b3-11e0-94fb-815c29ec5d4a 00295 unsigned long NumElems; 00296 00300 // attr=mm:d3dc9df3-9394-11e0-9aa5-836670cd1ba3 00301 BuiltInArray<unsigned long> NumElemNodes; 00302 00306 // attr=mm:a80c6add-98f2-11e0-8faf-d83ab2ff7587 00307 BuiltInArray<long> PolyOrder; 00308 00312 // attr=mm:28df6567-3abf-11e0-87c1-fb85dddc7efb 00313 BuiltInArray<unsigned long> ElemOrder; 00314 00318 // attr=mm:efa6ec07-3abe-11e0-87c1-fb85dddc7efb 00319 OneIndexTable<long> ElemIncid; 00320 00324 // attr=mm:0e12e847-3acb-11e0-87c1-fb85dddc7efb 00325 OneIndexTable<long> ElemEquations; 00326 00330 // attr=mm:35fc3c57-3abf-11e0-87c1-fb85dddc7efb 00331 OneIndexTable<double> ElemCoords; 00332 00336 // attr=mm:98c4561d-92cf-11e0-93dd-c3c3f9201630 00337 OneIndexTable<double> ElemDeformCoords; 00338 00342 // attr=mm:e45fb395-3b6f-11e0-8f62-9cadaf298b92 00343 ElementTopologicalIndices LocTopInd; 00344 00348 // attr=mm:a37d6826-0628-4051-bb2e-8f048d04afba 00349 unsigned long PosTotalNumberDOFsByGroup; 00350 00351 00352 private: 00353 00354 //#UBLK-BEG-CLASSMEMB mm:da31bdf9-3abe-11e0-87c1-fb85dddc7efb 00355 //#UBLK-END-CLASSMEMB 00356 }; 00357 00358 //#UBLK-BEG-GLOBALH 00359 //*** Removed methods: 04 Aug 2011 16:21 00360 //--- 00361 //uuid=mm:d3aef023-96ce-11e0-94fb-815c29ec5d4a 00362 // void SetElementEquations(Equations& Eqs); 00363 00364 //*** Removed methods: 04 Aug 2011 17:18 00365 //--- 00366 //uuid=mm:d3aef023-96ce-11e0-94fb-815c29ec5d4a 00367 // void SetElementEquations(Equations& Eqs); 00368 00369 //*** Removed methods: 08 Aug 2011 17:44 00370 //--- 00371 //uuid=mm:0817c8d0-9752-11e0-9675-962bf0d5c356 00372 // void SetElementCoords(Nodes& Nods); 00373 00374 //*** Removed methods: 10 Feb 2012 13:14 00375 //--- 00376 //uuid=mm:2b42b79d-c384-11e0-9a2f-d79375ab2f00 00377 // void Save(FILE* File); 00378 //--- 00379 //uuid=mm:3dbce713-c384-11e0-9a2f-d79375ab2f00 00380 // void Restore(FILE* File); 00381 00382 //*** Removed methods: 13 Mar 2015 16:18 00383 //--- 00384 //uuid=mm:fc9276bf-ef0e-4693-b7b5-05ae6cf404fe 00385 // double* GetNodeCoordinates(unsigned long LocalElementNumber, unsigned long NodeNumber, unsigned long& NumberDofs); 00386 //--- 00387 //uuid=mm:bed1e751-1963-4233-a6a1-68da38e98b6a 00388 // double* GetHighOrderNodeCoordinates(unsigned long NodeNumber); 00389 00390 //#UBLK-END-GLOBALH 00391 00392 00393 #endif // _MESH_H_