elbeemRunSimulationCallback runsimCallback;
/* pointer passed to runsimCallback for user data storage */
void* runsimUserData;
+ /* simulation threads used by omp */
+ int threads;
} elbeemSimulationSettings;
#include "particletracer.h"
#include "elbeem.h"
+#if PARALLEL==1
+#include <omp.h>
+#endif
+
#ifdef _WIN32
#else
#include <sys/time.h>
mpLbm->initDomainTrafo( mpElbeemSettings->surfaceTrafo );
mpLbm->setSmoothing(1.0 * mpElbeemSettings->surfaceSmoothing, 1.0 * mpElbeemSettings->surfaceSmoothing);
mpLbm->setIsoSubdivs(mpElbeemSettings->surfaceSubdivs);
+ omp_set_num_threads(mpElbeemSettings->threads);
mpLbm->setSizeX(mpElbeemSettings->resolutionxyz);
mpLbm->setSizeY(mpElbeemSettings->resolutionxyz);
mpLbm->setSizeZ(mpElbeemSettings->resolutionxyz);
# odd formatting here so translation script can extract string
layout.operator("fluid.bake", text=iface_("Bake (Req. Memory: %s)") % fluid.memory_estimate,
translate=False, icon='MOD_FLUIDSIM')
+ layout.prop(fluid, "threads", text="Simulation Threads")
split = layout.split()
col = split.column()
/* ******** export domain to elbeem ******** */
elbeemResetSettings(fsset);
fsset->version = 1;
-
+ fsset->threads = domainSettings->threads;
// setup global settings
copy_v3_v3(fsset->geoStart, domainSettings->bbStart);
copy_v3_v3(fsset->geoSize, domainSettings->bbSize);
typedef struct FluidsimSettings {
struct FluidsimModifierData *fmd; /* for fast RNA access */
+ /* threadcont the calculation is done with */
+ int threads;
+ int pad1;
/* domain, fluid or obstacle */
short type;
/* display advanced options in fluid sim tab (on=1, off=0)*/
int bakeStart, bakeEnd;
/* offset for baked frames */
int frameOffset;
- int pad;
+ int pad2;
/* g star param (LBM compressibility) */
float gstar;
/* activate refinement? */
/* standard settings */
+ prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "threads");
+ RNA_def_property_range(prop, 1, 32);
+ RNA_def_property_ui_text(prop, "Simulation Threads", "Threads used to calculate the simulation");
+
prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolutionxyz");
RNA_def_property_range(prop, 1, 1024);
fss->fmd = fluidmd;
fss->type = OB_FLUIDSIM_ENABLE;
+ fss->threads = 4;
fss->show_advancedoptions = 0;
fss->resolutionxyz = 65;