Blender  V3.3
Variables
liquid_script.h File Reference
#include <string>

Go to the source code of this file.

Variables

const std::string liquid_variables
 
const std::string liquid_variables_particles
 
const std::string liquid_alloc
 
const std::string liquid_alloc_mesh
 
const std::string liquid_alloc_viscosity
 
const std::string liquid_alloc_curvature
 
const std::string liquid_alloc_particles
 
const std::string liquid_init_phi
 
const std::string liquid_adaptive_step
 
const std::string liquid_step
 
const std::string liquid_step_mesh
 
const std::string liquid_step_particles
 
const std::string liquid_load_data
 
const std::string liquid_load_mesh
 
const std::string liquid_load_particles
 
const std::string liquid_save_data
 
const std::string liquid_save_mesh
 
const std::string liquid_save_particles
 
const std::string liquid_standalone
 

Variable Documentation

◆ liquid_adaptive_step

const std::string liquid_adaptive_step

Definition at line 172 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquid().

◆ liquid_alloc

const std::string liquid_alloc
Initial value:
=
"\n\
mantaMsg('Liquid alloc')\n\
phiParts_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIPARTS$')\n\
phi_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHI$')\n\
phiTmp_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHITMP$')\n\
velOld_s$ID$ = s$ID$.create(MACGrid, name='$NAME_VELOLD$')\n\
velParts_s$ID$ = s$ID$.create(MACGrid, name='$NAME_VELPARTS$')\n\
mapWeights_s$ID$ = s$ID$.create(MACGrid, name='$NAME_MAPWEIGHTS$')\n\
fractions_s$ID$ = None # allocated dynamically\n\
curvature_s$ID$ = None\n\
\n\
pp_s$ID$ = s$ID$.create(BasicParticleSystem, name='$NAME_PARTS$')\n\
pVel_pp$ID$ = pp_s$ID$.create(PdataVec3, name='$NAME_PARTSVELOCITY$')\n\
\n\
pCx_pp$ID$ = None\n\
pCy_pp$ID$ = None\n\
pCz_pp$ID$ = None\n\
if using_apic_s$ID$:\n\
pCx_pp$ID$ = pp_s$ID$.create(PdataVec3)\n\
pCy_pp$ID$ = pp_s$ID$.create(PdataVec3)\n\
pCz_pp$ID$ = pp_s$ID$.create(PdataVec3)\n\
\n\
# Acceleration data for particle nbs\n\
pindex_s$ID$ = s$ID$.create(ParticleIndexSystem, name='$NAME_PINDEX$')\n\
gpi_s$ID$ = s$ID$.create(IntGrid, name='$NAME_GPI$')\n\
\n\
# Keep track of important objects in dict to load them later on\n\
liquid_data_dict_final_s$ID$ = { 'pVel' : pVel_pp$ID$, 'pp' : pp_s$ID$ }\n\
liquid_data_dict_resume_s$ID$ = { 'phiParts' : phiParts_s$ID$, 'phi' : phi_s$ID$, 'phiTmp' : phiTmp_s$ID$ }\n"

Definition at line 66 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquid().

◆ liquid_alloc_curvature

const std::string liquid_alloc_curvature
Initial value:
=
"\n\
mantaMsg('Liquid alloc curvature')\n\
curvature_s$ID$ = s$ID$.create(RealGrid, name='$NAME_CURVATURE$')\n"

Definition at line 131 of file liquid_script.h.

Referenced by MANTA::initCurvature().

◆ liquid_alloc_mesh

