FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
EigenValues.hpp
1
2//
3// $Id: EigenValues.hpp,v 1.1 2008/04/16 22:31:22 werner Exp $
4//
6#ifndef __FIBEROPERATIONS_EIGENVALUES_HPP
7#define __FIBEROPERATIONS_EIGENVALUES_HPP
8
9#include <field/MemBase.hpp>
10#include <fiberop/TensorProperties.hpp>
11#include <eagle/EigenVectors.hpp>
12#include <grid/Representation.hpp>
13#include <eagle/PhysicalSpace.hpp>
14#include "fiberopDllApi.h"
15
16
17namespace Fiber
18{
19
22{
23 RefPtr<TypedArray<double> > pMajorEval,
24 pMedianEval,
25 pMinorEval;
26
27 EigenValueArrays(Representation&R, const string&Fieldname, const RefPtr<FragmentID>&f)
28 {
29 pMajorEval = -R( Fieldname + "." FIBER_TENSORFIELDNAME_MAJOREIGENVALUE , f );
30 pMedianEval = -R( Fieldname + "." FIBER_TENSORFIELDNAME_MEDIANEIGENVALUE , f );
31 pMinorEval = -R( Fieldname + "." FIBER_TENSORFIELDNAME_MINOREIGENVALUE , f );
32 }
33
34
38 bool hasData() const;
39};
40
43{
45 TheTensorField,
46
47 MajorEvec,
48 MedianEvec,
49 MinorEvec,
50
51 MajorEval,
52 MedianEval,
53 MinorEval;
54
55 EigenFields(Representation&R, const string&Fieldname)
56 {
57 TheTensorField = R(Fieldname);
58
59 MajorEvec = R( Fieldname + "." FIBER_TENSORFIELDNAME_MAJOREIGENVECTOR );
60 MedianEvec = R( Fieldname + "." FIBER_TENSORFIELDNAME_MEDIANEIGENVECTOR );
61 MinorEvec = R( Fieldname + "." FIBER_TENSORFIELDNAME_MINOREIGENVECTOR );
62
63 MajorEval = R( Fieldname + "." FIBER_TENSORFIELDNAME_MAJOREIGENVALUE );
64 MedianEval = R( Fieldname + "." FIBER_TENSORFIELDNAME_MEDIANEIGENVALUE );
65 MinorEval = R( Fieldname + "." FIBER_TENSORFIELDNAME_MINOREIGENVALUE );
66 }
67
68 MemCore::Ageable YoungestEigenField() const
69 {
72
73 if (MajorEvec ) result.update(*MajorEvec);
74 if (MedianEvec) result.update(*MedianEvec);
75 if (MinorEvec ) result.update(*MinorEvec);
76
77 if (MajorEval ) result.update(*MajorEval);
78 if (MedianEval) result.update(*MedianEval);
79 if (MinorEval ) result.update(*MinorEval);
80
81 return result;
82 }
83
84 bool NeedComputation() const
85 {
86 if (!TheTensorField) return false;
87
88 return TheTensorField->isNewerThan( YoungestEigenField() );
89 }
90};
91
94{
95 typedef Eagle::tvector3 vec3;
96
98 string problem;
99
100 RefPtr<TypedArray<vec3> > pMajorEvec, pMedianEvec, pMinorEvec;
101
105 EigenArrays(Representation&R, const string&Fieldname, const RefPtr<FragmentID>&f);
106
110 EigenArrays(Representation&R, const RefPtr<CreativeArrayBase>&TensorField, const string&Fieldname, const RefPtr<FragmentID>&f,
111 bool TemporaryFields = false, bool Discardable = true);
112
117 void create(const RefPtr<MemBase>&Data);
118
122 void setFields(Representation&R, const string&Fieldname, const RefPtr<FragmentID>&f,
124 bool Discardable = true);
125
126
130 bool HasEigenFields() const;
131
132 operator bool() const
133 {
134 return HasEigenFields();
135 }
136};
137
138
141{
142 const Iterator<double> &MajorEval, &MedianEval, &MinorEval;
143
145 : MajorEval ( *EV.pMajorEval ->creativeIterator() )
146 , MedianEval( *EV.pMedianEval->creativeIterator() )
147 , MinorEval ( *EV.pMinorEval ->creativeIterator() )
148 {}
149};
150
153{
154 typedef Eagle::tvector3 vec3;
155
156 const Iterator<vec3>&MajorEvec, &MedianEvec, &MinorEvec;
157
160 , MajorEvec ( *EA.pMajorEvec ->creativeIterator() )
161 , MedianEvec ( *EA.pMedianEvec->creativeIterator() )
162 , MinorEvec ( *EA.pMinorEvec ->creativeIterator() )
163 {}
164
165 void compute(const Iterator<Eagle::metric33>&M, double precision = 1E-8);
166};
167
168
169
170
171
172
173
174
175
176
177
179{
180 RefPtr<TypedArray<double> > pLinear, pPlanar, pSpherical, pTrace;
181
182 WestinShapeFactors(Representation&R, const string&Fieldname, const RefPtr<FragmentID>&f);
183
185 const string&Fieldname, const RefPtr<FragmentID>&f,
186 bool TemporaryFields = false);
187
188 bool HasShapeFactors() const
189 {
190 if (pLinear && pPlanar && pSpherical && pTrace)
191 return true;
192 else
193 return false;
194 }
195
196 operator bool() const
197 {
198 return HasShapeFactors();
199 }
200
201 bool compute(const EigenValueArrays&EA);
202
203 void setFields(Representation&R, const string&Fieldname, const RefPtr<FragmentID>&f,
205 bool Discardable = true);
206
207};
208
209
210} // namespace Fiber
211
212#endif //__FIBEROPERATIONS_EIGENVALUES_HPP
213
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
A Representation is a set of Field objects, each of them accessed via some FieldID identifier.
Definition Representation.hpp:101
static constexpr const Ageable & InfinitelyOld() noexcept
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
Contains typed arrays to EigenValues and EigenVectors.
Definition EigenValues.hpp:94
string problem
A description of the problem, if there is any.
Definition EigenValues.hpp:98
Definition EigenValues.hpp:43
Contains iterators to eigenvalues and eigenvectors.
Definition EigenValues.hpp:153
Contains typed arrays to EigenValues and EigenVectors.
Definition EigenValues.hpp:22
Contains iterators to eigenvalues.
Definition EigenValues.hpp:141
Definition EigenValues.hpp:179