https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KokkosSideUserObject.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "KokkosUserObject.h"
13#include "KokkosSideReducer.h"
15
19#include "TransientInterface.h"
20#include "ElementIDInterface.h"
21
22namespace Moose::Kokkos
23{
24
26 public SideReducer,
31{
32public:
34
36
41
42 virtual void compute() override;
43
47 template <typename Derived>
48 KOKKOS_FUNCTION void operator()(DefaultLoop, const ThreadID tid, const Derived & object) const;
49
50 using SideReducer::operator();
51
52protected:
53 virtual ThreadID numUserObjectThreads() const override { return numKokkosBoundarySides(); }
54};
55
56template <typename Derived>
57KOKKOS_FUNCTION void
58SideUserObject::operator()(DefaultLoop, const ThreadID tid, const Derived & object) const
59{
60 auto [elem, side] = kokkosBoundaryElementSideID(tid);
61
62 Datum datum(elem, side, kokkosAssembly(), kokkosSystems());
63
64 object.template execute<Derived>(datum);
65}
66
67} // namespace Moose::Kokkos
KOKKOS_FUNCTION dof_id_type numKokkosBoundarySides() const
Get the number of sides this Kokkos object is operating on.
KOKKOS_FUNCTION auto kokkosBoundaryElementSideID(Moose::Kokkos::ThreadID tid) const
Get the contiguous element ID - side index pair this Kokkos thread is operating on.
Intermediate base class that ties together all the interfaces for getting MooseVariableFEBases with t...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
An interface for accessing Materials.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
The Kokkos object that holds thread-private data in the parallel operations of any Kokkos object.
KOKKOS_FUNCTION void operator()(DefaultLoop, const ThreadID tid, const Derived &object) const
The parallel computation entry function called by Kokkos.
SideUserObject(const SideUserObject &object)
Copy constructor for parallel dispatch.
SideUserObject(const InputParameters &parameters)
virtual ThreadID numUserObjectThreads() const override
Get the number of threads.
static InputParameters validParams()
virtual void compute() override
Compute this user object.
Interface for objects that needs transient capabilities.
MOOSE_KOKKOS_INDEX_TYPE ThreadID