MFEM  v3.3
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
segment.cpp
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 
13 #include "mesh_headers.hpp"
14 
15 namespace mfem
16 {
17 
18 Segment::Segment( const int *ind, int attr ) : Element(Geometry::SEGMENT)
19 {
20  attribute = attr;
21  for (int i=0; i<2; i++)
22  {
23  indices[i] = ind[i];
24  }
25 }
26 
27 Segment::Segment( int ind1, int ind2, int attr ) : Element(Geometry::SEGMENT)
28 {
29  attribute = attr;
30  indices[0] = ind1;
31  indices[1] = ind2;
32 }
33 
34 void Segment::SetVertices(const int *ind)
35 {
36  indices[0] = ind[0];
37  indices[1] = ind[1];
38 }
39 
41 {
42  v.SetSize( 2 );
43  for (int i=0; i<2; i++)
44  {
45  v[i] = indices[i];
46  }
47 }
48 
50 
51 }
int indices[2]
Definition: segment.hpp:25
Class for linear FE on interval.
Definition: fe.hpp:478
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:32
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
Definition: array.hpp:349
virtual int * GetVertices()
Definition: segment.hpp:47
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
Linear1DFiniteElement SegmentFE
Definition: segment.cpp:49