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