RivinHD / Tsunami-Simulation

https://rivinhd.github.io/Tsunami-Simulation/
Other
0 stars 1 forks source link

Fixing the note from submission 3. Bathymetry & Boundary Conditions #38

Closed RivinHD closed 1 year ago

RivinHD commented 1 year ago



        }
    }
    else
    {
        // uses a function pointer to choose between the solvers
        void ( *netUpdates )( t_real, t_real, t_real, t_real, t_real*, t_real* ) = solvers::FWave::netUpdates;

"The return of the reflection is provided by an enumeration where LEFT and RIGHT can be summed to return BOTH. If both cells are dry, the reflection and netUpdates do not need to be computed, i.e. there is no water to simulate with. The implementation is private inside WavePropagation1d as the reflection is only used internally."


l_hNew[l_ceL] -= i_scaling * l_netUpdates[0][0] * ( Reflection::RIGHT != reflection );
l_huNew[l_ceL] -= i_scaling * l_netUpdates[0][1] * ( Reflection::RIGHT != reflection );

l_hNew[l_ceR] -= i_scaling * l_netUpdates[1][0] * ( Reflection::LEFT != reflection );
l_huNew[l_ceR] -= i_scaling * l_netUpdates[1][1] * ( Reflection::LEFT != reflection );






sanitize_test is a Catch v2.13.10 host application.
Run with -? for options

-------------------------------------------------------------------------------
Test the CSV-reader for middle states
-------------------------------------------------------------------------------
/home/tsunami_19/03_bathymetry/gerlach_hofer/src/io/Csv.test.cpp:83
...............................................................................

/home/tsunami_19/03_bathymetry/gerlach_hofer/src/io/Csv.test.cpp:125: FAILED:
  REQUIRE( linesCount == 1000000 )
with expansion:
  9992 (0x2708) == 1000000 (0xf4240)

===============================================================================
test cases:  21 |  20 passed | 1 failed
assertions: 607 | 606 passed | 1 failed
```
***

- [x]  Is there a way to adjust the simulation time?
```
(tsunami_lab) tsunami_19@LeChuck:~/03_bathymetry/gerlach_hofer/build$ ./sanitize 2500 -s fwave -B
#####################################################
###                  Tsunami Lab                  ###
###                                               ###
### https://scalable.uni-jena.de                  ###
### https://rivinhd.github.io/Tsunami-Simulation/ ###
#####################################################
Activated Bathymetry
Set Solver: FWave
runtime configuration
  number of cells in x-direction: 2500
  number of cells in 
```
***

- [x] Use Catch2's approx for comparison to floating point.
*.f implies FP32 which may change when ever using double precision in the solver.
Here one would actually use FP64 for the unit test's reference values in practice.
If we fail to produce them approximately in FP32, something is off anyways..
```

    // in range (8, 12)
    REQUIRE( l_subcriticalFlow.getHeight( 10, 0 ) == 1.8f );

    REQUIRE( l_subcriticalFlow.getMomentumX( 10, 0 ) == 4.42f );

    REQUIRE( l_subcriticalFlow.getMomentumY( 10, 0 ) == 0.0f );
```

***

Overall a high-quality submission and code.
Keep it that way. :-)
RivinHD commented 1 year ago

@Integer-Ctrl Note to task: Something is off with your tests. We should probably write a hint in the submission that middle_states has reduced size because of the size limit. Or provide an extra download link for the tar.xz. This could be done by a release on GitHub.

Integer-Ctrl commented 1 year ago

My suggestion would be to make another file in resourcces "middle_states.test.csv" which is used in the test io::Csv.test.cpp

@RivinHD Did you tar with a Python script or with a terminal?

RivinHD commented 1 year ago

the middle_states.test.csv only uses 10000 lines than? Ok this is a good idea! 👍

I tar with the terminal.

Integer-Ctrl commented 1 year ago

Yes 10000. We will have a look on sunday about the tar topic