MFEM v2.0
|
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 #ifndef MFEM_TRIANGLE 00013 #define MFEM_TRIANGLE 00014 00016 class Triangle : public Element 00017 { 00018 protected: 00019 int indices[3]; 00020 static const int edges[3][2]; 00021 00022 public: 00023 00024 Triangle() : Element(Geometry::TRIANGLE) { } 00025 00027 Triangle(const int *ind, int attr = 1); 00028 00030 Triangle(int ind1, int ind2, int ind3, int attr = 1); 00031 00033 int NeedRefinement(DSTable &v_to_v, int *middle) const; 00034 00036 virtual void SetVertices(const int *ind); 00037 00041 virtual void MarkEdge(DenseMatrix & pmat); 00042 00044 virtual void MarkEdge(const DSTable &v_to_v, const int *length); 00045 00047 virtual int GetType() const { return Element::TRIANGLE; } 00048 00050 virtual void GetVertices(Array<int> &v) const; 00051 00052 virtual int *GetVertices() { return indices; } 00053 00054 virtual int GetNVertices() const { return 3; } 00055 00056 virtual int GetNEdges() const { return(3); } 00057 00058 virtual const int *GetEdgeVertices(int ei) const { return(edges[ei]); } 00059 00060 virtual Element *Duplicate(Mesh *m) const 00061 { return new Triangle(indices, attribute); } 00062 00063 virtual ~Triangle() { } 00064 }; 00065 00066 extern Linear2DFiniteElement TriangleFE; 00067 00068 #endif