| blasius.c (9309e21cb05cea9ece8686b12e67fd230a9dc2d1) | blasius.c (f8839eb4707ae2e91eaaa6df77b0ccbfa1ecfd98) |
|---|---|
| 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3// 4// SPDX-License-Identifier: BSD-2-Clause 5// 6// This file is part of CEED: http://github.com/ceed 7 8/// @file --- 284 unchanged lines hidden (view full) --- 293 PetscScalar Pascal = user->units->Pascal; 294 295 T_inf *= Kelvin; 296 T_wall *= Kelvin; 297 P0 *= Pascal; 298 U_inf *= meter / second; 299 delta0 *= meter; 300 | 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3// 4// SPDX-License-Identifier: BSD-2-Clause 5// 6// This file is part of CEED: http://github.com/ceed 7 8/// @file --- 284 unchanged lines hidden (view full) --- 293 PetscScalar Pascal = user->units->Pascal; 294 295 T_inf *= Kelvin; 296 T_wall *= Kelvin; 297 P0 *= Pascal; 298 U_inf *= meter / second; 299 delta0 *= meter; 300 |
| 301 PetscReal *mesh_ynodes = NULL; 302 PetscInt mesh_nynodes = 0; | |
| 303 if (use_mesh_modification) { | 301 if (use_mesh_modification) { |
| 302 PetscReal *mesh_ynodes = NULL; 303 PetscInt mesh_nynodes = 0; |
|
| 304 if (strcmp(mesh_ynodes_path, "")) PetscCall(GetYNodeLocs(comm, mesh_ynodes_path, &mesh_ynodes, &mesh_nynodes)); 305 PetscCall(ModifyMesh(comm, dm, problem->dim, mesh_growth, mesh_Ndelta, mesh_refine_height, mesh_top_angle, &mesh_ynodes, &mesh_nynodes)); | 304 if (strcmp(mesh_ynodes_path, "")) PetscCall(GetYNodeLocs(comm, mesh_ynodes_path, &mesh_ynodes, &mesh_nynodes)); 305 PetscCall(ModifyMesh(comm, dm, problem->dim, mesh_growth, mesh_Ndelta, mesh_refine_height, mesh_top_angle, &mesh_ynodes, &mesh_nynodes)); |
| 306 PetscCall(PetscFree(mesh_ynodes)); |
|
| 306 } 307 308 // Some properties depend on parameters from NewtonianIdealGas 309 PetscCallCeed(ceed, CeedQFunctionContextGetData(problem->apply_vol_rhs.qfunction_context, CEED_MEM_HOST, &newtonian_ig_ctx)); 310 311 blasius_ctx->weakT = weakT; 312 blasius_ctx->U_inf = U_inf; 313 blasius_ctx->T_inf = T_inf; --- 19 unchanged lines hidden (view full) --- 333 334 PetscCallCeed(ceed, CeedQFunctionContextCreate(user->ceed, &blasius_context)); 335 PetscCallCeed(ceed, CeedQFunctionContextSetData(blasius_context, CEED_MEM_HOST, CEED_USE_POINTER, sizeof(*blasius_ctx), blasius_ctx)); 336 PetscCallCeed(ceed, CeedQFunctionContextSetDataDestroy(blasius_context, CEED_MEM_HOST, FreeContextPetsc)); 337 338 PetscCallCeed(ceed, CeedQFunctionContextDestroy(&problem->ics.qfunction_context)); 339 problem->ics.qfunction_context = blasius_context; 340 if (use_stg) { | 307 } 308 309 // Some properties depend on parameters from NewtonianIdealGas 310 PetscCallCeed(ceed, CeedQFunctionContextGetData(problem->apply_vol_rhs.qfunction_context, CEED_MEM_HOST, &newtonian_ig_ctx)); 311 312 blasius_ctx->weakT = weakT; 313 blasius_ctx->U_inf = U_inf; 314 blasius_ctx->T_inf = T_inf; --- 19 unchanged lines hidden (view full) --- 334 335 PetscCallCeed(ceed, CeedQFunctionContextCreate(user->ceed, &blasius_context)); 336 PetscCallCeed(ceed, CeedQFunctionContextSetData(blasius_context, CEED_MEM_HOST, CEED_USE_POINTER, sizeof(*blasius_ctx), blasius_ctx)); 337 PetscCallCeed(ceed, CeedQFunctionContextSetDataDestroy(blasius_context, CEED_MEM_HOST, FreeContextPetsc)); 338 339 PetscCallCeed(ceed, CeedQFunctionContextDestroy(&problem->ics.qfunction_context)); 340 problem->ics.qfunction_context = blasius_context; 341 if (use_stg) { |
| 341 PetscCall(SetupSTG(comm, dm, problem, user, weakT, T_inf, P0, mesh_ynodes, mesh_nynodes)); | 342 PetscCall(SetupSTG(comm, dm, problem, user, weakT, T_inf, P0)); |
| 342 } else if (diff_filter_mms) { 343 PetscCall(DifferentialFilter_MMS_ICSetup(problem)); 344 } else { 345 problem->apply_inflow.qfunction = Blasius_Inflow; 346 problem->apply_inflow.qfunction_loc = Blasius_Inflow_loc; 347 problem->apply_inflow_jacobian.qfunction = Blasius_Inflow_Jacobian; 348 problem->apply_inflow_jacobian.qfunction_loc = Blasius_Inflow_Jacobian_loc; 349 PetscCallCeed(ceed, CeedQFunctionContextReferenceCopy(blasius_context, &problem->apply_inflow.qfunction_context)); 350 PetscCallCeed(ceed, CeedQFunctionContextReferenceCopy(blasius_context, &problem->apply_inflow_jacobian.qfunction_context)); 351 } | 343 } else if (diff_filter_mms) { 344 PetscCall(DifferentialFilter_MMS_ICSetup(problem)); 345 } else { 346 problem->apply_inflow.qfunction = Blasius_Inflow; 347 problem->apply_inflow.qfunction_loc = Blasius_Inflow_loc; 348 problem->apply_inflow_jacobian.qfunction = Blasius_Inflow_Jacobian; 349 problem->apply_inflow_jacobian.qfunction_loc = Blasius_Inflow_Jacobian_loc; 350 PetscCallCeed(ceed, CeedQFunctionContextReferenceCopy(blasius_context, &problem->apply_inflow.qfunction_context)); 351 PetscCallCeed(ceed, CeedQFunctionContextReferenceCopy(blasius_context, &problem->apply_inflow_jacobian.qfunction_context)); 352 } |
| 352 PetscCall(PetscFree(mesh_ynodes)); | |
| 353 PetscFunctionReturn(PETSC_SUCCESS); 354} | 353 PetscFunctionReturn(PETSC_SUCCESS); 354} |