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("usefmg", UseFMG);
32  GET_DATA_FUNC_B(SIM_NAME_OPENCL, UseOpenCL);
33  GET_DATA_FUNC_B("internalfacesclosed", InternalFacesClosed);
34 
35 protected:
36  explicit GAS_ProjectNonDivergentMultigrid(const SIM_DataFactory *factory);
38 
39  /// The overloaded callback that GAS_SubSolver will invoke to
40  /// perform our actual computation. We are giving a single object
41  /// at a time to work on.
42  bool solveGasSubclass(SIM_Engine &engine,
43  SIM_Object *obj,
44  SIM_Time time,
45  SIM_Time timestep) override;
46 
47  /// Performs the projection using OpenCL devices
48  bool projectOpenCL(SIM_Engine &engine,
49  SIM_Object *obj,
50  SIM_Time time,
51  SIM_Time timestep);
52 private:
53  /// This function distributes divergence from the given source field (centre-sampled)
54  /// to the destination (corner-sampled).
56  addCenterDivToCorners,
57  SIM_RawField*, dest,
58  const SIM_RawField*, src,
59  const UT_VoxelArrayF*, stencil,
60  float, mult);
61  void addCenterDivToCornersPartial(SIM_RawField* dest, const SIM_RawField* src,
62  const UT_VoxelArrayF* stencil, float mult,
63  const UT_JobInfo& info) const;
64 
65  /// We define this to be a DOP_Auto node which means we do not
66  /// need to implement a DOP_Node derivative for this data. Instead,
67  /// this description is used to define the interface.
68  static const SIM_DopDescription *getDopDescription();
69 
70  /// These macros are necessary to bind our node to the factory and
71  /// ensure useful constants like BaseClass are defined.
75  "Gas ProjectNonDivergent Multigrid",
76  getDopDescription());
77 };
78 
79 
80 #endif
81 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
#define THREADED_METHOD4_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4)
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
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
#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
GLint GLfloat GLint stencil
Definition: glcorearb.h:1278
#define GET_DATA_FUNC_S(DataName, FuncName)
#define GAS_NAME_STENCIL
Definition: GAS_Utils.h:19
GLenum src
Definition: glcorearb.h:1793