1#ifndef __FIBER_BASEOPERATIONS_GRIDEVALUATOR_IMPL_HPP
2#define __FIBER_BASEOPERATIONS_GRIDEVALUATOR_IMPL_HPP
4#include "GridEvaluator.hpp"
5#include <field/DirectProductArray.hpp>
6#include <field/ArrayRef.hpp>
8#include <grid/types/FEM.hpp>
10#include <vector/Interpolate.hpp>
11#include <vector/LinearIpol.hpp>
13#include "LocalFromWorldPoint.hpp"
15#include <aerie/KDTree.hpp>
17#include <field/FragmentIDContainer.hpp>
39 : myContext(theContext)
44 if (!myLocalFromWorldPoint)
46 myLocalFromWorldPoint =
new LocalFromWorldPoint(myContext.mySlice, myContext.mySourceGrid, myContext.Gridname
48 , myContext.Res_scale, myContext.Prec_scale);
50 return *myLocalFromWorldPoint;
56template <
class Po
intType>
60template <
class FloatIndexType>
100template <
class Po
intType,
class FloatIndexType>
110 puts(
"KDTreeCloudSearch: wrong weight type requested!!\n");
115template <
class Po
intType>
118enum { N = PointType::SIZE };
133 puts(
"GridEvaluator::creating new tree");
145 }
while (
mi.inc(
max) );
152 puts(
"GridEvaluator::found cached tree");
167 if(
verts.size() < 0 )
168 return GridEvaluator::Nope;
191template <
class Po
intType>
194 enum { N = PointType::SIZE };
217 return GridEvaluator::Nope;
232 return GridEvaluator::YesWithLocationAlreadyFound;
241 for(
int i=0; i<N; i++)
244 return GridEvaluator::Nope;
247 return GridEvaluator::YesWithLocationAlreadyFound;
281 puts(
"GridEvaluator: Evaluating set of Vertices not yet fully implemented!!!\n");
288 return GridEvaluator::Nope;
292 Verbose(0) <<
"###### GridEvaluator: Evaluating set of Vertices not yet implemented!!! ####";
293 return GridEvaluator::Nope;
335 puts(
"yayy, curvigrid found!");
336 return GridEvaluator::YesWithLocationAlreadyFound;
339 puts(
"GridEvaluator: NO curvilinear 3D location found!\n");
342 return GridEvaluator::Nope;
349 assert( 0 &&
"GridEvaluator: Provided Coordinate type not supported!!!\n");
350 return GridEvaluator::Nope;
358template <
class PositionsFieldType>
360 const Field&SourcePositions,
363 typedef typename PositionsFieldType::value_type point_t;
419 if (!
DC)
return true;
423 SearchStatus =
GotIt;
429 case YesWithLocationAlreadyFound:
459 FragmentArray[ Index ],
481template <
int SourceDims,
class ValueType>
484 const Field&SourceField)
const
512 case YesWithLocationAlreadyFound:
551 assert( 0 &&
"No point fragment location per point available, not good.");
568template <
class ValueType>
_Expr< _ValFunClos< _ValArray, _Tp >, _Tp > apply(_Tp __func(_Tp)) const
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
RefPtr< MemBase > getData(const RefPtr< FragmentID > &FID=nullptr) const
Get the data of a contigous field.
Definition Field.cpp:665
Definition FragmentIDContainer.hpp:40
Base class for iterators over the fragments of a field.
Definition FragmentID.hpp:249
index_t getIndex(index_t i, int c) const
Given a major and a minor index, compute the overall index in the dataset according to.
Definition HyperslabParameters.hpp:176
index_t count() const
Return the number of steps which can be traversed through this ElementIterator.
Definition HyperslabParameters.hpp:147
Use this class to compute a local cell index and fragment ID (if neccessary) of any coordinate field ...
Definition LocalFromWorldPoint.hpp:71
Definition TypedArray.hpp:544
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
Definition GridEvaluator_impl.hpp:58
Definition FragmentSkeleton.hpp:155
Definition GridEvaluator_impl.hpp:28
RefPtr< FragmentID > FoundFragID
result
Definition GridEvaluator_impl.hpp:36
Definition GridEvaluator_impl.hpp:193
GridEvaluator::FragmentSearchResult Contains(const PointType &P, const MemCore::StrongPtr< Fiber::CreativeArrayBase > &DC, FloatIndex_t &FloatIndex)
Definition GridEvaluator_impl.hpp:204
Definition GridEvaluator.hpp:59
RefPtr< MemBase > PointLocation
Will be of type: FixedArray<double, int CoordinateDims>
Definition GridEvaluator.hpp:55
bool evalFloatIndices(std::vector< ValueType > &ResultData, const CreativeIterator< FixedArray< double, SourceDims > > &InterpolationWeightsPerDestPoint, const Field &SourceField) const
The type must match as stored in the SourceField.
Definition GridEvaluator_impl.hpp:482
RefPtr< MemBase > FragmentIDs
Fragment ID's per evaluation point.
Definition GridEvaluator.hpp:35
void findForSpecificDestinationPositions(const PositionsFieldType &DestinationPositions, const Field &SourcePositions, GridEvaluator::Context &theEvaluationContext)
Given a specific type for the positions in the destination coordinates, find the evaluation weights f...
Definition GridEvaluator_impl.hpp:359
RefPtr< MemBase > SearchStatus
An integer field of search result enums (FragmentSearchResult)
Definition GridEvaluator.hpp:50
bool evalType(std::vector< ValueType > &ResultData, const Field &SourceField) const
Evaluate a source field on a pre-allocated std::vector<> of destination types.
Definition GridEvaluator_impl.hpp:569
FragmentSearchResult
Status of first-pass point search in multiblock source Grids.
Definition GridEvaluator.hpp:42
Definition GridEvaluator_impl.hpp:102
Definition LocalFromWorldPoint.hpp:39
Definition GridEvaluator_impl.hpp:95