00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __GAS_Cross__
00020 #define __GAS_Cross__
00021
00022 #include "GAS_API.h"
00023
00024 #include <UT/UT_ThreadedAlgorithm.h>
00025 #include <GU/GU_Detail.h>
00026
00027 #include <SIM/SIM_RawField.h>
00028 #include <SIM/SIM_VectorField.h>
00029 #include <SIM/SIM_PhysicalParms.h>
00030
00031 #include "GAS_SubSolver.h"
00032 #include "GAS_Utils.h"
00033
00034 class SIM_ScalarField;
00035 class SIM_VectorField;
00036 class SIM_MatrixField;
00037
00038 class GAS_API GAS_Cross : public GAS_SubSolver
00039 {
00040 public:
00041
00042 protected:
00043 explicit GAS_Cross(const SIM_DataFactory *factory);
00044 virtual ~GAS_Cross();
00045
00046 bool shouldMultiThread(SIM_RawField *field) const
00047 { return field->field()->numTiles() > 1; }
00048
00049 virtual bool solveGasSubclass(SIM_Engine &engine,
00050 SIM_Object *obj,
00051 SIM_Time time,
00052 SIM_Time timestep);
00053
00054 private:
00055 static const SIM_DopDescription *getDopDescription();
00056
00057
00058
00059
00060
00061
00062 void calculateCross(SIM_VectorField *dst, const SIM_VectorField *a, const SIM_VectorField *b) const;
00063
00064 THREADED_METHOD3_CONST(GAS_Cross, shouldMultiThread(dst->getField(0)),
00065 threadCrossAligned,
00066 SIM_VectorField *, dst,
00067 const SIM_VectorField *, a,
00068 const SIM_VectorField *, b);
00069 void threadCrossAlignedPartial(SIM_VectorField *dst,
00070 const SIM_VectorField *a,
00071 const SIM_VectorField *b,
00072 const UT_JobInfo &info) const;
00073 THREADED_METHOD4_CONST(GAS_Cross, shouldMultiThread(dst),
00074 threadCross,
00075 SIM_RawField *, dst,
00076 int, axis,
00077 const SIM_VectorField *, a,
00078 const SIM_VectorField *, b);
00079 void threadCrossPartial(SIM_RawField *dst,
00080 int axis,
00081 const SIM_VectorField *a,
00082 const SIM_VectorField *b,
00083 const UT_JobInfo &info) const;
00084
00085 DECLARE_STANDARD_GETCASTTOTYPE();
00086 DECLARE_DATAFACTORY(GAS_Cross,
00087 GAS_SubSolver,
00088 "Gas Cross",
00089 getDopDescription());
00090
00091
00092
00093 float myTimeStep;
00094 };
00095
00096 #endif