00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __GAS_VorticleForces__
00020 #define __GAS_VorticleForces__
00021
00022 #include "GAS_API.h"
00023
00024 #include <SIM/SIM_VectorField.h>
00025
00026 #include "GAS_SubSolver.h"
00027 #include "GAS_Utils.h"
00028
00029 #include <UT/UT_ThreadedAlgorithm.h>
00030
00031 class SIM_ScalarField;
00032
00033 class GAS_API GAS_VorticleForces : public GAS_SubSolver
00034 {
00035 public:
00036 GET_DATA_FUNC_S(GAS_NAME_VELOCITY, VelocityName);
00037 GET_DATA_FUNC_S("particlefield", ParticleField);
00038 GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
00039 GETSET_DATA_FUNCS_F("confinement", ConfinementStrength);
00040 GET_DATA_FUNC_B("computev", ComputeVelocity);
00041
00042 GET_DATA_FUNC_B(GAS_NAME_USETIMESTEP, UseTimeStep);
00043 GET_DATA_FUNC_F(GAS_NAME_TIMESCALE, TimeScale);
00044
00045 bool shouldMultiThread() { return true; }
00046
00047 protected:
00048 explicit GAS_VorticleForces(const SIM_DataFactory *factory);
00049 virtual ~GAS_VorticleForces();
00050
00051
00052
00053 virtual bool solveGasSubclass(SIM_Engine &engine,
00054 SIM_Object *obj,
00055 SIM_Time time,
00056 SIM_Time timestep);
00057
00058 THREADED_METHOD3(GAS_VorticleForces, velocity->getField(0)->shouldMultiThread(),
00059 addVorticleForces,
00060 SIM_VectorField *, velocity,
00061 const GU_Detail *, vorticles,
00062 fpreal, timestep)
00063 void addVorticleForcesPartial(SIM_VectorField *velocity,
00064 const GU_Detail *vorticles,
00065 fpreal timestep,
00066 const UT_JobInfo &info);
00067
00068 THREADED_METHOD4(GAS_VorticleForces, shouldMultiThread(),
00069 calculateVorticleForces,
00070 const GU_Detail *, vorticles,
00071 GU_Detail *, gdp, fpreal, timestep,
00072 fpreal, confinement)
00073 void calculateVorticleForcesPartial(
00074 const GU_Detail *vorticles, GU_Detail *gdp,
00075 fpreal timestep, fpreal confinement,
00076 const UT_JobInfo &info);
00077
00078 THREADED_METHOD2(GAS_VorticleForces, shouldMultiThread(), applyForces,
00079 GU_Detail *, gdp, SIM_Time, timestep)
00080 void applyForcesPartial(GU_Detail *gdp, SIM_Time timestep,
00081 const UT_JobInfo &info);
00082
00083 THREADED_METHOD1(GAS_VorticleForces, shouldMultiThread(), clearForces,
00084 GU_Detail *, gdp)
00085 void clearForcesPartial(GU_Detail *gdp,
00086 const UT_JobInfo &info);
00087
00088 private:
00089 static const SIM_DopDescription *getDopDescription();
00090
00091 DECLARE_STANDARD_GETCASTTOTYPE();
00092 DECLARE_DATAFACTORY(GAS_VorticleForces,
00093 GAS_SubSolver,
00094 "Gas Vorticle Forces",
00095 getDopDescription());
00096 };
00097
00098 #endif
00099