amesh.h 899 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef _AMESH_H
#define _AMESH_H
#include "inmost.h"

namespace INMOST
{
	class AdaptiveMesh : public Mesh
	{
		ElementSet root; //< Root set that links all the other sets for coarsements
		TagInteger level; //< Refinement level of the cell
		TagReference parent_set; //<Link to the set that contains an element.
		TagReferenceArray hanging_nodes; //< Link to current hanging nodes of the cell.
		/// Prepare sets for coarsements.
		/// Do not do this in constructor, since mesh may contain no cells.
		void PrepareSet();
	public:
		Storage::integer GetLevel(const Storage & e) {return level[e];}
		AdaptiveMesh();
		~AdaptiveMesh();
		/// Indicator must be 1 on cells to be refined
		/// and 0 on all other cells
		bool Refine(TagInteger & indicator);
		bool Coarse(TagInteger & indicator);
		/// Delete all data related to mesh refinement-coarsement.
		void ClearData();
	};
}

#endif //_AMESH_H