FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Gradient.hpp
1#ifndef __FIBER_BASEOP_GRADIENT_HPP
2#define __FIBER_BASEOP_GRADIENT_HPP
3
4#include "gridopDllApi.h"
5#include <grid/Representation.hpp>
6#include <field/Derivative.hpp>
7
8namespace Fiber
9{
10
11extern gridop_API RefPtr<MemBase>
12 PartialDerivative(const RefPtr<MemBase>&SourceData);
13
14extern gridop_API RefPtr<CreativeArrayBase>
15 PartialDerivative(const RefPtr<CreativeArrayBase>&CAB,
16 string&FailureDescription,
17 const RefPtr<MemCore::Cache>&Cache = MemCore::Cache::MemCache() );
18
19
25extern gridop_API
26bool isPartialDerivable(const RefPtr<CreativeArrayBase>&CAB);
27
42extern gridop_API RefPtr<Field>
43 PartialDerivative(Field&F, const string&GradientFieldname,
44 Representation&CurrentRepresentation, Representation&FieldIDSource,
45 string&FailureDescription,
46 const RefPtr<MemCore::Cache>&Cache = MemCore::Cache::MemCache() );
47
48
49
50struct gridop_API PartialDerivatorBase : ReferenceBase<PartialDerivatorBase>
51{
53
54 virtual ~PartialDerivatorBase() = 0;
55
56 virtual bool isPartialDerivable(const MemArrayProperties&MAP) const = 0;
57
58 virtual RefPtr<MemBase> doPartialDerivative(const RefPtr<MemBase>&SourceData) const = 0;
59
60};
61
62
63
64template <class SourceArrayType, class DerivationType>
66{
67 typedef typename SourceArrayType::value_type source_value_type;
68 enum { Dims = SourceArrayType::Dims };
69
70
71 RefPtr<MemBase> doPartialDerivative(const RefPtr<MemBase>&SourceData) const override
72 {
75
76 return NullPtr();
77 }
78
79 bool isPartialDerivable(const MemArrayProperties&MAP) const override
80 {
81 if (MAP.myElementType() == typeid(source_value_type) )
82 {
83 if (MAP.rank == Dims)
84 return true;
85 }
86 return false;
87 }
88};
89
90
91
92
93#if 0
94
96
101extern gridop_API RefPtr<Field> ComputeDerivative(Representation&Rep, const string&Fieldname,
103 const MemBase::Creator_t&Crec = NullPtr() );
104
105#endif
106
107
108} // namespace Fiber
109
110#endif // __FIBER_BASEOP_GRADIENT_HPP
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Interface class to provide information about multidimensional arrays without need to create the data ...
Definition MemArrayProperties.hpp:28
A Representation is a set of Field objects, each of them accessed via some FieldID identifier.
Definition Representation.hpp:101
static RefPtr< Cache, CacheBase > & MemCache()
const MultiArray< Dims, ResultType > & ComputeDerivative(MultiArray< Dims, ResultType > &result, const MultiArray< Dims, Value > &ValueField)
Compute the derivative of a multidimensional array.
Definition FiniteDifferences.hpp:340
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
bool isPartialDerivable(const RefPtr< CreativeArrayBase > &CAB)
Check if the partial derivative can be computed from the given data.
Definition fiber/baseop/Gradient.cpp:84
std::nullptr_t NullPtr
static MemCore::RefPtr< MemArray< N, dT > > compute(const MemArray< N, Type > &Values)
Do the actual computation.
Definition Derivative.hpp:26
Definition Gradient.hpp:51
Definition Gradient.hpp:66