Introduction

To test and demonstrate the features of Jet, the SDK comes with a manual test application. The tests are generally more complicated than the unit tests that involves longer run time and collection of API calls. The manual tests are closer to the real-world use cases, so it is useful to take them as SDK examples. The tests normally output data files which can often be rendered into images or even movie clips

To list the entire test cases from Mac OS X or Linux, run

bin/manual_tests --gtest_list_tests

or for Windows, run

bin\Release\manual_tests.exe --gtest_list_tests

Similar to the unit test, run the following command to run entire tests for Mac OS X and Linux:

bin/manual_tests --gtest_filter="<name_of_the_test>"

For Windows, run

bin\Release\manual_tests.exe --gtest_filter="<name_of_the_test>"

You can run the entire tests by not specifying the name of the test. However, it will cost more than an hour of execution time since the manual test includes quite intensive tests such as running multiple fluid simulations. Thus, it is recommended to run specific tests for the fast debugging, and then run the entire tests for final validation. Similar to the unit test, you can also use patterns for specifying the tests such as:

bin/manual_tests --gtest_filter="AnimationTests.*"

Again, replace bin/manual_tests with the bin\Release\manual_tests.exe for Windows.

The test results will be located at manual_tests_output/TestName/CaseName/file. To validate the results, you need Matplotlib. The recommended way of installing the latest version of the library is to use pip such as:

pip install matplotlib

The modern Python versions (2.7.9 and above) comes with pip by default. Once Matplotlib is installed, run the following:

# under build directory
python ../scripts/render_manual_tests_output.py

Once renderered, the rendered image will be stored at the same directory where the test output files are located (manual_tests_output/TestName/CaseName/file). Also, to render the animations as mpeg movie files, ffmpeg is required for Mac OS X and Windows. For Linux, mencoder is needed. For Mac OS X, ffmpeg can be installed via Homebrew. For Windows, the executable can be downloaded from the website. For Ubuntu, you can use apt-get.

For example, after running the following commands:

bin/manual_tests --gtest_filter="AnimationTests.OnUpdateSine"
python ../scripts/render_manual_tests_output.py

you can find

manual_tests_output/Animation/OnUpdateSine/data.#line2.mp4

is generated.

List of the Tests

