00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __GAS_VelocityStretch__
00020 #define __GAS_VelocityStretch__
00021
00022 #include "GAS_API.h"
00023
00024 #include <SIM/SIM_RawField.h>
00025
00026 #include "GAS_SubSolver.h"
00027 #include "GAS_Utils.h"
00028
00029 class GAS_SPH;
00030 class SIM_VectorField;
00031 class SIM_ScalarField;
00032 class SIM_MatrixField;
00033
00034 class GAS_API gas_VelInfo
00035 {
00036 public:
00037 const SIM_VectorField *velocity;
00038 GAS_SPH *sph;
00039 const GU_Detail *gdp;
00040 fpreal timestep;
00041 };
00042
00043 class GAS_API GAS_VelocityStretch : public GAS_SubSolver
00044 {
00045 public:
00046 GET_DATA_FUNC_S(GAS_NAME_VELOCITY, VelocityName);
00047 GET_DATA_FUNC_S("vattrib", VelAttrib);
00048
00049 GET_DATA_FUNC_S(GAS_NAME_FIELD, FieldName);
00050 GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
00051 GET_DATA_FUNC_S("attribs", Attributes);
00052
00053 GET_DATA_FUNC_B("scalexforms", ScaleXforms);
00054 GET_DATA_FUNC_B("rotatexforms", RotateXforms);
00055
00056 GET_DATA_FUNC_B(GAS_NAME_USETIMESTEP, UseTimeStep);
00057 GET_DATA_FUNC_F(GAS_NAME_TIMESCALE, TimeScale);
00058
00059 protected:
00060 explicit GAS_VelocityStretch(const SIM_DataFactory *factory);
00061 virtual ~GAS_VelocityStretch();
00062
00063
00064
00065 virtual bool solveGasSubclass(SIM_Engine &engine,
00066 SIM_Object *obj,
00067 SIM_Time time,
00068 SIM_Time timestep);
00069
00070 void stretchByVelocity(GU_Detail *vorticles,
00071 const gas_VelInfo &info);
00072 void stretchByVelocity(SIM_VectorField *field,
00073 const gas_VelInfo &info);
00074 void stretchByVelocity(SIM_MatrixField *field,
00075 const gas_VelInfo &info);
00076
00077 THREADED_METHOD2(GAS_VelocityStretch, dst->shouldMultiThread(),
00078 stretchScalarField,
00079 SIM_RawField *, dst,
00080 const gas_VelInfo &, velinfo)
00081 void stretchScalarFieldPartial(
00082 SIM_RawField *dst,
00083 const gas_VelInfo &velinfo,
00084 const UT_JobInfo &info);
00085
00086 THREADED_METHOD4(GAS_VelocityStretch, dst->shouldMultiThread(),
00087 stretchVectorField,
00088 SIM_RawField *, dst,
00089 int, axis,
00090 SIM_VectorField *, src,
00091 const gas_VelInfo &, velinfo)
00092 void stretchVectorFieldPartial(
00093 SIM_RawField *dst,
00094 int axis,
00095 const SIM_VectorField *src,
00096 const gas_VelInfo &velinfo,
00097 const UT_JobInfo &info);
00098
00099 THREADED_METHOD5(GAS_VelocityStretch, dst->shouldMultiThread(),
00100 stretchMatrixField,
00101 SIM_RawField *, dst,
00102 int, a1,
00103 int, a2,
00104 SIM_MatrixField *, src,
00105 const gas_VelInfo &, velinfo)
00106 void stretchMatrixFieldPartial(
00107 SIM_RawField *dst,
00108 int a1, int a2,
00109 const SIM_MatrixField *src,
00110 const gas_VelInfo &velinfo,
00111 const UT_JobInfo &info);
00112
00113 private:
00114 static const SIM_DopDescription *getDopDescription();
00115
00116 DECLARE_STANDARD_GETCASTTOTYPE();
00117 DECLARE_DATAFACTORY(GAS_VelocityStretch,
00118 GAS_SubSolver,
00119 "Gas Velocity Stretch",
00120 getDopDescription());
00121 };
00122
00123 #endif
00124