MFEM v2.0
segment.cpp
Go to the documentation of this file.
00001 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
00002 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
00003 // reserved. See file COPYRIGHT for details.
00004 //
00005 // This file is part of the MFEM library. For more information and source code
00006 // availability see http://mfem.googlecode.com.
00007 //
00008 // MFEM is free software; you can redistribute it and/or modify it under the
00009 // terms of the GNU Lesser General Public License (as published by the Free
00010 // Software Foundation) version 2.1 dated February 1999.
00011 
00012 
00013 #include "mesh_headers.hpp"
00014 
00015 Segment::Segment( const int *ind, int attr ) : Element(Geometry::SEGMENT) {
00016    attribute = attr;
00017    for (int i=0; i<2; i++)
00018       indices[i] = ind[i];
00019 }
00020 
00021 Segment::Segment( int ind1, int ind2, int attr ) : Element(Geometry::SEGMENT) {
00022    attribute  = attr;
00023    indices[0] = ind1;
00024    indices[1] = ind2;
00025 }
00026 
00027 void Segment::SetVertices(const int *ind){
00028    indices[0] = ind[0];
00029    indices[1] = ind[1];
00030 }
00031 
00032 void Segment::GetVertices( Array<int> &v ) const {
00033    v.SetSize( 2 );
00034    for (int i=0; i<2; i++)
00035       v[i] = indices[i];
00036 }
00037 
00038 Linear1DFiniteElement SegmentFE;
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines