Files
LaGriT/test/level01/intrp_2D_sizes/input.lgi
2025-12-17 11:00:57 +08:00

129 lines
3.8 KiB
Plaintext
Executable File

* Test interpolate 2D
* examines precision with small numbers
* includes fix to V2 issues with interpolate
* output files written for important cases
*
define / SIZE_SRCX / 21
define / SIZE_SRCY / 101
define / SIZE_SNKX / 20
define / SIZE_SNKY / 100
* Build a source simple 2d triangular mesh
cmo / create / cmosource / / / triplane
createpts/xyz/SIZE_SRCX,SIZE_SRCY,1/0.,0.,0./1.,1.,0./1,1,1
cmo / setatt / cmosource / imt / 1 0 0 / 1
cmo / setatt / cmosource / itp / 1 0 0 / 0
connect
resetpts / itp
* Build a sink simple 2d triangular mesh
cmo / create / cmosink / / / triplane
createpts/xyz/SIZE_SNKX,SIZE_SNKY,1/0.,0.,0./1.,1.,0./1,1,1
cmo / setatt / cmosink / imt / 1 0 0 / 1
cmo / setatt / cmosink / itp / 1 0 0 / 0
connect
resetpts / itp
* Add some floating point attributes for interpolate
cmo/addatt/cmosource/field3/vdouble/scalar/nnodes
cmo/copyatt/cmosource cmosource / field3 xic
cmo/addatt/cmosink/field2/vdouble/scalar/nnodes
cmo/addatt/cmosink/field3/vdouble/scalar/nnodes
cmo/setatt/cmosink/field3 0.0
cmo/setatt/cmosink/field2 0.0
* turn off debug for the test suite
cmo/setatt/cmosink/idebug 0
cmo/setatt/cmosource/idebug 0
* each case decreases the values to test precision
* Case 01
cmo / select / cmosource
scale/ 1 0 0 / relative / xyz / 1.e10 1.e10 1.0
cmo / select / cmosink
scale/ 1 0 0 / relative / xyz / 1.e10 1.e10 1.0
infile diagnostic.mlgi
interpolate/ continuous / cmosink field3 /1,0,0/ &
cmosource field3
cmo printatt cmosource field3 minmax
cmo printatt cmosink field3 minmax
cmo printatt cmosink field3 1,2000,125
* Case 02
cmo / select / cmosource
scale/ 1 0 0 / relative / xyz / 1.e2 1.e2 1.0
cmo / select / cmosink
scale/ 1 0 0 / relative / xyz / 1.e2 1.e2 1.0
infile diagnostic.mlgi
interpolate/ continuous / cmosink field3 /1,0,0/ &
cmosource field3
cmo printatt cmosink field3 1,2000,100
* dump / avs / out_C02_field3.inp / cmosink
* dump / avs / out_C02_field3_src.inp / cmosource
* Case 03
cmo / select / cmosource
scale/ 1 0 0 / relative / xyz / 1.e2 1.e2 1.0
cmo / select / cmosink
scale/ 1 0 0 / relative / xyz / 1.e2 1.e2 1.0
infile diagnostic.mlgi
interpolate/ continuous / cmosink field3 /1,0,0/ &
cmosource field3
cmo printatt cmosink field3 1,2000,125
* Case 04
cmo / select / cmosource
scale/ 1 0 0 / relative / xyz / 1.e2 1.e2 1.0
cmo / select / cmosink
scale/ 1 0 0 / relative / xyz / 1.e2 1.e2 1.0
infile diagnostic.mlgi
interpolate/ continuous / cmosink field3 /1,0,0/ &
cmosource field3
cmo printatt cmosink field3 1,2000,125
* dump / avs / out_C04_field3.inp / cmosink
* dump / avs / out_C04_field3_src.inp / cmosource
cmo printatt cmosource -xyz- minmax
cmo printatt cmosource field3 minmax
cmo printatt cmosink -xyz- minmax
cmo printatt cmosink field3 minmax
cmo printatt cmosink field3 1,2000,125
* Case 05
cmo/set_id/cmosource node / id_node
cmo copyatt cmosource cmosource / imt id_node
cmo/set_id/cmosource element / id_elem
interpolate/map/cmosink field2/1,0,0/ &
cmosource id_elem/ keepatt / nearest imt
* dump / avs / out_C05a_field2.inp / cmosink
* dump / avs / out_C05a_id_elem_src.inp / cmosource
cmo printatt cmosource id_elem minmax
cmo printatt cmosink field2 minmax
cmo printatt cmosink field2 100,2000,100
cmo printatt cmosink pt_gtg 100,2000,100
cmo printatt cmosink el_gtg 100,2000,100
* result should be same using attributes again
* pre V2.2 code has wrong result at point 2000
cmo/setatt/cmosink/idebug 0
cmo/setatt/cmosource/idebug 0
interpolate/map/cmosink field2/1,0,0/ &
cmosource id_elem/ keepatt / nearest imt
cmo printatt cmosource id_elem minmax
cmo printatt cmosink field2 minmax
cmo printatt cmosink field2 100,2000,100
cmo printatt cmosink pt_gtg 100,2000,100
cmo printatt cmosink el_gtg 100,2000,100
* dump / avs / out_C05b_field2.inp / cmosink
* dump / avs / out_C05b_id_elem_src.inp / cmosource
finish