edge_edge2.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 // Local includes
21 #include "libmesh/edge_edge2.h"
22 
23 namespace libMesh
24 {
25 
26 
27 #ifdef LIBMESH_ENABLE_AMR
28 
29 const float Edge2::_embedding_matrix[2][2][2] =
30 {
31  // embedding matrix for child 0
32  {
33  // 0 1 2
34  {1.0, 0.0}, // 0
35  {0.5, 0.5} // 1
36  },
37 
38  // embedding matrix for child 1
39  {
40  // 0 1 2
41  {0.5, 0.5}, // 0
42  {0.0, 1.0} // 1
43  }
44 };
45 
46 #endif
47 
48 bool Edge2::is_vertex(const unsigned int) const
49 {
50  return true;
51 }
52 
53 bool Edge2::is_edge(const unsigned int) const
54 {
55  return false;
56 }
57 
58 bool Edge2::is_face(const unsigned int) const
59 {
60  return false;
61 }
62 
63 bool Edge2::is_node_on_side(const unsigned int n,
64  const unsigned int s) const
65 {
66  libmesh_assert_less (s, 2);
67  return (s == n);
68 }
69 
70 bool Edge2::is_node_on_edge(const unsigned int,
71  const unsigned int libmesh_dbg_var(e)) const
72 {
73  libmesh_assert_equal_to (e, 0);
74  return true;
75 }
76 
77 void Edge2::connectivity(const unsigned int libmesh_dbg_var(sc),
78  const IOPackage iop,
79  std::vector<dof_id_type>& conn) const
80 {
81  libmesh_assert_equal_to (sc, 0);
82  libmesh_assert_less (sc, this->n_sub_elem());
83  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
84 
85  // Create storage
86  conn.resize(2);
87 
88  switch (iop)
89  {
90  case TECPLOT:
91  {
92  conn[0] = this->node(0)+1;
93  conn[1] = this->node(1)+1;
94  return;
95  }
96 
97  case VTK:
98  {
99  conn[0] = this->node(0);
100  conn[1] = this->node(1);
101  return;
102  }
103 
104  default:
105  {
106  libmesh_error();
107  }
108  }
109 
110  libmesh_error();
111 }
112 
113 
115 {
116  // OK, so this is probably overkill, since it is equivalent to
117  // Elem::hmax() for the Edge2, but here it is nonetheless...
118  return (this->point(1) - this->point(0)).size();
119 }
120 
121 } // namespace libMesh

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:04 UTC

Hosted By:
SourceForge.net Logo