HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GAS_Cross.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GAS_Cross.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_Cross__
12 #define __GAS_Cross__
13 
14 #include "GAS_API.h"
15 
17 #include <GU/GU_Detail.h>
18 
19 #include <SIM/SIM_RawField.h>
20 #include <SIM/SIM_VectorField.h>
21 #include <SIM/SIM_PhysicalParms.h>
22 
23 #include "GAS_SubSolver.h"
24 #include "GAS_Utils.h"
25 
26 class SIM_ScalarField;
27 class SIM_VectorField;
28 class SIM_MatrixField;
29 
31 {
32 public:
33  GET_DATA_FUNC_B(SIM_NAME_OPENCL, UseOpenCL);
34 
35 protected:
36  explicit GAS_Cross(const SIM_DataFactory *factory);
37  virtual ~GAS_Cross();
38 
39  bool shouldMultiThread(SIM_RawField *field) const
40  { return field->field()->numTiles() > 1; }
41 
42  virtual bool solveGasSubclass(SIM_Engine &engine,
43  SIM_Object *obj,
44  SIM_Time time,
45  SIM_Time timestep);
46 
47 private:
48  static const SIM_DopDescription *getDopDescription();
49 
50 
51  // We have helper wrappers around the same->same methods to avoid
52  // read/modify/write problems where the source and destination fields
53  // are the same. This is impossible for the ones that change
54  // dimensions.
55  void calculateCross(SIM_VectorField *dst, const SIM_VectorField *a, const SIM_VectorField *b) const;
56 
57  THREADED_METHOD3_CONST(GAS_Cross, shouldMultiThread(dst->getField(0)),
58  threadCrossAligned,
60  const SIM_VectorField *, a,
61  const SIM_VectorField *, b);
62  void threadCrossAlignedPartial(SIM_VectorField *dst,
63  const SIM_VectorField *a,
64  const SIM_VectorField *b,
65  const UT_JobInfo &info) const;
66  THREADED_METHOD4_CONST(GAS_Cross, shouldMultiThread(dst),
67  threadCross,
68  SIM_RawField *, dst,
69  int, axis,
70  const SIM_VectorField *, a,
71  const SIM_VectorField *, b);
72  void threadCrossPartial(SIM_RawField *dst,
73  int axis,
74  const SIM_VectorField *a,
75  const SIM_VectorField *b,
76  const UT_JobInfo &info) const;
77 
81  "Gas Cross",
82  getDopDescription());
83 
84  void calculateCrossCL(SIM_Object *obj, SIM_VectorField* dst,
86 
87  // Cache our timestep for so we can calculate the timescale
88  // effects.
89  float myTimeStep;
90 };
91 
92 #endif
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define THREADED_METHOD4_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4)
#define GAS_API
Definition: GAS_API.h:10
bool shouldMultiThread(SIM_RawField *field) const
Definition: GAS_Cross.h:39
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
int numTiles() const
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
This class holds a three dimensional tensor field.
GLenum GLenum dst
Definition: glcorearb.h:1792
#define GET_DATA_FUNC_B(DataName, FuncName)
This class holds a three dimensional scalar field.
#define SIM_NAME_OPENCL
Definition: SIM_Names.h:221
#define THREADED_METHOD3_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3)
This class holds a three dimensional vector field.
UT_VoxelArrayF UT_VoxelArrayF & field