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_VERTEX 00013 #define MFEM_VERTEX 00014 00016 class Vertex 00017 { 00018 protected: 00019 double coord[3]; 00020 00021 public: 00022 Vertex() { } 00023 00024 Vertex (double *xx, int dim); 00025 Vertex( double x, double y) { coord[0] = x; coord[1] = y; coord[2] = 0.; } 00026 Vertex( double x, double y, double z) 00027 { coord[0] = x; coord[1] = y; coord[2] = z; } 00028 00030 inline double * operator() () const { return (double*)coord; } 00031 00033 inline double & operator() (int i) { return coord[i]; } 00034 00036 inline const double & operator() (int i) const { return coord[i]; } 00037 00038 void SetCoords(const double *p) 00039 { coord[0] = p[0]; coord[1] = p[1]; coord[2] = p[2]; } 00040 00041 ~Vertex() { } 00042 }; 00043 00044 #endif