DOFContainer.h 2.03 KB
 Peter Gottschling committed Feb 15, 2008 1 2 3 4 ``````// ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == == `````` Thomas Witkowski committed Dec 16, 2010 5 ``````// == http://www.amdis-fem.org == `````` Peter Gottschling committed Feb 15, 2008 6 7 ``````// == == // ============================================================================ `````` Thomas Witkowski committed Dec 16, 2010 8 9 10 11 12 13 14 15 16 17 18 19 ``````// // Software License for AMDiS // // Copyright (c) 2010 Dresden University of Technology // All rights reserved. // Authors: Simon Vey, Thomas Witkowski et al. // // This file is part of AMDiS // // See also license.opensource.txt in the distribution. `````` Peter Gottschling committed Feb 15, 2008 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 `````` /** \file DOFContainer.h */ #ifndef AMDIS_DOFCONTAINER_H #define AMDIS_DOFCONTAINER_H #include "Global.h" namespace AMDiS { /** \ingroup DOFAdministration * \brief * DOFContainer is the base class for objects that stores DOF indices. * After a DOFContainer object is registered to a DOFAdmin, the DOF * indices of the container will be managed during DOF compression. The * DOFAdmin then calls the compress method of every registered DOFContainer. */ class DOFContainer { public: `````` Thomas Witkowski committed May 07, 2009 40 `````` virtual ~DOFContainer() {} `````` Peter Gottschling committed Feb 15, 2008 41 42 43 44 45 46 47 `````` /** \brief * Returns the DOF index at position i. Must be overriden by a concrete * DOFContainer. */ virtual DegreeOfFreedom& operator[](int i) = 0; `````` Thomas Witkowski committed Sep 16, 2010 48 `````` virtual void freeDofIndex(DegreeOfFreedom dof) {} `````` Peter Gottschling committed Feb 15, 2008 49 50 51 52 53 `````` /** \brief * Used by DOFAdmin to actualize the DOF indices in this container after * DOF compression. */ `````` Thomas Witkowski committed Sep 16, 2010 54 `````` virtual void compressDofContainer(int size, std::vector &newDOF) `````` Peter Gottschling committed Feb 15, 2008 55 `````` { `````` Praetorius, Simon committed Feb 17, 2013 56 `````` FUNCNAME_DBG("DOFContainer::compressDofContainer()"); `````` Thomas Witkowski committed Sep 16, 2010 57 `````` `````` Thomas Witkowski committed May 07, 2009 58 59 `````` for (int i = 0; i < size; i++) { int j = newDOF[operator[](i)]; `````` Thomas Witkowski committed Nov 30, 2010 60 61 62 63 64 `````` TEST_EXIT_DBG(j >= 0) ("Invalid DOF %d in DOF container! (%d %d)\n", j, i, operator[](i)); operator[](i) = j; `````` Peter Gottschling committed Feb 15, 2008 65 `````` } `````` Thomas Witkowski committed May 07, 2009 66 `````` } `````` Thomas Witkowski committed Sep 16, 2010 67 `````` `````` Peter Gottschling committed Feb 15, 2008 68 69 70 71 `````` }; } #endif``````