face_inf_quad6.C
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 // Local includes 00021 #include "libmesh/libmesh_config.h" 00022 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 00023 00024 00025 // Local includes cont'd 00026 #include "libmesh/face_inf_quad6.h" 00027 #include "libmesh/edge_edge3.h" 00028 #include "libmesh/side.h" 00029 #include "libmesh/edge_inf_edge2.h" 00030 00031 namespace libMesh 00032 { 00033 00034 00035 00036 00037 // ------------------------------------------------------------ 00038 // InfQuad6 class static member initializations 00039 const unsigned int InfQuad6::side_nodes_map[3][3] = 00040 { 00041 {0, 1, 4}, // Side 0 00042 {1, 3}, // Side 1 00043 {0, 2} // Side 2 00044 }; 00045 00046 00047 // ------------------------------------------------------------ 00048 // InfQuad6 class member functions 00049 00050 bool InfQuad6::is_vertex(const unsigned int i) const 00051 { 00052 if (i < 2) 00053 return true; 00054 return false; 00055 } 00056 00057 bool InfQuad6::is_edge(const unsigned int i) const 00058 { 00059 if (i < 2) 00060 return false; 00061 return true; 00062 } 00063 00064 bool InfQuad6::is_face(const unsigned int) const 00065 { 00066 return false; 00067 } 00068 00069 bool InfQuad6::is_node_on_side(const unsigned int n, 00070 const unsigned int s) const 00071 { 00072 libmesh_assert_less (s, n_sides()); 00073 for (unsigned int i = 0; i != 3; ++i) 00074 if (side_nodes_map[s][i] == n) 00075 return true; 00076 return false; 00077 } 00078 00079 #ifdef LIBMESH_ENABLE_AMR 00080 00081 const float InfQuad6::_embedding_matrix[2][6][6] = 00082 { 00083 // embedding matrix for child 0 00084 { 00085 // 0 1 2 3 4 5th parent node 00086 { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, // 0th child node 00087 { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 }, // 1 00088 { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 }, // 2 00089 { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 }, // 3 00090 { 0.375, -0.125, 0.0, 0.0, 0.75, 0.0 }, // 4 00091 { 0.0, 0.0, 0.375, -0.125, 0.0, 0.75 } // 5 00092 }, 00093 00094 // embedding matrix for child 1 00095 { 00096 // 0 1 2 3 4 5th parent node 00097 { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 }, // 0th child node 00098 { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 }, // 1 00099 { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 }, // 2 00100 { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, // 3 00101 { -0.125, 0.375, 0.0, 0.0, 0.75, 0.0 }, // 4 00102 { 0.0, 0.0, -0.125, 0.375, 0.0, 0.75 } // 5 00103 } 00104 }; 00105 00106 #endif 00107 00108 00109 00110 00111 AutoPtr<Elem> InfQuad6::build_side (const unsigned int i, 00112 bool proxy) const 00113 { 00114 // libmesh_assert_less (i, this->n_sides()); 00115 00116 if (proxy) 00117 { 00118 switch (i) 00119 { 00120 case 0: 00121 { 00122 AutoPtr<Elem> ap(new Side<Edge3,InfQuad6>(this,i)); 00123 return ap; 00124 } 00125 case 1: 00126 case 2: 00127 { 00128 AutoPtr<Elem> ap(new Side<InfEdge2,InfQuad6>(this,i)); 00129 return ap; 00130 } 00131 default: 00132 libmesh_error(); 00133 } 00134 } 00135 00136 else 00137 { 00138 switch (i) 00139 { 00140 case 0: 00141 { 00142 Edge3* edge = new Edge3; 00143 00144 edge->set_node(0) = this->get_node(0); 00145 edge->set_node(1) = this->get_node(1); 00146 edge->set_node(2) = this->get_node(4); 00147 00148 AutoPtr<Elem> ap(edge); return ap; 00149 } 00150 00151 case 1: 00152 { 00153 // adjacent to another infinite element 00154 InfEdge2* edge = new InfEdge2; 00155 00156 edge->set_node(0) = this->get_node(1); 00157 edge->set_node(1) = this->get_node(3); 00158 00159 AutoPtr<Elem> ap(edge); return ap; 00160 } 00161 00162 case 2: 00163 { 00164 // adjacent to another infinite element 00165 InfEdge2* edge = new InfEdge2; 00166 00167 edge->set_node(0) = this->get_node(0); // be aware of swapped nodes, 00168 edge->set_node(1) = this->get_node(2); // compared to conventional side numbering 00169 00170 AutoPtr<Elem> ap(edge); return ap; 00171 } 00172 default: 00173 { 00174 libmesh_error(); 00175 AutoPtr<Elem> ap(NULL); return ap; 00176 } 00177 } 00178 } 00179 00180 // We will never get here... 00181 libmesh_error(); 00182 AutoPtr<Elem> ap(NULL); return ap; 00183 } 00184 00185 00186 00187 00188 void InfQuad6::connectivity(const unsigned int sf, 00189 const IOPackage iop, 00190 std::vector<dof_id_type>& conn) const 00191 { 00192 libmesh_assert_less (sf, this->n_sub_elem()); 00193 libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE); 00194 00195 conn.resize(4); 00196 00197 switch (iop) 00198 { 00199 case TECPLOT: 00200 { 00201 switch(sf) 00202 { 00203 case 0: 00204 // linear sub-quad 0 00205 conn[0] = this->node(0)+1; 00206 conn[1] = this->node(4)+1; 00207 conn[2] = this->node(5)+1; 00208 conn[3] = this->node(2)+1; 00209 00210 return; 00211 00212 case 1: 00213 // linear sub-quad 1 00214 conn[0] = this->node(4)+1; 00215 conn[1] = this->node(1)+1; 00216 conn[2] = this->node(3)+1; 00217 conn[3] = this->node(5)+1; 00218 00219 return; 00220 00221 default: 00222 libmesh_error(); 00223 } 00224 } 00225 00226 default: 00227 libmesh_error(); 00228 } 00229 00230 libmesh_error(); 00231 } 00232 00233 00234 00235 00236 unsigned short int InfQuad6::second_order_adjacent_vertex (const unsigned int n, 00237 const unsigned int v) const 00238 { 00239 libmesh_assert_greater_equal (n, this->n_vertices()); 00240 libmesh_assert_less (n, this->n_nodes()); 00241 libmesh_assert_less (v, 2); 00242 return _second_order_adjacent_vertices[n-this->n_vertices()][v]; 00243 } 00244 00245 00246 00247 const unsigned short int InfQuad6::_second_order_adjacent_vertices[2][2] = 00248 { 00249 {0, 1}, // vertices adjacent to node 4 00250 {2, 3} // vertices adjacent to node 5 00251 }; 00252 00253 00254 00255 std::pair<unsigned short int, unsigned short int> 00256 InfQuad6::second_order_child_vertex (const unsigned int n) const 00257 { 00258 libmesh_assert_greater_equal (n, this->n_vertices()); 00259 libmesh_assert_less (n, this->n_nodes()); 00260 00261 return std::pair<unsigned short int, unsigned short int> 00262 (0, 2*n-7); 00263 } 00264 00265 } // namespace libMesh 00266 00267 00268 00269 00270 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:46 UTC
Hosted By: