00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __GAS_Reduce__
00020 #define __GAS_Reduce__
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_PhysicalParms.h>
00029
00030 #include "GAS_SubSolver.h"
00031 #include "GAS_Utils.h"
00032
00033 class SIM_ScalarField;
00034 class SIM_VectorField;
00035 class SIM_MatrixField;
00036
00037 class GAS_API GAS_Reduce : public GAS_SubSolver
00038 {
00039 public:
00040 GET_DATA_FUNC_S(GAS_NAME_FIELDDEST, FieldDstName);
00041 GET_DATA_FUNC_S(GAS_NAME_FIELDSOURCE, FieldSrcName);
00042
00043 GET_DATA_FUNC_I("reduction", Reduce);
00044 GET_DATA_FUNC_I("scaleby", ScaleBy);
00045 GET_DATA_FUNC_F("percentile", Percentile);
00046 GET_DATA_FUNC_B("maskissdf", MaskIsSDF);
00047
00048
00049 enum REDUCTION_NAMES
00050 {
00051 REDUCE_MAX = 0,
00052 REDUCE_MIN,
00053 REDUCE_AVERAGE,
00054 REDUCE_PERCENTILE,
00055 REDUCE_SUM,
00056 REDUCE_SUMABS,
00057 REDUCE_SUMSQUARE,
00058 REDUCE_RMS,
00059 NUM_REDUCE
00060 };
00061
00062 protected:
00063 explicit GAS_Reduce(const SIM_DataFactory *factory);
00064 virtual ~GAS_Reduce();
00065
00066 virtual bool solveGasSubclass(SIM_Engine &engine,
00067 SIM_Object *obj,
00068 SIM_Time time,
00069 SIM_Time timestep);
00070
00071 void doReduce(SIM_RawField *dest,
00072 const SIM_RawField *src,
00073 const SIM_RawField *maskfield);
00074
00075 private:
00076 static const SIM_DopDescription *getDopDescription();
00077
00078
00079 DECLARE_STANDARD_GETCASTTOTYPE();
00080 DECLARE_DATAFACTORY(GAS_Reduce,
00081 GAS_SubSolver,
00082 "Gas Reduce",
00083 getDopDescription());
00084
00085
00086
00087 float myTimeStep;
00088 };
00089
00090 #endif