edge_inf_edge2.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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 #include "libmesh/libmesh_config.h"
21 
22 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
23 
24 // Local includes
25 #include "libmesh/edge_inf_edge2.h"
27 #include "libmesh/enum_order.h"
28 
29 namespace libMesh
30 {
31 
32 
33 // ------------------------------------------------------------
34 // InfEdge2 class member functions
35 
36 bool InfEdge2::is_vertex(const unsigned int i) const
37 {
38  if (i)
39  return false;
40  return true;
41 }
42 
43 bool InfEdge2::is_edge(const unsigned int i) const
44 {
45  if (i)
46  return true;
47  return false;
48 }
49 
50 bool InfEdge2::is_face(const unsigned int) const
51 {
52  return false;
53 }
54 
55 bool InfEdge2::is_node_on_side(const unsigned int n,
56  const unsigned int s) const
57 {
58  libmesh_assert_less (s, 1);
59  return (s == n);
60 }
61 
62 std::vector<unsigned>
63 InfEdge2::nodes_on_side(const unsigned int s) const
64 {
65  libmesh_assert_less(s, 1);
66  return {s};
67 }
68 
69 bool InfEdge2::is_node_on_edge(const unsigned int,
70  const unsigned int libmesh_dbg_var(e)) const
71 {
72  libmesh_assert_equal_to (e, 0);
73  return true;
74 }
75 
77 {
78  return FIRST;
79 }
80 
81 void InfEdge2::connectivity(const unsigned int libmesh_dbg_var(se),
82  const IOPackage iop,
83  std::vector<dof_id_type> & conn) const
84 {
85  libmesh_assert_equal_to (se, 0);
86  libmesh_assert_less (se, this->n_sub_elem());
87  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
88 
89  conn.resize(2);
90 
91  switch (iop)
92  {
93  case TECPLOT:
94  {
95  conn[0] = this->node_id(0)+1;
96  conn[1] = this->node_id(1)+1;
97  return;
98  }
99 
100  case VTK:
101  {
102  conn[0] = this->node_id(0);
103  conn[1] = this->node_id(1);
104  return;
105  }
106 
107  default:
108  libmesh_error_msg("Unsupported IO package " << iop);
109  }
110 }
111 
112 } // namespace libMesh
113 
114 
115 #endif
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
virtual unsigned int n_sub_elem() const override
virtual bool is_vertex(const unsigned int i) const override
virtual Order default_order() const override
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
virtual bool is_face(const unsigned int i) const override
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1914
virtual void connectivity(const unsigned int se, const IOPackage iop, std::vector< dof_id_type > &conn) const override
virtual bool is_edge(const unsigned int i) const override