00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __GAS_ParticlePressure__
00026 #define __GAS_ParticlePressure__
00027
00028 #include "GAS_API.h"
00029
00030 #include "GAS_SubSolver.h"
00031 #include "GAS_Utils.h"
00032
00033 #include <UT/UT_PtrArray.h>
00034 #include <UT/UT_RefArray.h>
00035 #include <UT/UT_ThreadedAlgorithm.h>
00036
00037 class GEO_Point;
00038 class GU_Detail;
00039 class GAS_SPH;
00040 class UT_FloatArray;
00041
00042 class GAS_API GAS_ParticlePressure : public GAS_SubSolver
00043 {
00044 public:
00045 GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
00046 GET_DATA_FUNC_F("gasconstant", GasConstant);
00047 GET_DATA_FUNC_F("repulsionstrength", RepulsionStrength);
00048 GET_DATA_FUNC_B("dopressure", DoPressure);
00049 GET_DATA_FUNC_B("computev", ComputeVelocity);
00050
00051 bool shouldMultiThread() { return true; }
00052
00053 protected:
00054 explicit GAS_ParticlePressure(const SIM_DataFactory *factory);
00055 virtual ~GAS_ParticlePressure();
00056
00057
00058
00059
00060 virtual bool solveGasSubclass(SIM_Engine &engine,
00061 SIM_Object *obj,
00062 SIM_Time time,
00063 SIM_Time timestep);
00064
00065 protected:
00066 void calculatePressureForce(GU_Detail *gdp,
00067 GAS_SPH *sph, fpreal gasconstant,
00068 fpreal repulsionstrength,
00069 SIM_Time timestep);
00070
00071
00072
00073 THREADED_METHOD5(GAS_ParticlePressure, shouldMultiThread(),
00074 calcPressures,
00075 GU_Detail *, gdp,
00076 UT_FloatArray &, pressures,
00077 UT_FloatArray &, nearpressures,
00078 fpreal, gasconstant,
00079 fpreal, repulsionstrength)
00080 void calcPressuresPartial(GU_Detail *gdp,
00081 UT_FloatArray &pressures,
00082 UT_FloatArray &nearpressures,
00083 fpreal gasconstant,
00084 fpreal repulsionstrength,
00085 const UT_JobInfo &info);
00086
00087 THREADED_METHOD6(GAS_ParticlePressure, shouldMultiThread(),
00088 calcPressureForce,
00089 GU_Detail *, gdp,
00090 const UT_FloatArray &, pressures,
00091 const UT_FloatArray &, nearpressures,
00092 fpreal, gasconstant,
00093 fpreal, repulsionstrength,
00094 SIM_Time, timestep)
00095 void calcPressureForcePartial(GU_Detail *gdp,
00096 const UT_FloatArray &pressures,
00097 const UT_FloatArray &nearpressures,
00098 fpreal gasconstant,
00099 fpreal repulsionstrength,
00100 SIM_Time timestep,
00101 const UT_JobInfo &info);
00102
00103 THREADED_METHOD2(GAS_ParticlePressure, shouldMultiThread(), applyForces,
00104 GU_Detail *, gdp, SIM_Time, timestep)
00105 void applyForcesPartial(GU_Detail *gdp, SIM_Time timestep,
00106 const UT_JobInfo &info);
00107
00108 THREADED_METHOD1(GAS_ParticlePressure, shouldMultiThread(), clearForces,
00109 GU_Detail *, gdp)
00110 void clearForcesPartial(GU_Detail *gdp,
00111 const UT_JobInfo &info);
00112
00113 private:
00114 static const SIM_DopDescription *getDopDescription();
00115
00116
00117 static UT_RefArray<UT_PtrArray<GEO_Point *> > ourPointLists;
00118
00119 DECLARE_STANDARD_GETCASTTOTYPE();
00120 DECLARE_DATAFACTORY(GAS_ParticlePressure,
00121 GAS_SubSolver,
00122 "Gas Particle Pressure",
00123 getDopDescription());
00124 };
00125
00126 #endif