Flip fluid的_stepFluid()

时间步长

void FluidSimulation::_stepFluid(double dt) {
    if (!_isSkippedFrame) {
    	//生成更新障碍对象线程 
    	//04-Sep-2020 14h58m32s BEGIN       Update Obstacle Objects
        //04-Sep-2020 14h58m33s COMPLETE    Update Obstacle Objects
        _launchUpdateObstacleObjectsThread(dt);
        
        //加载更新障碍对象线程
        _joinUpdateObstacleObjectsThread();
        
        //启动更新液位设置线程
        //04-Sep-2020 14h58m33s BEGIN       Update Liquid Level Set
		//04-Sep-2020 14h58m33s COMPLETE    Update Liquid Level Set
        _launchUpdateLiquidLevelSetThread();


        _joinUpdateLiquidLevelSetThread();
		//启动平流速度场线程,_advectVelocityFieldThread = std::thread(&FluidSimulation::_advectVelocityField, this);
		//04-Sep-2020 14h58m33s BEGIN       Advect Velocity Field
		//04-Sep-2020 14h58m33s COMPLETE    Advect Velocity Field
        _launchAdvectVelocityFieldThread();
        
        _joinAdvectVelocityFieldThread();

		//启动计算流体曲率网格线程
		//
        _launchCalculateFluidCurvatureGridThread();

		//保存速度场
		//04-Sep-2020 14h58m33s BEGIN       Save Velocity Field
		//04-Sep-2020 14h58m33s COMPLETE    Save Velocity Field
        _saveVelocityField();
        
        //对速度场施加物体力
        //04-Sep-2020 14h58m33s BEGIN       Apply Force Fields
		//04-Sep-2020 14h58m33s COMPLETE    Apply Force Fields
        _applyBodyForcesToVelocityField(dt);

		//粘度解算器
		//将粘度应用于速度场
		//
        _applyViscosityToVelocityField(dt);
        
        if (_isSurfaceTensionEnabled) {
            _joinCalculateFluidCurvatureGridThread();
        }
        
		//压力解算器
		//04-Sep-2020 14h58m47s BEGIN       Solve Pressure System
		//04-Sep-2020 14h58m47s COMPLETE    Solve Pressure System
        _pressureSolve(dt);
        
		//限制速度场
		//04-Sep-2020 14h58m33s BEGIN       Constrain Velocity Field
		//04-Sep-2020 14h58m33s COMPLETE    Constrain Velocity Field
        _constrainVelocityFields();

        if (_isDiffuseMaterialOutputEnabled) {
            _joinCalculateFluidCurvatureGridThread();
        }

        _updateDiffuseMaterial(dt);

        if (_isSheetSeedingEnabled) {
            _joinCalculateFluidCurvatureGridThread();
        }

        _updateSheetSeeding();

		//更新粒子速度
        //04-Sep-2020 14h58m33s BEGIN       Update Marker Particle Velocities
		//04-Sep-2020 14h58m33s COMPLETE    Update Marker Particle Velocities
        _updateMarkerParticleVelocities();

		//删除保存的速度场
		//04-Sep-2020 14h58m33s BEGIN       Delete Saved Velocity Field
		//04-Sep-2020 14h58m33s COMPLETE    Delete Saved Velocity Field
        _deleteSavedVelocityField();
		
		//提前标记粒子
		//04-Sep-2020 14h58m33s BEGIN       Advect Marker Particles
		//04-Sep-2020 14h58m33s COMPLETE    Advect Marker Particles
        _advanceMarkerParticles(dt);

		//更新流体对象
		//04-Sep-2020 14h58m33s BEGIN       Update Fluid Objects
		//04-Sep-2020 14h58m34s COMPLETE    Update Fluid Objects
        _updateFluidObjects();

		//输出仿真数据
		//04-Sep-2020 14h58m34s BEGIN       Generate Output Data
		//04-Sep-2020 14h58m34s COMPLETE    Generate Output Data
        _outputSimulationData();
        //04-Sep-2020 14h58m34s BEGIN       Generate Surface Mesh
		//04-Sep-2020 14h58m34s COMPLETE    Generate Surface Mesh
    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值