const std::string liquid_alloc_mesh
Initial value:
=
"\n\
mantaMsg('Liquid alloc mesh')\n\
phiParts_sm$ID$ = sm$ID$.create(LevelsetGrid, name='$NAME_PHIPARTS_MESH$')\n\
phi_sm$ID$ = sm$ID$.create(LevelsetGrid, name='$NAME_PHI_MESH$')\n\
pp_sm$ID$ = sm$ID$.create(BasicParticleSystem, name='$NAME_PP_MESH$')\n\
flags_sm$ID$ = sm$ID$.create(FlagGrid, name='$NAME_FLAGS_MESH$')\n\
mesh_sm$ID$ = sm$ID$.create(Mesh, name='$NAME_MESH$')\n\
\n\
if using_speedvectors_s$ID$:\n\
mVel_mesh$ID$ = mesh_sm$ID$.create(MdataVec3, name='$NAME_VELOCITYVEC_MESH$')\n\
vel_sm$ID$ = sm$ID$.create(MACGrid, name='$NAME_VELOCITY_MESH$')\n\
\n\
# Acceleration data for particle nbs\n\
pindex_sm$ID$ = sm$ID$.create(ParticleIndexSystem, name='$NAME_PINDEX_MESH$')\n\
gpi_sm$ID$ = sm$ID$.create(IntGrid, name='$NAME_GPI_MESH$')\n\
\n\
# Set some initial values\n\
phiParts_sm$ID$.setConst(9999)\n\
phi_sm$ID$.setConst(9999)\n\
\n\
# Keep track of important objects in dict to load them later on\n\
liquid_mesh_dict_s$ID$ = { 'lMesh' : mesh_sm$ID$ }\n\
\n\
if using_speedvectors_s$ID$:\n\
liquid_meshvel_dict_s$ID$ = { 'lVelMesh' : mVel_mesh$ID$ }\n"

Definition at line 97 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquidMesh().

◆ liquid_alloc_particles

const std::string liquid_alloc_particles
Initial value:
=
"\n\
ppSnd_sp$ID$ = sp$ID$.create(BasicParticleSystem, name='$NAME_PARTS_PARTICLES$')\n\
pVelSnd_pp$ID$ = ppSnd_sp$ID$.create(PdataVec3, name='$NAME_PARTSVEL_PARTICLES$')\n\
pForceSnd_pp$ID$ = ppSnd_sp$ID$.create(PdataVec3, name='$NAME_PARTSFORCE_PARTICLES$')\n\
pLifeSnd_pp$ID$ = ppSnd_sp$ID$.create(PdataReal, name='$NAME_PARTSLIFE_PARTICLES$')\n\
vel_sp$ID$ = sp$ID$.create(MACGrid, name='$NAME_VELOCITY_PARTICLES$')\n\
flags_sp$ID$ = sp$ID$.create(FlagGrid, name='$NAME_FLAGS_PARTICLES$')\n\
phi_sp$ID$ = sp$ID$.create(LevelsetGrid, name='$NAME_PHI_PARTICLES$')\n\
phiObs_sp$ID$ = sp$ID$.create(LevelsetGrid, name='$NAME_PHIOBS_PARTICLES$')\n\
phiOut_sp$ID$ = sp$ID$.create(LevelsetGrid, name='$NAME_PHIOUT_PARTICLES$')\n\
normal_sp$ID$ = sp$ID$.create(VecGrid, name='$NAME_NORMAL_PARTICLES$')\n\
neighborRatio_sp$ID$ = sp$ID$.create(RealGrid, name='$NAME_NEIGHBORRATIO_PARTICLES$')\n\
trappedAir_sp$ID$ = sp$ID$.create(RealGrid, name='$NAME_TRAPPEDAIR_PARTICLES$')\n\
waveCrest_sp$ID$ = sp$ID$.create(RealGrid, name='$NAME_WAVECREST_PARTICLES$')\n\
kineticEnergy_sp$ID$ = sp$ID$.create(RealGrid, name='$NAME_KINETICENERGY_PARTICLES$')\n\
\n\
# Set some initial values\n\
phi_sp$ID$.setConst(9999)\n\
phiObs_sp$ID$.setConst(9999)\n\
phiOut_sp$ID$.setConst(9999)\n\
\n\
# Keep track of important objects in dict to load them later on\n\
liquid_particles_dict_final_s$ID$ = { 'pVelSnd' : pVelSnd_pp$ID$, 'pLifeSnd' : pLifeSnd_pp$ID$, 'ppSnd' : ppSnd_sp$ID$ }\n\
liquid_particles_dict_resume_s$ID$ = { 'trappedAir' : trappedAir_sp$ID$, 'waveCrest' : waveCrest_sp$ID$, 'kineticEnergy' : kineticEnergy_sp$ID$ }\n"

