From 406f2d1179c8bf1bc142f50f2e37165e9d221f40 Mon Sep 17 00:00:00 2001 From: Karsten Rink <karsten.rink@ufz.de> Date: Tue, 18 Dec 2012 10:21:08 +0100 Subject: [PATCH] added missing files --- MeshLib/ElementStatus.cpp | 24 ++++++++++++++++++ MeshLib/ElementStatus.h | 51 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 MeshLib/ElementStatus.cpp create mode 100644 MeshLib/ElementStatus.h diff --git a/MeshLib/ElementStatus.cpp b/MeshLib/ElementStatus.cpp new file mode 100644 index 00000000000..b87cf58939f --- /dev/null +++ b/MeshLib/ElementStatus.cpp @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + * + * \file ElementStatus.cpp + * + * Created on 2012-12-18 by Karsten Rink + */ + +#include "ElementStatus.h" + +namespace MeshLib { + +ElementStatus::ElementStatus(Mesh const*const mesh) +: _mesh(mesh), _status(mesh->getNElements(), true) +{ +} + + +} + diff --git a/MeshLib/ElementStatus.h b/MeshLib/ElementStatus.h new file mode 100644 index 00000000000..ad41759b0fc --- /dev/null +++ b/MeshLib/ElementStatus.h @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + * + * \file ElementStatus.h + * + * Created on 2012-12-18 by Karsten Rink + */ + +#ifndef ELEMENTSTATUS_H_ +#define ELEMENTSTATUS_H_ + +#include "Mesh.h" + +namespace MeshLib { + +/** + * An object to store which elements of the mesh are active and which are inactive + */ +class ElementStatus +{ + +public: + /// Constructor using mesh + ElementStatus(Mesh const*const mesh); + + bool getElementStatus(unsigned i) { return _status[i]; }; + + bool isActive(unsigned i) { return _status[i]; }; + + void setActive(unsigned i) { _status[i] = true; }; + + void setInactive(unsigned i) { _status[i] = false; }; + + void setElementStatus(unsigned i, bool status) { _status[i] = status; }; + + ~ElementStatus() {}; + +protected: + Mesh const*const _mesh; + std::vector<bool> _status; + +}; /* class */ + +} /* namespace */ + +#endif /* ELEMENTSTATUS_H_ */ + -- GitLab