Commit f3bbddea authored by Peter Gottschling's avatar Peter Gottschling
Browse files

checked_change_dim hinzugefuegt.

parent 349696ab
......@@ -22,6 +22,7 @@
#ifndef AMDIS_DOFINDEXED_H
#define AMDIS_DOFINDEXED_H
#include <cassert>
#include <vector>
#include "Global.h"
#include "DOFIterator.h"
......@@ -46,6 +47,14 @@ namespace AMDiS {
/// Resizes the object to size. Must be overriden by sub classes
virtual void resize(int size) = 0;
/// Check that object's size is equal to \p size or 0. If object's size is 0 change it to \p size.
virtual void checked_change_dim(int size)
{
assert(getSize() == 0 || getSize() == size);
if (getSize() == 0)
resize(size);
}
/// Used by DOFAdmin::compress. Must be overriden by sub classes
virtual void compressDOFIndexed(int first, int last,
std::vector<DegreeOfFreedom> &newDOF) = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment