MFEM  v3.0
 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.googlecode.com.
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 
22 class Segment : public Element
23 {
24 protected:
25  int indices[2];
26 
27 public:
28 
30 
32  Segment(const int *ind, int attr = 1);
33 
35  Segment(int ind1, int ind2, int attr = 1);
36 
38  virtual void SetVertices(const int *ind);
39 
41  virtual int GetType() const { return Element::SEGMENT; }
42 
44  virtual void GetVertices(Array<int> &v) const;
45 
46  virtual int *GetVertices() { return indices; }
47 
48  virtual int GetNVertices() const { return 2; }
49 
50  virtual int GetNEdges() const { return(0); }
51 
52  virtual const int *GetEdgeVertices(int ei) const { return NULL; }
53 
54  virtual int GetNFaces(int &nFaceVertices) const
55  { nFaceVertices = 0; return 0; }
56 
57  virtual const int *GetFaceVertices(int fi) const { return NULL; }
58 
59  virtual Element *Duplicate(Mesh *m) const
60  { return new Segment(indices, attribute); }
61 
62  virtual ~Segment() { }
63 };
64 
65 extern Linear1DFiniteElement SegmentFE;
66 
67 }
68 
69 #endif
virtual int GetType() const
Return element&#39;s type.
Definition: segment.hpp:41
virtual int GetNFaces(int &nFaceVertices) const
Definition: segment.hpp:54
virtual int GetNEdges() const
Definition: segment.hpp:50
int indices[2]
Definition: segment.hpp:25
virtual ~Segment()
Definition: segment.hpp:62
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:32
virtual int GetNVertices() const
Definition: segment.hpp:48
virtual const int * GetFaceVertices(int fi) const
Definition: segment.hpp:57
virtual int * GetVertices()
Definition: segment.hpp:46
virtual Element * Duplicate(Mesh *m) const
Definition: segment.hpp:59
virtual void SetVertices(const int *ind)
Set the indices the element according to the input.
Definition: segment.cpp:30
Abstract data type element.
Definition: element.hpp:27
Data type line segment element.
Definition: segment.hpp:22
Linear1DFiniteElement SegmentFE
Definition: segment.cpp:41
virtual const int * GetEdgeVertices(int ei) const
Definition: segment.hpp:52