Definition at line 136 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquidSndParts().

◆ liquid_alloc_viscosity

const std::string liquid_alloc_viscosity
Initial value:
=
"\n\
# Viscosity grids\n\
volumes_s$ID$ = sv$ID$.create(RealGrid)\n\
viscosity_s$ID$ = s$ID$.create(RealGrid)\n\
viscosity_s$ID$.setConst(viscosityValue_s$ID$)\n"

Definition at line 124 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquidViscosity().

◆ liquid_init_phi

const std::string liquid_init_phi
Initial value:
=
"\n\
# Prepare domain\n\
phi_s$ID$.initFromFlags(flags_s$ID$)\n\
phiIn_s$ID$.initFromFlags(flags_s$ID$)\n"

Definition at line 162 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquid().

◆ liquid_load_data

const std::string liquid_load_data
Initial value:
=
"\n\
def liquid_load_data_$ID$(path, framenr, file_format, resumable):\n\
mantaMsg('Liquid load data')\n\
dict = { **fluid_data_dict_final_s$ID$, **fluid_data_dict_resume_s$ID$, **liquid_data_dict_final_s$ID$, **liquid_data_dict_resume_s$ID$ } if resumable else { **fluid_data_dict_final_s$ID$, **liquid_data_dict_final_s$ID$ }\n\
fluid_file_import_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_data_s$ID$)\n\
\n\
copyVec3ToReal(source=vel_s$ID$, targetX=x_vel_s$ID$, targetY=y_vel_s$ID$, targetZ=z_vel_s$ID$)\n"

Definition at line 421 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquid().

◆ liquid_load_mesh

const std::string liquid_load_mesh
Initial value:
=
"\n\
def liquid_load_mesh_$ID$(path, framenr, file_format):\n\
mantaMsg('Liquid load mesh')\n\
dict = liquid_mesh_dict_s$ID$\n\
fluid_file_import_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_mesh_s$ID$)\n\
\n\
def liquid_load_meshvel_$ID$(path, framenr, file_format):\n\
mantaMsg('Liquid load meshvel')\n\
dict = liquid_meshvel_dict_s$ID$\n\
fluid_file_import_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_meshvel_s$ID$)\n"

Definition at line 430 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript().

◆ liquid_load_particles

const std::string liquid_load_particles
Initial value:
=
"\n\
def liquid_load_particles_$ID$(path, framenr, file_format, resumable):\n\
mantaMsg('Liquid load particles')\n\
dict = { **liquid_particles_dict_final_s$ID$, **liquid_particles_dict_resume_s$ID$ } if resumable else { **liquid_particles_dict_final_s$ID$ }\n\
fluid_file_import_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_particles_s$ID$)\n"

Definition at line 442 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquidSndParts().

◆ liquid_save_data

const std::string liquid_save_data
Initial value:
=
"\n\
def liquid_save_data_$ID$(path, framenr, file_format, resumable):\n\
mantaMsg('Liquid save data')\n\
dict = { **fluid_data_dict_final_s$ID$, **fluid_data_dict_resume_s$ID$, **liquid_data_dict_final_s$ID$, **liquid_data_dict_resume_s$ID$ } if resumable else { **fluid_data_dict_final_s$ID$, **liquid_data_dict_final_s$ID$ }\n\
if not withMPSave or isWindows:\n\
fluid_file_export_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_data_s$ID$)\n\
else:\n\
fluid_cache_multiprocessing_start_$ID$(function=fluid_file_export_s$ID$, file_name=file_data_s$ID$, framenr=framenr, format_data=file_format, path_data=path, dict=dict, do_join=False)\n"

