Home
last modified time | relevance | path

Searched refs:app_ctx (Results 1 – 25 of 32) sorted by relevance

12

/libCEED/examples/solids/src/
H A Dcl-options.c20 PetscErrorCode ProcessCommandLineOptions(MPI_Comm comm, AppCtx app_ctx) { in ProcessCommandLineOptions() argument
27 …PetscOptionsString("-ceed", "CEED resource specifier", NULL, app_ctx->ceed_resource, app_ctx->ceed… in ProcessCommandLineOptions()
28 sizeof(app_ctx->ceed_resource), &ceed_flag)); in ProcessCommandLineOptions()
30 PetscCall(PetscStrncpy(app_ctx->output_dir, ".", 2)); // Default - current directory in ProcessCommandLineOptions()
31 …String("-output_dir", "Output directory", NULL, app_ctx->output_dir, app_ctx->output_dir, sizeof(a… in ProcessCommandLineOptions()
33 app_ctx->degree = 3; in ProcessCommandLineOptions()
34 …t("-degree", "Polynomial degree of tensor product basis", NULL, app_ctx->degree, &app_ctx->degree,… in ProcessCommandLineOptions()
36 app_ctx->q_extra = 0; in ProcessCommandLineOptions()
37 …ionsInt("-q_extra", "Number of extra quadrature points", NULL, app_ctx->q_extra, &app_ctx->q_extra… in ProcessCommandLineOptions()
39 …ionsString("-mesh", "Read mesh from file", NULL, app_ctx->mesh_file, app_ctx->mesh_file, sizeof(ap… in ProcessCommandLineOptions()
[all …]
H A Dsetup-dm.c34 PetscErrorCode CreateDistributedDM(MPI_Comm comm, AppCtx app_ctx, DM *dm) { in CreateDistributedDM() argument
35 const char *filename = app_ctx->mesh_file; in CreateDistributedDM()
65 PetscErrorCode SetupDMByDegree(DM dm, AppCtx app_ctx, PetscInt order, PetscBool boundary, PetscInt … in SetupDMByDegree() argument
95 if (app_ctx->forcing_choice == FORCE_MMS) { in SetupDMByDegree()
96 if (app_ctx->test_mode) { in SetupDMByDegree()
123 for (PetscInt i = 0; i < app_ctx->bc_clamp_count; i++) { in SetupDMByDegree()
125 snprintf(bcName, sizeof bcName, "clamp_%" PetscInt_FMT, app_ctx->bc_clamp_faces[i]); in SetupDMByDegree()
126 …PetscCall(DMAddBoundary(dm, DM_BC_ESSENTIAL, bcName, label, 1, &app_ctx->bc_clamp_faces[i], 0, 0, … in SetupDMByDegree()
127 (void *)&app_ctx->bc_clamp_max[i], NULL)); in SetupDMByDegree()
H A Dmisc.c23 PetscErrorCode SetupJacobianCtx(MPI_Comm comm, AppCtx app_ctx, DM dm, Vec V, Vec V_loc, CeedData ce… in SetupJacobianCtx() argument
51 PetscErrorCode SetupProlongRestrictCtx(MPI_Comm comm, AppCtx app_ctx, DM dm_c, DM dm_f, Vec V_f, Ve… in SetupProlongRestrictCtx() argument
112 PetscErrorCode ViewSolution(MPI_Comm comm, AppCtx app_ctx, Vec U, PetscInt increment, PetscScalar l… in ViewSolution() argument
123 PetscCall(PetscMkdir(app_ctx->output_dir)); in ViewSolution()
127 …filename, sizeof output_filename, "%s/solution-%03" PetscInt_FMT ".vtu", app_ctx->output_dir, incr… in ViewSolution()
144 PetscErrorCode ViewDiagnosticQuantities(MPI_Comm comm, DM dmU, UserMult user, AppCtx app_ctx, Vec U… in ViewDiagnosticQuantities() argument
215 …ntf(output_filename, sizeof output_filename, "%s/diagnostic_quantities.vtu", app_ctx->output_dir)); in ViewDiagnosticQuantities()
237 PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy) { in RegressionTests_solids() argument
240 if (app_ctx->expect_final_strain >= 0.) { in RegressionTests_solids()
241 PetscReal energy_ref = app_ctx->expect_final_strain; in RegressionTests_solids()
[all …]
H A Dsetup-libceed.c125 …ibceedFineLevel(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionCon… in SetupLibceedFineLevel() argument
128 CeedInt P = app_ctx->level_degrees[fine_level] + 1; in SetupLibceedFineLevel()
129 CeedInt Q = app_ctx->level_degrees[fine_level] + 1 + app_ctx->q_extra; in SetupLibceedFineLevel()
133 forcingType forcing_choice = app_ctx->forcing_choice; in SetupLibceedFineLevel()
292 if (app_ctx->bc_traction_count > 0) { in SetupLibceedFineLevel()
314 for (CeedInt i = 0; i < app_ctx->bc_traction_count; i++) { in SetupLibceedFineLevel()
317 …a(traction_ctx, CEED_MEM_HOST, CEED_USE_POINTER, 3 * sizeof(CeedScalar), app_ctx->bc_traction_vect… in SetupLibceedFineLevel()
319 …PetscCall(GetRestrictionForDomain(ceed, dm, 1, domain_label, app_ctx->bc_traction_faces[i], Q, 0, … in SetupLibceedFineLevel()
360 …etData(ctxForcing, CEED_MEM_HOST, CEED_USE_POINTER, sizeof(*app_ctx->forcing_vector), app_ctx->for… in SetupLibceedFineLevel()
495 PetscErrorCode SetupLibceedLevel(DM dm, Ceed ceed, AppCtx app_ctx, ProblemData problem_data, PetscI… in SetupLibceedLevel() argument
[all …]
/libCEED/examples/fluids/src/
H A Dcloptions.c17 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()
[all …]
H A Dsetupts.c184 if (user->app_ctx->checkpoint_vtk) { in WriteOutput()
192 …intf(file_path, sizeof file_path, "%s/ns-%03" PetscInt_FMT ".vtu", user->app_ctx->output_dir, step… in WriteOutput()
210 …fined, sizeof file_path_refined, "%s/nsrefined-%03" PetscInt_FMT ".vtu", user->app_ctx->output_dir, in WriteOutput()
223 if (user->app_ctx->add_stepnum2bin) { in WriteOutput()
224 …le_path, sizeof file_path, "%s/ns-solution-%" PetscInt_FMT ".bin", user->app_ctx->output_dir, step… in WriteOutput()
226 …PetscCall(PetscSNPrintf(file_path, sizeof file_path, "%s/ns-solution.bin", user->app_ctx->output_d… in WriteOutput()
244 PetscInt num_wall = user->app_ctx->wall_forces.num_wall, dim = 3; in TSMonitor_WallForce()
245 const PetscInt *walls = user->app_ctx->wall_forces.walls; in TSMonitor_WallForce()
246 PetscViewer viewer = user->app_ctx->wall_forces.viewer; in TSMonitor_WallForce()
247 PetscViewerFormat format = user->app_ctx->wall_forces.viewer_format; in TSMonitor_WallForce()
[all …]
H A Dsetupdm.c112 DM dm_hierarchy[user->app_ctx->viz_refine + 1]; in VizRefineDM()
119 for (PetscInt i = 0, d = user->app_ctx->degree; i < user->app_ctx->viz_refine; i++) { in VizRefineDM()
126 PetscInt q_order = d + user->app_ctx->q_extra; in VizRefineDM()
127 if (i + 1 == user->app_ctx->viz_refine) d = 1; in VizRefineDM()
141 for (PetscInt i = 1; i < user->app_ctx->viz_refine; i++) { in VizRefineDM()
144 user->dm_viz = dm_hierarchy[user->app_ctx->viz_refine]; in VizRefineDM()
H A Dmisc.c143 PetscErrorCode RegressionTest(AppCtx app_ctx, Vec Q) { in RegressionTest() argument
152 …PetscCheck(strcmp(app_ctx->test_file_path, "") != 0, comm, PETSC_ERR_FILE_READ, "File for regressi… in RegressionTest()
153 PetscCall(PetscViewerBinaryOpen(comm, app_ctx->test_file_path, FILE_MODE_READ, &viewer)); in RegressionTest()
164 if (error > app_ctx->test_tol) { in RegressionTest()
207 if (problem->compute_exact_solution_error && user->app_ctx->test_type == TESTTYPE_NONE) { in PostProcess()
214 if (user->app_ctx->test_type == TESTTYPE_NONE) { in PostProcess()
223 if (user->app_ctx->test_type == TESTTYPE_SOLVER) { in PostProcess()
224 PetscCall(RegressionTest(user->app_ctx, Q)); in PostProcess()
234 PetscErrorCode SetupICsFromBinary(MPI_Comm comm, AppCtx app_ctx, Vec Q) { in SetupICsFromBinary() argument
238 PetscCall(PetscViewerBinaryOpen(comm, app_ctx->cont_file, FILE_MODE_READ, &viewer)); in SetupICsFromBinary()
[all …]
H A Dboundary_condition.c34 PetscErrorCode BoundaryConditionSetUp(User user, ProblemData problem, AppCtx app_ctx, SimpleBC bc) { in BoundaryConditionSetUp() argument
52 app_ctx->wall_forces.num_wall = bc_def->num_label_values; in BoundaryConditionSetUp()
53 PetscCall(PetscMalloc1(bc_def->num_label_values, &app_ctx->wall_forces.walls)); in BoundaryConditionSetUp()
54 …PetscCall(PetscArraycpy(app_ctx->wall_forces.walls, bc_def->label_values, bc_def->num_label_values… in BoundaryConditionSetUp()
H A Dturb_spanstats.c98 …PetscCall(DMSetupByOrder_FEM(PETSC_TRUE, PETSC_TRUE, user->app_ctx->degree, 1, user->app_ctx->q_ex… in CreateStatsDM()
488 PetscCall(CreateStatsDM(user, problem, user->app_ctx->degree)); in TurbulenceStatisticsSetup()
509 PetscCall(PetscViewerGetType(user->app_ctx->turb_spanstats_viewer, &viewer_type)); in TurbulenceStatisticsSetup()
512 …PetscCall(PetscViewerSetOptionsPrefix(user->app_ctx->turb_spanstats_viewer, "ts_monitor_turbulence… in TurbulenceStatisticsSetup()
513 PetscCall(PetscViewerSetFromOptions(user->app_ctx->turb_spanstats_viewer)); in TurbulenceStatisticsSetup()
576 PetscReal summing_duration = solution_time - user->app_ctx->cont_time; in ProcessStatistics()
595 …PetscInt collect_interval = user->app_ctx->turb_spanstats_collect_interval, viewer_interval = user… in TSMonitor_TurbulenceStatistics()
600 if (steps == user->app_ctx->cont_steps) PetscFunctionReturn(PETSC_SUCCESS); in TSMonitor_TurbulenceStatistics()
611 if (user->app_ctx->test_type == TESTTYPE_NONE) { in TSMonitor_TurbulenceStatistics()
612 …PetscCall(PetscViewerPushFormat(user->app_ctx->turb_spanstats_viewer, user->app_ctx->turb_spanstat… in TSMonitor_TurbulenceStatistics()
[all …]
H A Dvelocity_gradient_projection.c25 …PetscCall(DMSetupByOrder_FEM(PETSC_TRUE, PETSC_TRUE, user->app_ctx->degree, 1, user->app_ctx->q_ex… in VelocityGradientProjectionCreateDM()
56 PetscCall(VelocityGradientProjectionCreateDM(grad_velo_proj, user, user->app_ctx->degree)); in VelocityGradientProjectionSetup()
H A Ddifferential_filter.c207 …PetscCall(DMSetupByOrder_FEM(PETSC_TRUE, PETSC_TRUE, user->app_ctx->degree, 1, user->app_ctx->q_ex… in DifferentialFilterSetup()
217 …PetscCall(DMSetupByOrder_FEM(PETSC_TRUE, PETSC_TRUE, user->app_ctx->degree, 1, user->app_ctx->q_ex… in DifferentialFilterSetup()
324 …if (user->app_ctx->test_type == TESTTYPE_DIFF_FILTER) PetscCall(RegressionTest(user->app_ctx, Filt… in TSMonitor_DifferentialFilter()
/libCEED/examples/fluids/
H A Dnavierstokes.c71 AppCtx app_ctx; in main() local
72 PetscCall(PetscCalloc1(1, &app_ctx)); in main()
92 user->app_ctx = app_ctx; in main()
103 PetscCall(RegisterProblems_NS(app_ctx)); in main()
108 PetscCall(ProcessCommandLineOptions(comm, app_ctx, bc)); in main()
109 PetscCall(BoundaryConditionSetUp(user, problem, app_ctx, bc)); in main()
116 …PetscCheck(CeedInit(app_ctx->ceed_resource, &ceed) == CEED_ERROR_SUCCESS, comm, PETSC_ERR_LIB, "Ce… in main()
169 PetscCall(PetscFunctionListFind(app_ctx->problems, app_ctx->problem_name, &p)); in main()
170 PetscCheck(p, PETSC_COMM_SELF, 1, "Problem '%s' not found", app_ctx->problem_name); in main()
175 PetscCall(SetUpDM(dm, problem, app_ctx->degree, app_ctx->q_extra, bc, phys_ctx)); in main()
[all …]
H A Dnavierstokes.h179 AppCtx app_ctx; member
222 PetscErrorCode BoundaryConditionSetUp(User user, ProblemData problem, AppCtx app_ctx, SimpleBC bc);
262 extern PetscErrorCode PRINT_NEWTONIAN(User user, ProblemData problem, AppCtx app_ctx);
264 extern PetscErrorCode PRINT_EULER_VORTEX(User user, ProblemData problem, AppCtx app_ctx);
266 extern PetscErrorCode PRINT_SHOCKTUBE(User user, ProblemData problem, AppCtx app_ctx);
268 extern PetscErrorCode PRINT_ADVECTION(User user, ProblemData problem, AppCtx app_ctx);
270 extern PetscErrorCode PRINT_ADVECTION2D(User user, ProblemData problem, AppCtx app_ctx);
292 PetscErrorCode SetupLibceed(Ceed ceed, CeedData ceed_data, DM dm, User user, AppCtx app_ctx, Proble…
313 PetscErrorCode TSSolve_NS(DM dm, User user, AppCtx app_ctx, Physics phys, ProblemData problem, Vec …
339 PetscErrorCode RegisterProblems_NS(AppCtx app_ctx);
[all …]
/libCEED/examples/solids/
H A Delasticity.c46 AppCtx app_ctx; // Contains problem options in main() local
84 PetscCall(PetscCalloc1(1, &app_ctx)); in main()
85 PetscCall(ProcessCommandLineOptions(comm, app_ctx)); in main()
88 num_levels = app_ctx->num_levels; in main()
95 CeedInit(app_ctx->ceed_resource, &ceed); in main()
103 PetscCall(PetscFunctionListFind(problem_functions->setupPhysics, app_ctx->name, &SetupPhysics)); in main()
104 … if (!SetupPhysics) SETERRQ(PETSC_COMM_SELF, 1, "Physics setup for '%s' not found", app_ctx->name); in main()
107 …PetscCall(PetscFunctionListFind(problem_functions->setupSmootherPhysics, app_ctx->name, &SetupSmoo… in main()
108 …erPhysics) SETERRQ(PETSC_COMM_SELF, 1, "Smoother physics setup for '%s' not found", app_ctx->name); in main()
120 PetscCall(CreateDistributedDM(comm, app_ctx, &dm_orig)); in main()
[all …]
/libCEED/examples/solids/include/
H A Dmisc.h19 PetscErrorCode SetupJacobianCtx(MPI_Comm comm, AppCtx app_ctx, DM dm, Vec V, Vec V_loc, CeedData ce…
23 PetscErrorCode SetupProlongRestrictCtx(MPI_Comm comm, AppCtx app_ctx, DM dm_c, DM dm_f, Vec V_f, Ve…
34 PetscErrorCode ViewSolution(MPI_Comm comm, AppCtx app_ctx, Vec U, PetscInt increment, PetscScalar l…
36 PetscErrorCode ViewDiagnosticQuantities(MPI_Comm comm, DM dm_U, UserMult user, AppCtx app_ctx, Vec …
41 PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy);
H A Dsetup-dm.h20 PetscErrorCode CreateDistributedDM(MPI_Comm comm, AppCtx app_ctx, DM *dm);
23 PetscErrorCode SetupDMByDegree(DM dm, AppCtx app_ctx, PetscInt order, PetscBool boundary, PetscInt …
H A Dsetup-libceed.h31 …ibceedFineLevel(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionCon…
36 PetscErrorCode SetupLibceedLevel(DM dm, Ceed ceed, AppCtx app_ctx, ProblemData problem_data, PetscI…
H A Dcl-options.h14 PetscErrorCode ProcessCommandLineOptions(MPI_Comm comm, AppCtx app_ctx);
H A Dmatops.h40 PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy);
/libCEED/examples/solids/problems/
H A Dlinear.c38 …evel_ElasLinear(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionCon… in SetupLibceedFineLevel_ElasLinear() argument
43 …PetscCall(SetupLibceedFineLevel(dm, dm_energy, dm_diagnostic, ceed, app_ctx, phys_ctx, linear_elas… in SetupLibceedFineLevel_ElasLinear()
49 PetscErrorCode SetupLibceedLevel_ElasLinear(DM dm, Ceed ceed, AppCtx app_ctx, PetscInt level, Petsc… in SetupLibceedLevel_ElasLinear() argument
53 …PetscCall(SetupLibceedLevel(dm, ceed, app_ctx, linear_elasticity, level, num_comp_u, U_g_size, U_l… in SetupLibceedLevel_ElasLinear()
H A Dfinite-strain-mooney-rivlin.c40 …eLevel_ElasFSMR(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionCon… in SetupLibceedFineLevel_ElasFSMR() argument
45 …PetscCall(SetupLibceedFineLevel(dm, dm_energy, dm_diagnostic, ceed, app_ctx, phys_ctx, finite_stra… in SetupLibceedFineLevel_ElasFSMR()
51 PetscErrorCode SetupLibceedLevel_ElasFSMR(DM dm, Ceed ceed, AppCtx app_ctx, PetscInt level, PetscIn… in SetupLibceedLevel_ElasFSMR() argument
55 …PetscCall(SetupLibceedLevel(dm, ceed, app_ctx, finite_strain_Mooney_Rivlin, level, num_comp_u, U_g… in SetupLibceedLevel_ElasFSMR()
H A Dfinite-strain-neo-hookean.c40 …eLevel_ElasFSNH(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionCon… in SetupLibceedFineLevel_ElasFSNH() argument
45 …PetscCall(SetupLibceedFineLevel(dm, dm_energy, dm_diagnostic, ceed, app_ctx, phys_ctx, finite_stra… in SetupLibceedFineLevel_ElasFSNH()
51 PetscErrorCode SetupLibceedLevel_ElasFSNH(DM dm, Ceed ceed, AppCtx app_ctx, PetscInt level, PetscIn… in SetupLibceedLevel_ElasFSNH() argument
55 …PetscCall(SetupLibceedLevel(dm, ceed, app_ctx, finite_strain_neo_Hookean, level, num_comp_u, U_g_s… in SetupLibceedLevel_ElasFSNH()
H A Dproblems.h31 …ineLevel_##name(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionCon…
34 …PetscErrorCode SetupLibceedLevel_##name(DM dm, Ceed ceed, AppCtx app_ctx, PetscInt level, PetscInt…
/libCEED/examples/fluids/problems/
H A Dshocktube.c144 PetscErrorCode PRINT_SHOCKTUBE(User user, ProblemData problem, AppCtx app_ctx) { in PRINT_SHOCKTUBE() argument
151 app_ctx->problem_name)); in PRINT_SHOCKTUBE()

12