XC Open source finite element analysis program
MeshEdge.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 
27 #ifndef MeshEdge_h
28 #define MeshEdge_h
29 
30 #include "domain/mesh/element/Element.h"
31 
32 namespace XC {
33 
34 class DqPtrsElem;
35 
37 //
39 class MeshEdge: public EntCmd
40  {
41  public:
42  typedef Element::NodesEdge NodesEdge;
43  private:
44  NodesEdge nodes;
45  typedef std::set<const Element *> ElementConstPtrSet;
46  public:
47  MeshEdge(void);
48  MeshEdge(const NodesEdge &);
49  NodesEdge getNodes(void) const;
50  inline size_t size(void) const
51  { return nodes.size(); }
52  const Node *getFirstNode(void) const;
53  const Node *getLastNode(void) const;
54  bool isConnected(const Node &) const;
55  bool isConnected(const MeshEdge &) const;
56  ElementConstPtrSet getConnectedElements(void) const;
57  ElementConstPtrSet getConnectedElements(const DqPtrsElem &) const;
58  bool operator==(const MeshEdge &) const;
59  void print(std::ostream &) const;
60  };
61 
62 inline std::ostream &operator<<(std::ostream &os, const MeshEdge &me)
63  {
64  me.print(os);
65  return os;
66  }
67 
68 } // end of XC namespace
69 
70 #endif
71 
MeshEdge(void)
Constructor.
Definition: MeshEdge.cc:34
Mesh edge.
Definition: MeshEdge.h:39
std::vector< const Node * > NodesEdge
Definition: Element.h:108
Mesh node.
Definition: Node.h:99
bool operator==(const MeshEdge &) const
Equal operator.
Definition: MeshEdge.cc:110
NodesEdge getNodes(void) const
Returns the edge nodes.
Definition: MeshEdge.cc:42
Pointer to element container.
Definition: DqPtrsElem.h:45
ElementConstPtrSet getConnectedElements(void) const
Returns a deque<Element *> with the elements that share the edge.
Definition: MeshEdge.cc:78
const Node * getFirstNode(void) const
Returns the first node from the edge:
Definition: MeshEdge.cc:49
================================================================================
Definition: ContinuaReprComponent.h:34
const Node * getLastNode(void) const
Returns the last node from the edge:
Definition: MeshEdge.cc:56
void print(std::ostream &) const
Prints edge information.
Definition: MeshEdge.cc:103
bool isConnected(const Node &) const
Returns true if the edge is connected to the node.
Definition: MeshEdge.cc:60