Definition at line 453 of file liquid_script.h.

Referenced by MANTA::initLiquid().

◆ liquid_save_mesh

const std::string liquid_save_mesh
Initial value:
=
"\n\
def liquid_save_mesh_$ID$(path, framenr, file_format):\n\
mantaMsg('Liquid save mesh')\n\
dict = liquid_mesh_dict_s$ID$\n\
if not withMPSave or isWindows:\n\
fluid_file_export_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_mesh_s$ID$)\n\
else:\n\
fluid_cache_multiprocessing_start_$ID$(function=fluid_file_export_s$ID$, file_name=file_mesh_s$ID$, framenr=framenr, format_data=file_format, path_data=path, dict=dict, do_join=False)\n\
\n\
def liquid_save_meshvel_$ID$(path, framenr, file_format):\n\
mantaMsg('Liquid save mesh vel')\n\
dict = liquid_meshvel_dict_s$ID$\n\
if not withMPSave or isWindows:\n\
fluid_file_export_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format)\n\
else:\n\
fluid_cache_multiprocessing_start_$ID$(function=fluid_file_export_s$ID$, framenr=framenr, format_data=file_format, path_data=path, dict=dict, do_join=False)\n"

Definition at line 463 of file liquid_script.h.

Referenced by MANTA::initLiquidMesh().

◆ liquid_save_particles

const std::string liquid_save_particles
Initial value:
=
"\n\
def liquid_save_particles_$ID$(path, framenr, file_format, resumable):\n\
mantaMsg('Liquid save particles')\n\
dict = { **liquid_particles_dict_final_s$ID$, **liquid_particles_dict_resume_s$ID$ } if resumable else { **liquid_particles_dict_final_s$ID$ }\n\
if not withMPSave or isWindows:\n\
fluid_file_export_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_particles_s$ID$)\n\
else:\n\
fluid_cache_multiprocessing_start_$ID$(function=fluid_file_export_s$ID$, file_name=file_particles_s$ID$, framenr=framenr, format_data=file_format, path_data=path, dict=dict, do_join=False)\n"

Definition at line 481 of file liquid_script.h.

Referenced by MANTA::initLiquidSndParts().

◆ liquid_standalone

const std::string liquid_standalone
Initial value:
=
"\n\
# Helper function to call cache load functions\n\
def load_data(frame, cache_resumable):\n\
liquid_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data, cache_resumable)\n\
if using_sndparts_s$ID$:\n\
liquid_load_particles_$ID$(os.path.join(cache_dir, 'particles'), frame, file_format_data, cache_resumable)\n\
if using_mesh_s$ID$:\n\
liquid_load_mesh_$ID$(os.path.join(cache_dir, 'mesh'), frame, file_format_mesh)\n\
if using_guiding_s$ID$:\n\
fluid_load_guiding_$ID$(os.path.join(cache_dir, 'guiding'), frame, file_format_data)\n\
\n\
# Helper function to call step functions\n\
def step(frame):\n\
liquid_adaptive_step_$ID$(frame)\n\
if using_mesh_s$ID$:\n\
liquid_step_mesh_$ID$()\n\
if using_sndparts_s$ID$:\n\
liquid_step_particles_$ID$()\n"

Definition at line 495 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript().

◆ liquid_step

const std::string liquid_step

Definition at line 240 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquid().

◆ liquid_step_mesh

const std::string liquid_step_mesh

Definition at line 338 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquidMesh().

◆ liquid_step_particles

const std::string liquid_step_particles

Definition at line 379 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), and MANTA::initLiquidSndParts().

◆ liquid_variables

