6#ifndef __FIBER_SKELETONID_HPP
7#define __FIBER_SKELETONID_HPP "Created 27.02.2001 21:42:27 by werner"
10#include <fiber/field/DynamicSize.hpp>
33 explicit SkeletonID(
int dimension,
int index_depth=0);
38 : index_depth(IndexDepth)
50 struct RefinementConstructorArg {};
51 struct RefinementCreationArg {};
101 const DynamicSize&Size()
const
107 const DynamicSize&RefinementSize()
const
113 const DynamicSize&getRefinementSize()
const
120 DynamicSize&setSize(
int N,
const T values[])
122 return domainsize.
setSize(N, values);
126 DynamicSize&setRefinementSize(
int N,
const T values[])
128 return refinement.
setSize(N, values);
132 auto setSize(
const MultiIndex<N>&I)
138 DynamicSize&setRefinementSize(
const MultiIndex<N>&I)
164 index_t Refinement(
unsigned int i)
const
166 return refinement[i];
175 for(
int i=0; i<refinement.
getRank(); i++)
177 if (refinement[i] != F)
195 for(
int i=1; i<refinement.
getRank(); i++)
197 if (refinement[i] !=
L)
204 index_t getTotalRefinement()
const
208 for(
int i=0; i<refinement.
getRank(); i++)
212 return TotalRefinement;
215 unsigned getDomainSize(
unsigned i)
const
217 return unsigned( domainsize[i] );
221 bool setSize(
unsigned i, index_t extension)
223 return domainsize.
setSize( i, extension);
227 bool setSize(MultiIndex<N>&MI)
const
229 return domainsize.
setSize( MI );
232 bool setSize(
const DynamicSize&DS)
const
234 return domainsize.
setSize( DS, 1 );
237 const DynamicSize&setRefinementSize(
const DynamicSize&DS)
239 return refinement = DS;
243 bool setRefinement(
unsigned i, index_t extension)
245 return refinement.
setSize( i, extension);
253 for (
auto i = 0; i < Dims(); ++i)
259 if( NumberOfRefinementLevels() > 1)
262 if( NumberOfRefinementLevels() == 1)
264 if( refinement[0] > 0 )
281 os <<
"( depth: " << SID.IndexDepth() <<
", dims: " << SID.Dims() <<
", refs: " << SID.NumberOfRefinementLevels();
283 for(
auto i = 0; i < SID.NumberOfRefinementLevels(); i++ )
284 os <<
", ref[" << i <<
"]:" << SID.Refinement( i );
299 if (
L.domainsize.getRank() != R.domainsize.
getRank())
302 if (
L.refinement != R.refinement)
317 bool operator!()
const;
337 +
", refinement=" +
to_string( SID.RefinementSize())
344#ifdef __MEMCORE_VERBOSE_HPP
basic_ostream< char > ostream
basic_string< char > string
bool operator<(const multimap< _Key, _Tp, _Compare, _Alloc > &__x, const multimap< _Key, _Tp, _Compare, _Alloc > &__y)
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
A class describing an n-dimensional space at runtime.
Definition field/DynamicSize.hpp:29
bool changeSize(const MultiIndex< N > &MI)
Adjust size for lowest matching dimensions.
Definition field/DynamicSize.hpp:291
DynamicSize & setSize(int N, const T values[])
Assign values from arbitrary type that is convertible into integers.
Definition field/DynamicSize.hpp:107
rank_t getRank() const
Dimensionality of the domain (same as rank).
Definition field/DynamicSize.hpp:220
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
int NumberOfRefinementLevels() const
Number of available refinement levels This usually matches Dims, but in case of Dims=0 also allows a ...
Definition SkeletonID.hpp:159
int IndexDepth() const
Index depth of this skeleton.
Definition SkeletonID.hpp:89
index_t getHomogeneousLevel() const
IF this skeleton ID refers to a refinement level that is same in all dimensions, return that single i...
Definition SkeletonID.hpp:189
int Dims() const
Dimensionality of this skeleton.
Definition SkeletonID.hpp:144
bool isIsotropicRefinementFactor(index_t F) const
Check if the given skeleton ID corresponds to a refinement by factor F in all dimensions.
Definition SkeletonID.hpp:173
friend bool operator!=(const SkeletonID &L, const SkeletonID &R)
Check if two SkeletonIDs differ.
Definition SkeletonID.hpp:311
static SkeletonID nextRefinement(const SkeletonID &Sid, int refinement_increment)
Create a SkeletonID that is refined by a certain increment.
Definition SkeletonID.hpp:71
const SkeletonID & ID() const
Shortcut to ease type conversion in child classes.
Definition SkeletonID.hpp:63
friend bool operator==(const SkeletonID &L, const SkeletonID &R)
Check if SkeletonIDs are identical.
Definition SkeletonID.hpp:294
int getRank() const
Dimensionality of this skeleton.
Definition SkeletonID.hpp:150
void setIsotropicRefinement(index_t ref_level)
Set the same refinement level in all dimensions of the skeleton dimensionality.
Definition SkeletonID.hpp:251
static SkeletonID refinedSkeleton(const SkeletonID &Sid, int refinement_value)
Create a SkeletonID that is refined by a certain value.
Definition SkeletonID.hpp:79
Anemone_Context_t operator<<(Anemone &A, VRenderContext &VC)
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
IndexTypeConfig< sizeof(void *)>::index_t index_t
Define the index type as according to the size of a pointer, i.e.
Definition Index.hpp:22
std::string to_string(const span< char > &s)
string to_string(const Eagle::FixedArray< ElementType, N > &A, const char *OpenBrace="{", const char *CloseBrace="}", const char *Separator=",")