libMesh
edge_inf_edge2.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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/libmesh_config.h"
22 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
23 
24 #include "libmesh/edge_inf_edge2.h"
25 
26 namespace libMesh
27 {
28 
29 
30 // ------------------------------------------------------------
31 // InfEdge2 class member functions
32 
33 bool InfEdge2::is_vertex(const unsigned int i) const
34 {
35  if (i)
36  return false;
37  return true;
38 }
39 
40 bool InfEdge2::is_edge(const unsigned int i) const
41 {
42  if (i)
43  return true;
44  return false;
45 }
46 
47 bool InfEdge2::is_face(const unsigned int) const
48 {
49  return false;
50 }
51 
52 bool InfEdge2::is_node_on_side(const unsigned int n,
53  const unsigned int s) const
54 {
55  libmesh_assert_less (s, 1);
56  return (s == n);
57 }
58 
59 bool InfEdge2::is_node_on_edge(const unsigned int,
60  const unsigned int libmesh_dbg_var(e)) const
61 {
62  libmesh_assert_equal_to (e, 0);
63  return true;
64 }
65 
66 void InfEdge2::connectivity(const unsigned int libmesh_dbg_var(se),
67  const IOPackage iop,
68  std::vector<dof_id_type> & conn) const
69 {
70  libmesh_assert_equal_to (se, 0);
71  libmesh_assert_less (se, this->n_sub_elem());
72  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
73 
74  conn.resize(2);
75 
76  switch (iop)
77  {
78  case TECPLOT:
79  {
80  conn[0] = this->node_id(0)+1;
81  conn[1] = this->node_id(1)+1;
82  return;
83  }
84 
85  case VTK:
86  {
87  conn[0] = this->node_id(0);
88  conn[1] = this->node_id(1);
89  return;
90  }
91 
92  default:
93  libmesh_error_msg("Unsupported IO package " << iop);
94  }
95 }
96 
97 } // namespace libMesh
98 
99 
100 #endif
The libMesh namespace provides an interface to certain functionality in the library.
virtual bool is_face(const unsigned int i) const libmesh_override
virtual unsigned int n_sub_elem() const libmesh_override
PetscErrorCode Vec Mat libmesh_dbg_var(j)
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const libmesh_override
virtual bool is_vertex(const unsigned int i) const libmesh_override
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1831
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
virtual bool is_edge(const unsigned int i) const libmesh_override
virtual void connectivity(const unsigned int se, const IOPackage iop, std::vector< dof_id_type > &conn) const libmesh_override
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const libmesh_override