GEOS
FluidUpdateKernel_impl.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUIDUPDATEKERNEL_IMPL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUIDUPDATEKERNEL_IMPL_HPP
22 
23 #include "FluidUpdateKernel.hpp"
24 
25 namespace geos
26 {
27 
28 namespace thermalCompositionalMultiphaseBaseKernels
29 {
30 
31 template< typename POLICY, typename FLUID >
32 void
33 FluidUpdateKernel< POLICY, FLUID >::launch( localIndex const size,
34  typename FLUID::KernelWrapper const & fluidWrapper,
35  arrayView1d< real64 const > const & pres,
36  arrayView1d< real64 const > const & temp,
37  arrayView2d< real64 const, compflow::USD_COMP > const & compFrac )
38 {
39  forAll< POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k )
40  {
41  for( localIndex q = 0; q < fluidWrapper.numGauss(); ++q )
42  {
43  fluidWrapper.update( k, q, pres[k], temp[k], compFrac[k] );
44  }
45  } );
46 }
47 
48 template< typename POLICY, typename FLUID >
49 void
50 FluidUpdateKernel< POLICY, FLUID >::launch( SortedArrayView< localIndex const > const & targetSet,
51  typename FLUID::KernelWrapper const & fluidWrapper,
52  arrayView1d< real64 const > const & pres,
53  arrayView1d< real64 const > const & temp,
54  arrayView2d< real64 const, compflow::USD_COMP > const & compFrac )
55 {
56  forAll< POLICY >( targetSet.size(), [=] GEOS_HOST_DEVICE ( localIndex const a )
57  {
58  localIndex const k = targetSet[a];
59  for( localIndex q = 0; q < fluidWrapper.numGauss(); ++q )
60  {
61  fluidWrapper.update( k, q, pres[k], temp[k], compFrac[k] );
62  }
63  } );
64 }
65 
66 } // namespace thermalCompositionalMultiphaseBaseKernels
67 
68 } // namespace geos
69 
70 #endif //GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUIDUPDATEKERNEL_IMPL_HPP
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:49
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:84