YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
test_raw_exchange Namespace Reference

Variables

 yac = YAC()
 
 comp1
 
 comp2
 
 grid1 = Reg2dGrid("grid1", [-1, 0, 1], [-1, 0, 1])
 
 points1 = grid1.def_points(Location.CELL, [-0.5, 0.5], [-0.5, 0.5])
 
 grid2 = Reg2dGrid("grid2", [-1, -1/3, 1/3, 1], [-1, -1/3, 1/3, 1])
 
 points2 = grid2.def_points(Location.CELL, [-2/3, 0.0, 2/3], [-2/3, 0.0, 2/3])
 
 field1 = Field.create("field1", comp1, points1, 1, "1", TimeUnit.HOUR)
 
 field2 = Field.create("field2", comp2, points2, 1, "1", TimeUnit.HOUR)
 
 field3 = Field.create("field3", comp2, points2, 1, "1", TimeUnit.HOUR)
 
 field4 = Field.create("field4", comp2, points2, 1, "1", TimeUnit.HOUR)
 
 interp = InterpolationStack()
 
dict couple_kwargs
 
 tgt_field
 
 use_raw_exchange
 
 raw_data = field2.get_raw_interp_weights_data()
 
 indptr = np.insert(np.cumsum(raw_data.num_src_per_tgt), 0, 0)
 
 raw_data_csr = field4.get_raw_interp_weights_data_csr()
 
 W = csr_matrix((raw_data_csr.weights, raw_data_csr.src_idx, raw_data_csr.src_indptr))
 
 buf = np.empty(shape=(1, raw_data.src_field_buffer_sizes[0]), dtype=np.float64)
 
int i = 0.
 
 f2_buf = np.empty(shape=(1, field2.size), dtype=np.float64)
 
 f3_buf
 
 info
 
 f4_buf = W@buf[0, :]
 

Variable Documentation

◆ buf

test_raw_exchange.buf = np.empty(shape=(1, raw_data.src_field_buffer_sizes[0]), dtype=np.float64)

Definition at line 87 of file test_raw_exchange.py.

◆ comp1

test_raw_exchange.comp1

Definition at line 34 of file test_raw_exchange.py.

◆ comp2

test_raw_exchange.comp2

Definition at line 34 of file test_raw_exchange.py.

◆ couple_kwargs

dict test_raw_exchange.couple_kwargs
Initial value:
1= {"src_comp": "comp1",
2 "src_grid": "grid1",
3 "src_field": "field1",
4 "tgt_comp": "comp2",
5 "tgt_grid": "grid2",
6 "coupling_timestep": "60",
7 "timeunit": TimeUnit.MINUTE,
8 "time_reduction": Reduction.TIME_NONE,
9 "interp_stack": interp}

Definition at line 52 of file test_raw_exchange.py.

◆ f2_buf

test_raw_exchange.f2_buf = np.empty(shape=(1, field2.size), dtype=np.float64)

Definition at line 95 of file test_raw_exchange.py.

◆ f3_buf

test_raw_exchange.f3_buf

Definition at line 100 of file test_raw_exchange.py.

◆ f4_buf

test_raw_exchange.f4_buf = W@buf[0, :]

Definition at line 104 of file test_raw_exchange.py.

◆ field1

test_raw_exchange.field1 = Field.create("field1", comp1, points1, 1, "1", TimeUnit.HOUR)

Definition at line 43 of file test_raw_exchange.py.

◆ field2

test_raw_exchange.field2 = Field.create("field2", comp2, points2, 1, "1", TimeUnit.HOUR)

Definition at line 44 of file test_raw_exchange.py.

◆ field3

test_raw_exchange.field3 = Field.create("field3", comp2, points2, 1, "1", TimeUnit.HOUR)

Definition at line 45 of file test_raw_exchange.py.

◆ field4

test_raw_exchange.field4 = Field.create("field4", comp2, points2, 1, "1", TimeUnit.HOUR)

Definition at line 46 of file test_raw_exchange.py.

◆ grid1

test_raw_exchange.grid1 = Reg2dGrid("grid1", [-1, 0, 1], [-1, 0, 1])

Definition at line 36 of file test_raw_exchange.py.

◆ grid2

test_raw_exchange.grid2 = Reg2dGrid("grid2", [-1, -1/3, 1/3, 1], [-1, -1/3, 1/3, 1])

Definition at line 40 of file test_raw_exchange.py.

◆ i

int test_raw_exchange.i = 0.

Definition at line 89 of file test_raw_exchange.py.

◆ indptr

test_raw_exchange.indptr = np.insert(np.cumsum(raw_data.num_src_per_tgt), 0, 0)

Definition at line 82 of file test_raw_exchange.py.

◆ info

test_raw_exchange.info

Definition at line 100 of file test_raw_exchange.py.

◆ interp

test_raw_exchange.interp = InterpolationStack()

Definition at line 48 of file test_raw_exchange.py.

◆ points1

test_raw_exchange.points1 = grid1.def_points(Location.CELL, [-0.5, 0.5], [-0.5, 0.5])

Definition at line 38 of file test_raw_exchange.py.

◆ points2

test_raw_exchange.points2 = grid2.def_points(Location.CELL, [-2/3, 0.0, 2/3], [-2/3, 0.0, 2/3])

Definition at line 41 of file test_raw_exchange.py.

◆ raw_data

test_raw_exchange.raw_data = field2.get_raw_interp_weights_data()

Definition at line 81 of file test_raw_exchange.py.

◆ raw_data_csr

test_raw_exchange.raw_data_csr = field4.get_raw_interp_weights_data_csr()

Definition at line 84 of file test_raw_exchange.py.

◆ tgt_field

test_raw_exchange.tgt_field

Definition at line 64 of file test_raw_exchange.py.

◆ use_raw_exchange

test_raw_exchange.use_raw_exchange

Definition at line 65 of file test_raw_exchange.py.

◆ W

test_raw_exchange.W = csr_matrix((raw_data_csr.weights, raw_data_csr.src_idx, raw_data_csr.src_indptr))

Definition at line 85 of file test_raw_exchange.py.

◆ yac

test_raw_exchange.yac = YAC()

Definition at line 30 of file test_raw_exchange.py.