📄 cell_inf_hex18.c
字号:
// $Id: cell_inf_hex18.C 2789 2008-04-13 02:24:40Z roystgnr $// The libMesh Finite Element Library.// Copyright (C) 2002-2007 Benjamin S. Kirk, John W. Peterson // 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, 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// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA// Local includes#include "libmesh_config.h"#ifdef ENABLE_INFINITE_ELEMENTS// C++ includes// Local includes cont'd#include "cell_inf_hex18.h"#include "edge_edge3.h"#include "edge_inf_edge2.h"#include "face_quad9.h"#include "face_inf_quad6.h"#include "side.h"// ------------------------------------------------------------// InfHex18 class static member initializationsconst unsigned int InfHex18::side_nodes_map[5][9] ={ { 0, 1, 2, 3, 8, 9, 10, 11, 16}, // Side 0 { 0, 1, 4, 5, 8, 12, 99, 99, 99}, // Side 1 { 1, 2, 5, 6, 9, 13, 99, 99, 99}, // Side 2 { 2, 3, 6, 7, 10, 14, 99, 99, 99}, // Side 3 { 3, 0, 7, 4, 11, 15, 99, 99, 99} // Side 4};const unsigned int InfHex18::edge_nodes_map[8][3] ={ { 0, 1, 8}, // Side 0 { 1, 2, 9}, // Side 1 { 2, 3, 10}, // Side 2 { 0, 3, 11}, // Side 3 { 0, 4, 99}, // Side 4 { 1, 5, 99}, // Side 5 { 2, 6, 99}, // Side 6 { 3, 7, 99} // Side 7};// ------------------------------------------------------------// InfHex18 class member functionsbool InfHex18::is_vertex(const unsigned int i) const{ if (i < 4) return true; return false;}bool InfHex18::is_edge(const unsigned int i) const{ if (i < 4) return false; if (i > 11) return false; return true;}bool InfHex18::is_face(const unsigned int i) const{ if (i > 11) return true; return false;}bool InfHex18::is_node_on_side(const unsigned int n, const unsigned int s) const{ libmesh_assert(s < n_sides()); for (unsigned int i = 0; i != 9; ++i) if (side_nodes_map[s][i] == n) return true; return false;}bool InfHex18::is_node_on_edge(const unsigned int n, const unsigned int e) const{ libmesh_assert(e < n_edges()); for (unsigned int i = 0; i != 3; ++i) if (edge_nodes_map[e][i] == n) return true; return false;}unsigned int InfHex18::key (const unsigned int s) const{ libmesh_assert (s < this->n_sides()); // Think of a unit cube: (-1,1) x (-1,1) x (1,1) switch (s) { case 0: // the base face return this->compute_key (this->node(16)); case 1: // the face at y = -1 return this->compute_key (this->node(0), this->node(1), this->node(5), this->node(4)); case 2: // the face at x = 1 return this->compute_key (this->node(1), this->node(2), this->node(6), this->node(5)); case 3: // the face at y = 1 return this->compute_key (this->node(2), this->node(3), this->node(7), this->node(6)); case 4: // the face at x = -1 return this->compute_key (this->node(3), this->node(0), this->node(4), this->node(7)); } // We'll never get here. libmesh_error(); return 0;}AutoPtr<Elem> InfHex18::build_side (const unsigned int i, bool proxy) const{ libmesh_assert (i < this->n_sides()); if (proxy) { switch (i) { // base case 0: { AutoPtr<Elem> ap(new Side<Quad9,InfHex18>(this,i)); return ap; } // ifem sides case 1: case 2: case 3: case 4: { AutoPtr<Elem> ap(new Side<InfQuad6,InfHex18>(this,i)); return ap; } default: libmesh_error(); } } else { // Think of a unit cube: (-1,1) x (-1,1) x (1,1) switch (i) { case 0: // the base face { AutoPtr<Elem> face(new Quad9); // This is the exception: all other face elements' normals // point outwards; but the base element's normal points inward face->set_node(0) = this->get_node(0); face->set_node(1) = this->get_node(1); face->set_node(2) = this->get_node(2); face->set_node(3) = this->get_node(3); face->set_node(4) = this->get_node(8); face->set_node(5) = this->get_node(9); face->set_node(6) = this->get_node(10); face->set_node(7) = this->get_node(11); face->set_node(8) = this->get_node(16); return face; } case 1: // connecting to another infinite element { AutoPtr<Elem> face(new InfQuad6); face->set_node(0) = this->get_node(0); face->set_node(1) = this->get_node(1); face->set_node(2) = this->get_node(4); face->set_node(3) = this->get_node(5); face->set_node(4) = this->get_node(8); face->set_node(5) = this->get_node(12); return face; } case 2: // connecting to another infinite element { AutoPtr<Elem> face(new InfQuad6); face->set_node(0) = this->get_node(1); face->set_node(1) = this->get_node(2); face->set_node(2) = this->get_node(5); face->set_node(3) = this->get_node(6); face->set_node(4) = this->get_node(9); face->set_node(5) = this->get_node(13); return face; } case 3: // connecting to another infinite element { AutoPtr<Elem> face(new InfQuad6); face->set_node(0) = this->get_node(2); face->set_node(1) = this->get_node(3); face->set_node(2) = this->get_node(6); face->set_node(3) = this->get_node(7); face->set_node(4) = this->get_node(10); face->set_node(5) = this->get_node(14); return face; } case 4: // connecting to another infinite element { AutoPtr<Elem> face(new InfQuad6); face->set_node(0) = this->get_node(3); face->set_node(1) = this->get_node(0); face->set_node(2) = this->get_node(7); face->set_node(3) = this->get_node(4); face->set_node(4) = this->get_node(11); face->set_node(5) = this->get_node(15); return face; } default: { libmesh_error(); AutoPtr<Elem> ap(NULL); return ap; } } } // We'll never get here. libmesh_error(); AutoPtr<Elem> ap(NULL); return ap;}AutoPtr<Elem> InfHex18::build_edge (const unsigned int i) const
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -