Example showing how create different types of computational domains
1 #include "../src/cpp_macros.h"
4 program computational_domain
11 integer :: grid_size(NDIM)
12 real(dp) :: domain_size(NDIM)
13 logical :: periodic(NDIM)
17 grid_size(1) = 2 * n_cell
18 domain_size = 1.0_dp * grid_size
20 call af_add_cc_variable(tree,
"phi")
21 call af_init(tree, n_cell, domain_size, grid_size, mem_limit_gb=0.1_dp)
22 call af_write_silo(tree,
"output/computational_domain_" // dimname //
"_1")
28 grid_size(2) = 2 * n_cell
30 domain_size = 1.0_dp * grid_size
32 call af_add_cc_variable(tree,
"phi")
33 call af_init(tree, n_cell, domain_size, grid_size, mem_limit_gb=0.1_dp)
34 call af_write_silo(tree,
"output/computational_domain_" // dimname //
"_2")
39 grid_size(1) = 2 * n_cell
41 domain_size = 1.0_dp * grid_size
43 call af_add_cc_variable(tree,
"phi")
44 call af_init(tree, n_cell, domain_size, grid_size, mem_limit_gb=0.1_dp)
45 call af_write_silo(tree,
"output/computational_domain_" // dimname //
"_3")
48 end program computational_domain
Module which contains all Afivo modules, so that a user does not have to include them separately.