face_inf_quad.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 // Local includes 00020 #include "libmesh/libmesh_config.h" 00021 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 00022 00023 // C++ includes 00024 00025 // Local includes cont'd 00026 #include "libmesh/face_inf_quad.h" 00027 #include "libmesh/edge_edge2.h" 00028 #include "libmesh/edge_inf_edge2.h" 00029 00030 namespace libMesh 00031 { 00032 00033 00034 // ------------------------------------------------------------ 00035 // InfQuad class member functions 00036 dof_id_type InfQuad::key (const unsigned int s) const 00037 { 00038 libmesh_assert_less (s, this->n_sides()); 00039 00040 00041 switch (s) 00042 { 00043 case 0: 00044 00045 return 00046 this->compute_key (this->node(0), 00047 this->node(1)); 00048 00049 case 1: 00050 00051 return 00052 this->compute_key (this->node(1), 00053 this->node(3)); 00054 00055 case 2: 00056 00057 return 00058 this->compute_key (this->node(0), 00059 this->node(2)); 00060 } 00061 00062 // We will never get here... Look at the code above. 00063 libmesh_error(); 00064 return 0; 00065 } 00066 00067 00068 00069 AutoPtr<Elem> InfQuad::side (const unsigned int i) const 00070 { 00071 libmesh_assert_less (i, this->n_sides()); 00072 00073 00074 switch (i) 00075 { 00076 case 0: 00077 { 00078 // base face 00079 Edge2* edge = new Edge2; 00080 00081 edge->set_node(0) = this->get_node(0); 00082 edge->set_node(1) = this->get_node(1); 00083 00084 AutoPtr<Elem> ap(edge); return ap; 00085 } 00086 00087 case 1: 00088 { 00089 // adjacent to another infinite element 00090 InfEdge2* edge = new InfEdge2; 00091 00092 edge->set_node(0) = this->get_node(1); 00093 edge->set_node(1) = this->get_node(3); 00094 00095 AutoPtr<Elem> ap(edge); return ap; 00096 } 00097 00098 case 2: 00099 { 00100 // adjacent to another infinite element 00101 InfEdge2* edge = new InfEdge2; 00102 00103 edge->set_node(0) = this->get_node(0); // be aware of swapped nodes, 00104 edge->set_node(1) = this->get_node(2); // compared to conventional side numbering 00105 00106 AutoPtr<Elem> ap(edge); return ap; 00107 } 00108 00109 default: 00110 { 00111 libmesh_error(); 00112 AutoPtr<Elem> ap(NULL); return ap; 00113 } 00114 } 00115 00116 // We will never get here... Look at the code above. 00117 libmesh_error(); 00118 AutoPtr<Elem> ap(NULL); return ap; 00119 } 00120 00121 00122 00123 bool InfQuad::is_child_on_side(const unsigned int c, 00124 const unsigned int s) const 00125 { 00126 libmesh_assert_less (c, this->n_children()); 00127 libmesh_assert_less (s, this->n_sides()); 00128 00129 return (s == 0 || s == c+1); 00130 } 00131 00132 00133 00134 Real InfQuad::quality (const ElemQuality) const 00135 { 00136 return 0.; // Not implemented 00137 } 00138 00139 00140 00141 00142 std::pair<Real, Real> InfQuad::qual_bounds (const ElemQuality q) const 00143 { 00144 std::pair<Real, Real> bounds; 00145 00146 switch (q) 00147 { 00148 00149 case ASPECT_RATIO: 00150 bounds.first = 1.; 00151 bounds.second = 4.; 00152 break; 00153 00154 case SKEW: 00155 bounds.first = 0.; 00156 bounds.second = 0.5; 00157 break; 00158 00159 case TAPER: 00160 bounds.first = 0.; 00161 bounds.second = 0.7; 00162 break; 00163 00164 case WARP: 00165 bounds.first = 0.9; 00166 bounds.second = 1.; 00167 break; 00168 00169 case STRETCH: 00170 bounds.first = 0.25; 00171 bounds.second = 1.; 00172 break; 00173 00174 case MIN_ANGLE: 00175 bounds.first = 45.; 00176 bounds.second = 90.; 00177 break; 00178 00179 case MAX_ANGLE: 00180 bounds.first = 90.; 00181 bounds.second = 135.; 00182 break; 00183 00184 case CONDITION: 00185 bounds.first = 1.; 00186 bounds.second = 4.; 00187 break; 00188 00189 case JACOBIAN: 00190 bounds.first = 0.5; 00191 bounds.second = 1.; 00192 break; 00193 00194 case SHEAR: 00195 case SHAPE: 00196 case SIZE: 00197 bounds.first = 0.3; 00198 bounds.second = 1.; 00199 break; 00200 00201 case DISTORTION: 00202 bounds.first = 0.6; 00203 bounds.second = 1.; 00204 break; 00205 00206 default: 00207 libMesh::out << "Warning: Invalid quality measure chosen." << std::endl; 00208 bounds.first = -1; 00209 bounds.second = -1; 00210 } 00211 00212 return bounds; 00213 } 00214 00215 } // namespace libMesh 00216 00217 00218 00219 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:46 UTC
Hosted By: