| densitycurrent.c (3c4b7af6bf1a206cad198c63d890a93b5be72708) | densitycurrent.c (17ce10fa51ebb1fdf632a9d19f71ef68acbb0e05) |
|---|---|
| 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other 2// CEED contributors. All Rights Reserved. See the top-level LICENSE and NOTICE 3// files for details. 4// 5// SPDX-License-Identifier: BSD-2-Clause 6// 7// This file is part of CEED: http://github.com/ceed 8 --- 13 unchanged lines hidden (view full) --- 22 PetscFunctionBeginUser; 23 ierr = NS_NEWTONIAN_IG(problem, dm, ctx); CHKERRQ(ierr); 24 // ------------------------------------------------------ 25 // SET UP DENSITY_CURRENT 26 // ------------------------------------------------------ 27 problem->ics.qfunction = ICsDC; 28 problem->ics.qfunction_loc = ICsDC_loc; 29 problem->bc = Exact_DC; | 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other 2// CEED contributors. All Rights Reserved. See the top-level LICENSE and NOTICE 3// files for details. 4// 5// SPDX-License-Identifier: BSD-2-Clause 6// 7// This file is part of CEED: http://github.com/ceed 8 --- 13 unchanged lines hidden (view full) --- 22 PetscFunctionBeginUser; 23 ierr = NS_NEWTONIAN_IG(problem, dm, ctx); CHKERRQ(ierr); 24 // ------------------------------------------------------ 25 // SET UP DENSITY_CURRENT 26 // ------------------------------------------------------ 27 problem->ics.qfunction = ICsDC; 28 problem->ics.qfunction_loc = ICsDC_loc; 29 problem->bc = Exact_DC; |
| 30 setup_context = problem->bc_ctx; | 30 CeedQFunctionContextGetData(problem->ics.qfunction_context, CEED_MEM_HOST, 31 &setup_context); |
| 31 32 // ------------------------------------------------------ 33 // Create the libCEED context 34 // ------------------------------------------------------ 35 CeedScalar theta0 = 300.; // K 36 CeedScalar thetaC = -15.; // K 37 CeedScalar P0 = 1.e5; // Pa 38 CeedScalar N = 0.01; // 1/s --- 64 unchanged lines hidden (view full) --- 103 setup_context->rc = rc; 104 setup_context->center[0] = center[0]; 105 setup_context->center[1] = center[1]; 106 setup_context->center[2] = center[2]; 107 setup_context->dc_axis[0] = dc_axis[0]; 108 setup_context->dc_axis[1] = dc_axis[1]; 109 setup_context->dc_axis[2] = dc_axis[2]; 110 | 32 33 // ------------------------------------------------------ 34 // Create the libCEED context 35 // ------------------------------------------------------ 36 CeedScalar theta0 = 300.; // K 37 CeedScalar thetaC = -15.; // K 38 CeedScalar P0 = 1.e5; // Pa 39 CeedScalar N = 0.01; // 1/s --- 64 unchanged lines hidden (view full) --- 104 setup_context->rc = rc; 105 setup_context->center[0] = center[0]; 106 setup_context->center[1] = center[1]; 107 setup_context->center[2] = center[2]; 108 setup_context->dc_axis[0] = dc_axis[0]; 109 setup_context->dc_axis[1] = dc_axis[1]; 110 setup_context->dc_axis[2] = dc_axis[2]; 111 |
| 112 problem->bc_ctx = 113 setup_context; // This is bad, context data should only be accessed via Get/Restore 114 CeedQFunctionContextRestoreData(problem->ics.qfunction_context, &setup_context); 115 |
|
| 111 PetscFunctionReturn(0); 112} | 116 PetscFunctionReturn(0); 117} |