HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_ProjectNonDivergentMultigrid.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_ProjectNonDivergentMultigrid.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_ProjectNonDivergentMultigrid_h__
12 #define __GAS_ProjectNonDivergentMultigrid_h__
13 
14 #include "GAS_SubSolver.h"
15 #include "GAS_Utils.h"
16 
18 {
19 public:
20  /// These macros are used to create the accessors
21  /// getFieldDstName and getFieldSrcName functions we'll use
22  /// to access our data options.
23  GET_DATA_FUNC_S(GAS_NAME_FIELDDEST, FieldDstName);
24  GET_DATA_FUNC_S(GAS_NAME_STENCIL, StencilName);
26  GET_DATA_FUNC_F("reltol", RelTol);
27  GET_DATA_FUNC_F("abstol", AbsTol);
28  GET_DATA_FUNC_I("miniter", MinIter);
29  GET_DATA_FUNC_I("maxiter", MaxIter);
30  GET_DATA_FUNC_B("staggeredcenter", NewCenterSampledDiff);
31  GET_DATA_FUNC_B(SIM_NAME_OPENCL, UseOpenCL);
32  GET_DATA_FUNC_B("internalfacesclosed", InternalFacesClosed);
33 
34 protected:
35  explicit GAS_ProjectNonDivergentMultigrid(const SIM_DataFactory *factory);
37 
38  /// The overloaded callback that GAS_SubSolver will invoke to
39  /// perform our actual computation. We are giving a single object
40  /// at a time to work on.
41  virtual bool solveGasSubclass(SIM_Engine &engine,
42  SIM_Object *obj,
43  SIM_Time time,
44  SIM_Time timestep);
45 
46  /// Performs the projection using OpenCL devices
47  bool projectOpenCL(SIM_Engine &engine,
48  SIM_Object *obj,
49  SIM_Time time,
50  SIM_Time timestep);
51 private:
52  /// This function distributes divergence from the given source field (centre-sampled)
53  /// to the destination (corner-sampled).
55  addCenterDivToCorners,
56  SIM_RawField*, dest,
57  const SIM_RawField*, src,
58  const UT_VoxelArrayF*, stencil,
59  float, mult);
60  void addCenterDivToCornersPartial(SIM_RawField* dest, const SIM_RawField* src,
61  const UT_VoxelArrayF* stencil, float mult,
62  const UT_JobInfo& info) const;
63 
64  /// We define this to be a DOP_Auto node which means we do not
65  /// need to implement a DOP_Node derivative for this data. Instead,
66  /// this description is used to define the interface.
67  static const SIM_DopDescription *getDopDescription();
68 
69  /// These macros are necessary to bind our node to the factory and
70  /// ensure useful constants like BaseClass are defined.
74  "Gas ProjectNonDivergent Multigrid",
75  getDopDescription());
76 };
77 
78 
79 #endif
80 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define THREADED_METHOD4_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4)
GLenum src
Definition: glew.h:2410
GT_API const UT_StringHolder time
#define GAS_API
Definition: GAS_API.h:10
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
GLhandleARB obj
Definition: glew.h:6236
GLint GLfloat GLint stencil
Definition: glew.h:2167
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
#define GET_DATA_FUNC_I(DataName, FuncName)
#define GAS_NAME_FIELDSOURCE
Definition: GAS_Utils.h:29
#define GAS_NAME_FIELDDEST
Definition: GAS_Utils.h:28
#define GET_DATA_FUNC_B(DataName, FuncName)
#define GET_DATA_FUNC_F(DataName, FuncName)
#define SIM_NAME_OPENCL
Definition: SIM_Names.h:222
#define GET_DATA_FUNC_S(DataName, FuncName)
#define GAS_NAME_STENCIL
Definition: GAS_Utils.h:19