libMesh
edge_inf_edge2.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2025 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"
26 #include "libmesh/enum_io_package.h"
27 #include "libmesh/enum_order.h"
28 
29 namespace libMesh
30 {
31 
32 // ------------------------------------------------------------
33 // InfEdge2 class static member initializations
34 const int InfEdge2::num_nodes;
35 
36 // ------------------------------------------------------------
37 // InfEdge2 class member functions
38 
39 bool InfEdge2::is_vertex(const unsigned int i) const
40 {
41  if (i)
42  return false;
43  return true;
44 }
45 
46 bool InfEdge2::is_edge(const unsigned int i) const
47 {
48  if (i)
49  return true;
50  return false;
51 }
52 
53 bool InfEdge2::is_face(const unsigned int) const
54 {
55  return false;
56 }
57 
58 bool InfEdge2::is_node_on_side(const unsigned int n,
59  const unsigned int s) const
60 {
61  libmesh_assert_less (s, 1);
62  return (s == n);
63 }
64 
65 std::vector<unsigned>
66 InfEdge2::nodes_on_side(const unsigned int s) const
67 {
68  libmesh_assert_less(s, 1);
69  return {s};
70 }
71 
72 bool InfEdge2::is_node_on_edge(const unsigned int,
73  const unsigned int libmesh_dbg_var(e)) const
74 {
75  libmesh_assert_equal_to (e, 0);
76  return true;
77 }
78 
80 {
81  return FIRST;
82 }
83 
84 void InfEdge2::connectivity(const unsigned int libmesh_dbg_var(se),
85  const IOPackage iop,
86  std::vector<dof_id_type> & conn) const
87 {
88  libmesh_assert_equal_to (se, 0);
89  libmesh_assert_less (se, this->n_sub_elem());
90  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
91 
92  conn.resize(2);
93 
94  switch (iop)
95  {
96  case TECPLOT:
97  {
98  conn[0] = this->node_id(0)+1;
99  conn[1] = this->node_id(1)+1;
100  return;
101  }
102 
103  case VTK:
104  {
105  conn[0] = this->node_id(0);
106  conn[1] = this->node_id(1);
107  return;
108  }
109 
110  default:
111  libmesh_error_msg("Unsupported IO package " << iop);
112  }
113 }
114 
115 } // namespace libMesh
116 
117 
118 #endif
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
virtual unsigned int n_sub_elem() const override
The libMesh namespace provides an interface to certain functionality in the library.
virtual bool is_vertex(const unsigned int i) const override
virtual Order default_order() const override
static const int num_nodes
Geometric constants for InfEdge2.
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:2475
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