FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
GridEvaluator.hpp
1#ifndef __FIBER_BASEOPERATIONS_GRIDEVALUATOR_HPP
2#define __FIBER_BASEOPERATIONS_GRIDEVALUATOR_HPP
3
4#include <field/Field.hpp>
5
6#include <grid/Grid.hpp>
7#include <bundle/Slice.hpp>
8
9#include "gridopDllApi.h"
10
11namespace Fiber
12{
13
25{
36
42 {
43 Nope,
44 Possibly,
45 Certainly,
46 YesWithLocationAlreadyFound
47 };
48
51
56
57
58 struct Context
59 {
60 Slice &mySlice;
61 RefPtr<Grid> mySourceGrid;
62 string Gridname;
63 double Res_scale;
64 double Prec_scale;
65
67 : mySlice(theSlice)
68 , Res_scale( 1.0 )
69 , Prec_scale( 0.1 )
70 {}
71 };
72
73
76
86 bool find(const RefPtr<MemBase>&DestinationCoords, const Field&SourcePositions,
88
89 GridEvaluator(const RefPtr<MemBase>&DestinationCoords, const Field&SourcePositions,
91 {
93 }
94
95
103template <class PositionsFieldType>
104 void findForSpecificDestinationPositions(const PositionsFieldType&DestinationPositions,
105 const Field&SourcePositions,
107
108
112 template <int SourceDims, class ValueType>
113 bool evalFloatIndices(std::vector<ValueType>&ResultData,
115 const Field&SourceField) const;
116
117
122 template <class ValueType>
123 bool evalType(std::vector<ValueType>&ResultData, const Field&SourceField) const;
124
125
130 template <int DestDims, class ValueType>
132 {
134
136 assert( DestinationValues->myChunk() );
137
138 std::vector<ValueType>&ResultData = DestinationValues->myChunk()->get_vector();
139
140 bool ok = evalType(ResultData, SourceField);
141 if (ok)
142 return DestinationValues;
143
144 return NullPtr();
145 }
146
147
148 template <class ValueType>
149 RefPtr<MemBase> evalFromCompatibleData(const RefPtr<MemBase>&DestinationCompatibleData,
150 const Field&SourceField) const
151 {
153 {
154 return evalDimensionalDestType<3, ValueType>(DataIs3D->Size(), SourceField);
155 }
156 if (RefPtr<MemArrayBase<2> > DataIs2D = DestinationCompatibleData)
157 {
158 return evalDimensionalDestType<2, ValueType>(DataIs2D->Size(), SourceField);
159 }
160 if (RefPtr<MemArrayBase<1> > DataIs1D = DestinationCompatibleData)
161 {
162 return evalDimensionalDestType<1, ValueType>(DataIs1D->Size(), SourceField);
163 }
164 return NullPtr();
165 }
166
167 RefPtr<MemBase> evalKnownDataTypes(const RefPtr<MemBase>&DestinationCompatibleData,
168 const Field&SourceField) const;
169
170};
171
172
173} // namespace Fiber
174
175
176#endif // __FIBER_BASEOPERATIONS_GRIDEVALUATOR_HPP
constexpr _InputIterator find(_InputIterator __first, _InputIterator __last, const _Tp &__val)
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
A Field is a collection of CreativeArrayBase reference pointers which are accessed via FragmentID obj...
Definition Field.hpp:245
Information per time slice, mainly a set of Grid objects that are accessed via GridID objects.
Definition Slice.hpp:36
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
std::nullptr_t NullPtr
StrongPtr< Object, ObjectBase > RefPtr
Definition GridEvaluator.hpp:59
Helper class for evaluating Fields given in one Grid on another Grid, used by EvalGrid().
Definition GridEvaluator.hpp:25
RefPtr< MemBase > evalDimensionalDestType(const MultiIndex< DestDims > &DestSize, const Field &SourceField) const
Allocate a data field for the destination based on the given dimensions and evaluate the given Field ...
Definition GridEvaluator.hpp:131
RefPtr< MemBase > PointLocation
Will be of type: FixedArray<double, int CoordinateDims>
Definition GridEvaluator.hpp:55
RefPtr< MemBase > FragmentIDs
Fragment ID's per evaluation point.
Definition GridEvaluator.hpp:35
RefPtr< MemBase > SearchStatus
An integer field of search result enums (FragmentSearchResult)
Definition GridEvaluator.hpp:50
FragmentSearchResult
Status of first-pass point search in multiblock source Grids.
Definition GridEvaluator.hpp:42