MFEM  v3.3.2
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
segment.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_SEGMENT
13 #define MFEM_SEGMENT
14 
15 #include "../config/config.hpp"
16 #include "element.hpp"
17 
18 namespace mfem
19 {
20 
21 /// Data type line segment element
22 class Segment : public Element
23 {
24 protected:
25  int indices[2];
26 
27 public:
29 
31 
32  /// Constructs triangle by specifying the indices and the attribute.
33  Segment(const int *ind, int attr = 1);
34 
35  /// Constructs triangle by specifying the indices and the attribute.
36  Segment(int ind1, int ind2, int attr = 1);
37 
38  /// Set the indices the element according to the input.
39  virtual void SetVertices(const int *ind);
40 
41  /// Return element's type.
42  virtual int GetType() const { return Element::SEGMENT; }
43 
44  /// Returns the indices of the element's vertices.
45  virtual void GetVertices(Array<int> &v) const;
46 
47  virtual int *GetVertices() { return indices; }
48 
49  virtual int GetNVertices() const { return 2; }
50 
51  virtual int GetNEdges() const { return (0); }
52 
53  virtual const int *GetEdgeVertices(int ei) const { return NULL; }
54 
55  virtual int GetNFaces(int &nFaceVertices) const
56  { nFaceVertices = 0; return 0; }
57 
58  virtual const int *GetFaceVertices(int fi) const { return NULL; }
59 
60  virtual Element *Duplicate(Mesh *m) const
61  { return new Segment(indices, attribute); }
62 
63  virtual ~Segment() { }
64 };
65 
66 class Linear1DFiniteElement;
67 extern Linear1DFiniteElement SegmentFE;
68 
69 }
70 
71 #endif
virtual int GetType() const
Return element&#39;s type.
Definition: segment.hpp:42
virtual int GetNFaces(int &nFaceVertices) const
Definition: segment.hpp:55
virtual int GetNEdges() const
Definition: segment.hpp:51
int indices[2]
Definition: segment.hpp:25
virtual ~Segment()
Definition: segment.hpp:63
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:32
Geometry::Constants< Geometry::SEGMENT > geom_t
Definition: segment.hpp:28
virtual int GetNVertices() const
Definition: segment.hpp:49
virtual const int * GetFaceVertices(int fi) const
Definition: segment.hpp:58
virtual int * GetVertices()
Definition: segment.hpp:47
virtual Element * Duplicate(Mesh *m) const
Definition: segment.hpp:60
virtual void SetVertices(const int *ind)
Set the indices the element according to the input.
Definition: segment.cpp:34
Abstract data type element.
Definition: element.hpp:27
Data type line segment element.
Definition: segment.hpp:22
Linear1DFiniteElement SegmentFE
Definition: segment.cpp:49
virtual const int * GetEdgeVertices(int ei) const
Definition: segment.hpp:53