Below is the list of the tests and their expected results.

  • ApicSolver2Tests.
    • DamBreaking

    DamBreaking

    • DamBreakingWithCollider

    DamBreakingWithCollider

    • Rotation

    Rotation

    • SteadyState

    SteadyState

  • ApicSolver3Tests.
    • DamBreakingWithCollider

    DamBreakingWithCollider

    • WaterDrop

    WaterDrop

  • SemiLagrangian2Tests.
    • Boundary

      Before and after advection:

      Before Advection After Advection

    • Zalesak

      Before and after advection:

      Before Advection After Advection

  • CubicSemiLagrangian2Tests.
    • Zalesak

      Before and after advection:

      Before Advection After Advection

  • AnimationTests.
    • OnUpdateSine

      Data

    • OnUpdateSineWithDecay

      Data

  • ArrayUtilsTests.
    • ExtralateToRegion2
  • ScalarField3Tests.
    • Sample

      Data

    • Gradient

      Data

    • Laplacian

      Data

  • VectorField3Tests.
    • Sample

      Data

    • Divergence

      Data

    • Curl

      Data

    • Sample2

      Testing sample function with different field.

      Data

  • FlipSolver2Tests.
    • Empty

    • SteadyState

      SteadyState

    • DamBreaking

      DamBreaking

    • DamBreakingWithCollider

      DamBreakingWithCollider

    • Rotation

      Rotation

  • FlipSolver3Tests.
    • WaterDrop

      WaterDrop

    • WaterDropWithBlending

      WaterDropWithBlending

    • DamBreakingWithCollider

      DamBreakingWithCollider

    • RotatingTank

      RotatingTank

  • FmmLevelSetSolver2Tests.
    • ReinitializeSmall

      2-D FMM test on low-resolution grid.

      Reinitializing constant field (should result the same constant field), before and after:

      ConstantBefore ConstantAfter

      Reinitializing SDF (should result nearly the same SDF), before and after:

      SDFBefore SDFAfter

      Reinitializing 2x scaled SDF (should result 1x scale SDF), before and after:

      ScaledBefore ScaledAfter

      Reinitializing unit step function (should result 1x scale SDF), before and after:

      UnitStepBefore UnitStepAfter

    • Reinitialize

      2-D FMM test on high-resolution grid.

      Reinitializing constant field (should result the same constant field), before and after:

      ConstantBefore ConstantAfter

      Reinitializing SDF (should result nearly the same SDF), before and after:

      SDFBefore SDFAfter

      Reinitializing 2x scaled SDF (should result 1x scale SDF), before and after:

      ScaledBefore ScaledAfter

      Reinitializing unit step function (should result 1x scale SDF), before and after:

      UnitStepBefore UnitStepAfter

    • Extrapolate

      Input and output field:

      Input Output

      Background signed-distance field:

      SDF

  • FmmLevelSetSolver3Tests.
    • ReinitializeSmall

      Input and output field (cross-sectional view):

      Input Output

    • ExtrapolateSmall

      Input and output field (cross-sectional view):

      Input Output

  • GridBlockedBoundaryConditionSolver2Tests.
    • ConstrainVelocitySmall

      Constrained velocity and boundary marker:

      Data Marker

    • ConstrainVelocity

      Constrained velocity and boundary marker:

      Data Marker

    • ConstrainVelocityWithFriction

      Constrained velocity and boundary marker:

      Data Marker

  • GridFractionalBoundaryConditionSolver2Tests.
    • ConstrainVelocity

      Constrained velocity:

      Data

  • GridForwardEulerDiffusionSolver3Tests.
    • Solve

      Diffusion applied to the entire domain with small diffusion coefficient.

      Input Output

    • Unstable

      Diffusion applied to the entire domain with large diffusion coefficient.

      Input Output

  • GridBackwardEulerDiffusionSolver2Tests.
    • Solve

      Diffusion applied to the half of the domain with very large diffusion coefficient.

      Input and output field:

      Input Output

  • GridBackwardEulerDiffusionSolver3Tests.
    • Solve

      Diffusion applied to the entire domain with small diffusion coefficient.

      Input and output field:

      Input Output

    • Stable

      Diffusion applied to the entire domain with large diffusion coefficient.

      Input and output field:

      Input Output

    • SolveWithBoundaryDirichlet

      Diffusion applied to the half of the domain using Dirichlet boundary condition with very large diffusion coefficient.

      Input and output field:

      Input Output

    • SolveWithBoundaryNeumann

      Diffusion applied to the half of the domain using Neumann boundary condition with very large diffusion coefficient.

      Input and output field:

      Input Output

  • GridFluidSolver2Tests.
    • ApplyBoundaryConditionWithPressure

      When right-facing velocity field is applied, solve the incompressible flow. In this test case, use closed boundary. Zero velocity field expected.

      Velocity (the arrows may be scaled even if their absolute magnitude is very small. See divergence for better analysis):

      Data

      Divergence:

      Div

      Pressure:

      Pressure

    • ApplyBoundaryConditionWithVariationalPressure

      When right-facing velocity field is applied, solve the incompressible flow. In this test case, use closed boundary. To solve boundary condition, the fractional (or often called variational) method is used. Div-free flow around the boundary is expected.

      Velocity (the arrows may be scaled even if their absolute magnitude is very small. See divergence for better analysis):

      Data

      Divergence:

      Div

      Pressure:

      Pressure

    • ApplyBoundaryConditionWithPressureOpen

      When right-facing velocity field is applied, solve the incompressible flow. In this test case, use open (left and right) boundary. Div-free flow around the boundary is expected.

      Velocity (the arrows may be scaled even if their absolute magnitude is very small. See divergence for better analysis):

      Data

      Divergence:

      Div

      Pressure:

      Pressure

  • GridSmokeSolver2Tests.
    • MovingEmitterWithCollider

      Data

    • Rising

      Data

    • RisingWithCollider

      Data

    • RisingWithColliderNonVariational

      Data

    • RisingWithColliderAndDiffusion

      Data

  • GridSmokeSolver3Tests.
    • Rising

      Data

    • RisingWithCollider

      Data

    • RisingWithColliderLinear

      Data

  • HelloFluidSimTests.
    • Run

      Data

  • LevelSetSolver2Tests.
    • Reinitialize

      Input and output level set field when advection and reinitialization combined:

      Input Output

      Background flow field:

      Flow

    • NoReinitialize

      Input and output level set field with advection but without reinitialization:

      Output

  • UpwindLevelSetSolver2Tests.
    • ReinitializeSmall

      2-D iterative upwind-based level set solver test on low-resolution grid.

      Reinitializing constant field (should result the same constant field), before and after:

      ConstantBefore ConstantAfter

      Reinitializing SDF (should result nearly the same SDF), before and after:

      SDFBefore SDFAfter

      Reinitializing 2x scaled SDF (should result 1x scale SDF), before and after:

      ScaledBefore ScaledAfter

      Reinitializing unit step function (should result 1x scale SDF), before and after:

      UnitStepBefore UnitStepAfter

    • Reinitialize

      2-D iterative upwind-based level set solver test on high-resolution grid.

      Reinitializing constant field (should result the same constant field), before and after:

      ConstantBefore ConstantAfter

      Reinitializing SDF (should result nearly the same SDF), before and after:

      SDFBefore SDFAfter

      Reinitializing 2x scaled SDF (should result 1x scale SDF), before and after:

      ScaledBefore ScaledAfter

      Reinitializing unit step function (should result 1x scale SDF), before and after:

      UnitStepBefore UnitStepAfter

    • Extrapolate

      Input and output field:

      Input Output

      Background signed-distance field:

      SDF

  • UpwindLevelSetSolver3Tests.
    • ReinitializeSmall

      Input and output field (cross-sectional view):

      Input Output

    • ExtrapolateSmall

      Input and output field (cross-sectional view):

      Input Output

  • EnoLevelSetSolver2Tests.
    • ReinitializeSmall

      2-D iterative ENO-based level set solver test on low-resolution grid.

      Reinitializing constant field (should result the same constant field), before and after:

      ConstantBefore ConstantAfter

      Reinitializing SDF (should result nearly the same SDF), before and after:

      SDFBefore SDFAfter

      Reinitializing 2x scaled SDF (should result 1x scale SDF), before and after:

      ScaledBefore ScaledAfter

      Reinitializing unit step function (should result 1x scale SDF), before and after:

      UnitStepBefore UnitStepAfter

    • Reinitialize

      2-D iterative ENO-based level set solver test on high-resolution grid.

      Reinitializing constant field (should result the same constant field), before and after:

      ConstantBefore ConstantAfter

      Reinitializing SDF (should result nearly the same SDF), before and after:

      SDFBefore SDFAfter

      Reinitializing 2x scaled SDF (should result 1x scale SDF), before and after:

      ScaledBefore ScaledAfter

      Reinitializing unit step function (should result 1x scale SDF), before and after:

      UnitStepBefore UnitStepAfter

    • Extrapolate

      Input and output field:

      Input Output

      Background signed-distance field:

      SDF

  • EnoLevelSetSolver3Tests.
    • ReinitializeSmall

      Input and output field (cross-sectional view):

      Input Output

    • ExtrapolateSmall

      Input and output field (cross-sectional view):

      Input Output

  • LevelSetLiquidSolver2Tests.
    • Drop

      Data

    • DropStopAndGo

      After 60 frames, serialize the grid system, recreate the solver, and deserialize from the saved buffer to see if the simulator resumes correctly.

      Data

    • DropHighRes

      Data

    • DropWithCollider

      Data

    • DropVariational

      Data

    • DropWithColliderVariational

      Data

    • ViscousDropVariational

      Data

    • DropWithoutGlobalComp

      Data

    • DropWithGlobalComp

      Data

    • RisingFloor

      Data

  • LevelSetLiquidSolver3Tests.
    • SubtleSloshing

      The simulation should correctly generate sloshing animation even with subtle slope of the initial geometry.

      Data

  • MarchingCubesTests.
    • SingleCube

      SingleCube

    • FourCubes

      FourCubes

    • Sphere

      Sphere

  • ParticleSystemSolver2Tests.
    • Update

      Data

  • ParticleSystemSolver3Tests.
    • PerfectBounce

      Data

    • HalfBounce

      Data

    • HalfBounceWithFriction

      Data

    • NoBounce

      Data

    • Update

      Data

  • PciSphSolver2Tests.
    • SteadyState

      Data

    • WaterDrop

      Data

  • PciSphSolver3Tests.
    • SteadyState

      Data

    • WaterDrop

      Data

  • PhysicsAnimationTests.
    • SimpleMassSpringAnimation

      Data

  • PicSolver2Tests.
    • Empty

    • SteadyState

      Data

    • DamBreaking

      Data

    • DamBreakingWithCollider

      Data

    • Rotation

      Rotation

  • PicSolver3Tests.
    • DamBreakingWithCollider

      Data

    • WaterDrop

      Data

  • PointHashGridSearcher2Tests.
    • Build

      Data

  • PointHashGridSearcher3Tests.
    • Build

      Data

  • PointParallelHashGridSearcher2Tests.
    • Build

      Data

  • PointParallelHashGridSearcher3Tests.
    • Build

      Data

  • SphStdKernel3Tests.
    • Operator

      Kernel radius h = 1, 1.2, 1.5

      Kernel1 Kernel2 Kernel3

  • SphSpikyKernel3Tests.
    • Derivatives

      Standard kernel and its 1st and 2nd derivatives:

      Standard 1st derivative 2nd derivative

      Spiky kernel and its 1st and 2nd derivatives:

      Spiky 1st derivative 2nd derivative

  • SphSolver2Tests.
    • SteadyState

      Data

    • WaterDrop

      Data

    • WaterDropLargeDt

      Should give unstable result:

      Data

  • SphSolver3Tests.
    • SteadyState

      Data

    • WaterDrop

      Data

  • SphSystemData2Tests.
    • Interpolate

      Data

    • Gradient

      Data Gradient

    • Laplacian

      Data Laplacian

  • SphSystemData3Tests.
    • Interpolate

      Data

    • Gradient

      Data Gradient

    • Laplacian

      Data Laplacian

  • TriangleMesh3Tests.
    • PointsOnlyGeometries
    • PointsAndNormalGeometries
    • BasicIO
  • TriangleMeshToSdfTests.
    • Cube

      SDF

    • Bunny
    • Dragon
  • VolumeParticleEmitter2Tests.
    • EmitContinuousNonOverlapping

      Data

  • VolumeParticleEmitter3Tests.
    • EmitContinuousNonOverlapping

      Data