const std::string liquid_variables
Initial value:
=
"\n\
mantaMsg('Liquid variables')\n\
narrowBandWidth_s$ID$ = 3\n\
combineBandWidth_s$ID$ = narrowBandWidth_s$ID$ - 1\n\
adjustedNarrowBandWidth_s$ID$ = $PARTICLE_BAND_WIDTH$ # only used in adjustNumber to control band width\n\
particleNumber_s$ID$ = $PARTICLE_NUMBER$\n\
minParticles_s$ID$ = $PARTICLE_MINIMUM$\n\
maxParticles_s$ID$ = $PARTICLE_MAXIMUM$\n\
radiusFactor_s$ID$ = $PARTICLE_RADIUS$\n\
using_mesh_s$ID$ = $USING_MESH$\n\
using_final_mesh_s$ID$ = $USING_IMPROVED_MESH$\n\
using_fractions_s$ID$ = $USING_FRACTIONS$\n\
using_apic_s$ID$ = $USING_APIC$\n\
using_viscosity_s$ID$ = $USING_VISCOSITY$\n\
fracThreshold_s$ID$ = $FRACTIONS_THRESHOLD$\n\
fracDistance_s$ID$ = $FRACTIONS_DISTANCE$\n\
flipRatio_s$ID$ = $FLIP_RATIO$\n\
concaveUpper_s$ID$ = $MESH_CONCAVE_UPPER$\n\
concaveLower_s$ID$ = $MESH_CONCAVE_LOWER$\n\
meshRadiusFactor_s$ID$ = $MESH_PARTICLE_RADIUS$\n\
smoothenPos_s$ID$ = $MESH_SMOOTHEN_POS$\n\
smoothenNeg_s$ID$ = $MESH_SMOOTHEN_NEG$\n\
randomness_s$ID$ = $PARTICLE_RANDOMNESS$\n\
surfaceTension_s$ID$ = $LIQUID_SURFACE_TENSION$\n\
maxSysParticles_s$ID$ = $PP_PARTICLE_MAXIMUM$\n\
viscosityValue_s$ID$ = $VISCOSITY_VALUE$\n"

Definition at line 14 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), MANTA::initLiquid(), and MANTA::updateVariables().

◆ liquid_variables_particles

const std::string liquid_variables_particles
Initial value:
=
"\n\
tauMin_wc_sp$ID$ = $SNDPARTICLE_TAU_MIN_WC$\n\
tauMax_wc_sp$ID$ = $SNDPARTICLE_TAU_MAX_WC$\n\
tauMin_ta_sp$ID$ = $SNDPARTICLE_TAU_MIN_TA$\n\
tauMax_ta_sp$ID$ = $SNDPARTICLE_TAU_MAX_TA$\n\
tauMin_k_sp$ID$ = $SNDPARTICLE_TAU_MIN_K$\n\
tauMax_k_sp$ID$ = $SNDPARTICLE_TAU_MAX_K$\n\
k_wc_sp$ID$ = $SNDPARTICLE_K_WC$\n\
k_ta_sp$ID$ = $SNDPARTICLE_K_TA$\n\
k_b_sp$ID$ = $SNDPARTICLE_K_B$\n\
k_d_sp$ID$ = $SNDPARTICLE_K_D$\n\
lMin_sp$ID$ = $SNDPARTICLE_L_MIN$\n\
lMax_sp$ID$ = $SNDPARTICLE_L_MAX$\n\
c_s_sp$ID$ = 0.4 # classification constant for snd parts\n\
c_b_sp$ID$ = 0.77 # classification constant for snd parts\n\
pot_radius_sp$ID$ = $SNDPARTICLE_POTENTIAL_RADIUS$\n\
update_radius_sp$ID$ = $SNDPARTICLE_UPDATE_RADIUS$\n\
using_snd_pushout_sp$ID$ = $SNDPARTICLE_BOUNDARY_PUSHOUT$\n"

Definition at line 42 of file liquid_script.h.

Referenced by MANTA::exportLiquidScript(), MANTA::initLiquidSndParts(), and MANTA::updateVariables().