Lines Matching refs:app_ctx
17 PetscErrorCode RegisterProblems_NS(AppCtx app_ctx) { in RegisterProblems_NS() argument
18 app_ctx->problems = NULL; in RegisterProblems_NS()
21 PetscCall(PetscFunctionListAdd(&app_ctx->problems, "density_current", NS_DENSITY_CURRENT)); in RegisterProblems_NS()
22 PetscCall(PetscFunctionListAdd(&app_ctx->problems, "euler_vortex", NS_EULER_VORTEX)); in RegisterProblems_NS()
23 PetscCall(PetscFunctionListAdd(&app_ctx->problems, "shocktube", NS_SHOCKTUBE)); in RegisterProblems_NS()
24 PetscCall(PetscFunctionListAdd(&app_ctx->problems, "advection", NS_ADVECTION)); in RegisterProblems_NS()
25 PetscCall(PetscFunctionListAdd(&app_ctx->problems, "blasius", NS_BLASIUS)); in RegisterProblems_NS()
26 PetscCall(PetscFunctionListAdd(&app_ctx->problems, "channel", NS_CHANNEL)); in RegisterProblems_NS()
27 PetscCall(PetscFunctionListAdd(&app_ctx->problems, "gaussian_wave", NS_GAUSSIAN_WAVE)); in RegisterProblems_NS()
28 PetscCall(PetscFunctionListAdd(&app_ctx->problems, "newtonian", NS_NEWTONIAN_IG)); in RegisterProblems_NS()
29 PetscCall(PetscFunctionListAdd(&app_ctx->problems, "taylor_green", NS_TAYLOR_GREEN)); in RegisterProblems_NS()
34 PetscErrorCode ProcessCommandLineOptions(MPI_Comm comm, AppCtx app_ctx, SimpleBC bc) { in ProcessCommandLineOptions() argument
52 …PetscOptionsString("-ceed", "CEED resource specifier", NULL, app_ctx->ceed_resource, app_ctx->ceed… in ProcessCommandLineOptions()
53 sizeof(app_ctx->ceed_resource), &ceed_flag)); in ProcessCommandLineOptions()
55 app_ctx->test_type = TESTTYPE_NONE; in ProcessCommandLineOptions()
56 …", "Type of test to run", NULL, TestTypes, (PetscEnum)(app_ctx->test_type), (PetscEnum *)&app_ctx-… in ProcessCommandLineOptions()
59 app_ctx->test_tol = 1E-11; in ProcessCommandLineOptions()
60 …("-compare_final_state_atol", "Test absolute tolerance", NULL, app_ctx->test_tol, &app_ctx->test_t… in ProcessCommandLineOptions()
62 …ing("-compare_final_state_filename", "Test filename", NULL, app_ctx->test_file_path, app_ctx->test… in ProcessCommandLineOptions()
63 sizeof(app_ctx->test_file_path), NULL)); in ProcessCommandLineOptions()
65 …cOptionsFList("-problem", "Problem to solve", NULL, app_ctx->problems, app_ctx->problem_name, app_… in ProcessCommandLineOptions()
66 sizeof(app_ctx->problem_name), &problem_flag)); in ProcessCommandLineOptions()
68 app_ctx->viz_refine = 0; in ProcessCommandLineOptions()
69 …refine", "Regular refinement levels for visualization", NULL, app_ctx->viz_refine, &app_ctx->viz_r… in ProcessCommandLineOptions()
71 app_ctx->checkpoint_interval = 10; in ProcessCommandLineOptions()
72 app_ctx->checkpoint_vtk = PETSC_FALSE; in ProcessCommandLineOptions()
74 …ionsInt("-output_freq", "Frequency of output, in number of steps", NULL, app_ctx->checkpoint_inter… in ProcessCommandLineOptions()
75 &app_ctx->checkpoint_interval, &option_set)); in ProcessCommandLineOptions()
76 if (option_set) app_ctx->checkpoint_vtk = PETSC_TRUE; in ProcessCommandLineOptions()
77 …"-checkpoint_interval", "Frequency of output, in number of steps", NULL, app_ctx->checkpoint_inter… in ProcessCommandLineOptions()
78 &app_ctx->checkpoint_interval, NULL)); in ProcessCommandLineOptions()
79 …kpoint_vtk", "Include VTK (*.vtu) output at each binary checkpoint", NULL, app_ctx->checkpoint_vtk, in ProcessCommandLineOptions()
80 &app_ctx->checkpoint_vtk, NULL)); in ProcessCommandLineOptions()
82 …"-output_add_stepnum2bin", "Add step number to the binary outputs", NULL, app_ctx->add_stepnum2bin, in ProcessCommandLineOptions()
83 &app_ctx->add_stepnum2bin, NULL)); in ProcessCommandLineOptions()
85 PetscCall(PetscStrncpy(app_ctx->output_dir, ".", 2)); in ProcessCommandLineOptions()
86 …String("-output_dir", "Output directory", NULL, app_ctx->output_dir, app_ctx->output_dir, sizeof(a… in ProcessCommandLineOptions()
88 app_ctx->cont_steps = 0; in ProcessCommandLineOptions()
89 …ionsInt("-continue", "Continue from previous solution", NULL, app_ctx->cont_steps, &app_ctx->cont_… in ProcessCommandLineOptions()
91 PetscCall(PetscStrcpy(app_ctx->cont_file, "[output_dir]/ns-solution.bin")); in ProcessCommandLineOptions()
92 …nue_filename", "Filename to get initial condition from", NULL, app_ctx->cont_file, app_ctx->cont_f… in ProcessCommandLineOptions()
93 sizeof(app_ctx->cont_file), &option_set)); in ProcessCommandLineOptions()
94 …(!option_set) PetscCall(PetscSNPrintf(app_ctx->cont_file, sizeof app_ctx->cont_file, "%s/ns-soluti… in ProcessCommandLineOptions()
95 if (option_set && app_ctx->cont_steps == 0) app_ctx->cont_steps = -1; // Read time from file in ProcessCommandLineOptions()
97 PetscCall(PetscStrcpy(app_ctx->cont_time_file, "[output_dir]/ns-time.bin")); in ProcessCommandLineOptions()
98 …tinue_time_filename", "Filename to get initial condition time from", NULL, app_ctx->cont_time_file, in ProcessCommandLineOptions()
99 … app_ctx->cont_time_file, sizeof(app_ctx->cont_time_file), &option_set)); in ProcessCommandLineOptions()
100 …ption_set) PetscCall(PetscSNPrintf(app_ctx->cont_time_file, sizeof app_ctx->cont_time_file, "%s/ns… in ProcessCommandLineOptions()
102 app_ctx->degree = 1; in ProcessCommandLineOptions()
103 …onsInt("-degree", "Polynomial degree of finite elements", NULL, app_ctx->degree, &app_ctx->degree,… in ProcessCommandLineOptions()
105 app_ctx->q_extra = 0; in ProcessCommandLineOptions()
106 …ionsInt("-q_extra", "Number of extra quadrature points", NULL, app_ctx->q_extra, &app_ctx->q_extra… in ProcessCommandLineOptions()
113 if (option_set) PetscCall(PetscStrallocpy(amat_type, (char **)&app_ctx->amat_type)); in ProcessCommandLineOptions()
124 strncpy(app_ctx->ceed_resource, ceed_resource, 10); in ProcessCommandLineOptions()
129 …if (strncmp(app_ctx->ceed_resource, "/gpu", 4) == 0) PetscCall(PetscDeviceInitialize(PETSC_DEVICE_… in ProcessCommandLineOptions()
134 strncpy(app_ctx->problem_name, problem_name, 16); in ProcessCommandLineOptions()
138 app_ctx->turb_spanstats_collect_interval = 1; in ProcessCommandLineOptions()
140 … app_ctx->turb_spanstats_collect_interval, &app_ctx->turb_spanstats_collect_interval, NULL)); in ProcessCommandLineOptions()
142 app_ctx->turb_spanstats_viewer_interval = -1; in ProcessCommandLineOptions()
144 … app_ctx->turb_spanstats_viewer_interval, &app_ctx->turb_spanstats_viewer_interval, NULL)); in ProcessCommandLineOptions()
146 …onitor_turbulence_spanstats_viewer", "Viewer for the statistics", NULL, &app_ctx->turb_spanstats_v… in ProcessCommandLineOptions()
147 … &app_ctx->turb_spanstats_viewer_format, &app_ctx->turb_spanstats_enable)); in ProcessCommandLineOptions()
149 …s_monitor_wall_force", "Viewer for force on each (no-slip) wall", NULL, &app_ctx->wall_forces.view… in ProcessCommandLineOptions()
150 &app_ctx->wall_forces.viewer_format, NULL)); in ProcessCommandLineOptions()
152 …"-diff_filter_monitor", "Enable differential filtering TSMonitor", NULL, app_ctx->diff_filter_moni… in ProcessCommandLineOptions()
153 &app_ctx->diff_filter_monitor, NULL)); in ProcessCommandLineOptions()
156 app_ctx->mesh_transform_type = MESH_TRANSFORM_NONE; in ProcessCommandLineOptions()
157 …form", "Mesh transform to perform", NULL, MeshTransformTypes, (PetscEnum)app_ctx->mesh_transform_t… in ProcessCommandLineOptions()
158 (PetscEnum *)&app_ctx->mesh_transform_type, NULL)); in ProcessCommandLineOptions()