📄 cell_inf_hex16.c
字号:
// $Id: cell_inf_hex16.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_hex16.h"#include "edge_edge3.h"#include "edge_inf_edge2.h"#include "face_quad8.h"#include "face_inf_quad6.h"#include "side.h"// ------------------------------------------------------------// InfHex16 class static member initializationsconst unsigned int InfHex16::side_nodes_map[5][8] ={ { 0, 1, 2, 3, 8, 9, 10, 11}, // Side 0 { 0, 1, 4, 5, 8, 12, 99, 99}, // Side 1 { 1, 2, 5, 6, 9, 13, 99, 99}, // Side 2 { 2, 3, 6, 7, 10, 14, 99, 99}, // Side 3 { 3, 0, 7, 4, 11, 15, 99, 99} // Side 4};const unsigned int InfHex16::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};// ------------------------------------------------------------// InfHex16 class member functionsbool InfHex16::is_vertex(const unsigned int i) const{ if (i < 4) return true; return false;}bool InfHex16::is_edge(const unsigned int i) const{ if (i < 4) return false; if (i > 11) return false; return true;}bool InfHex16::is_face(const unsigned int i) const{ if (i > 11) return true; return false;}bool InfHex16::is_node_on_side(const unsigned int n, const unsigned int s) const{ libmesh_assert(s < n_sides()); for (unsigned int i = 0; i != 8; ++i) if (side_nodes_map[s][i] == n) return true; return false;}bool InfHex16::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;}AutoPtr<Elem> InfHex16::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<Quad8,InfHex16>(this,i)); return ap; } // ifem sides case 1: case 2: case 3: case 4: { AutoPtr<Elem> ap(new Side<InfQuad6,InfHex16>(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 Quad8); // Only here, the face 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); 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);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -