@@ -91,6 +91,7 @@ class KernelBase;
9191class IntegratedBCBase ;
9292class LineSearch ;
9393class UserObject ;
94+ class UserObjectBase ;
9495class AutomaticMortarGeneration ;
9596class VectorPostprocessor ;
9697class Convergence ;
@@ -108,6 +109,7 @@ namespace Moose::Kokkos
108109{
109110class MaterialPropertyStorage ;
110111class Function ;
112+ class UserObject ;
111113}
112114#endif
113115
@@ -1285,6 +1287,18 @@ class FEProblemBase : public SubProblem, public Restartable
12851287 virtual void
12861288 addReporter (const std::string & type, const std::string & name, InputParameters & parameters);
12871289
1290+ #ifdef MOOSE_KOKKOS_ENABLED
1291+ virtual void addKokkosPostprocessor (const std::string & pp_name,
1292+ const std::string & name,
1293+ InputParameters & parameters);
1294+ virtual void addKokkosVectorPostprocessor (const std::string & pp_name,
1295+ const std::string & name,
1296+ InputParameters & parameters);
1297+ virtual void addKokkosReporter (const std::string & type,
1298+ const std::string & name,
1299+ InputParameters & parameters);
1300+ #endif
1301+
12881302 /* *
12891303 * Provides const access the ReporterData object.
12901304 *
@@ -1332,6 +1346,7 @@ class FEProblemBase : public SubProblem, public Restartable
13321346 mooseError (" Unable to find user object with name '" + name + " '" );
13331347 return *(objs[0 ]);
13341348 }
1349+
13351350 /* *
13361351 * Get the user object by its name
13371352 * @param name The name of the user object being retrieved
@@ -1340,20 +1355,59 @@ class FEProblemBase : public SubProblem, public Restartable
13401355 */
13411356 const UserObject & getUserObjectBase (const std::string & name, const THREAD_ID tid = 0 ) const ;
13421357
1343- /* *
1344- * Get the Positions object by its name
1345- * @param name The name of the Positions object being retrieved
1346- * @return Const reference to the Positions object
1347- */
1348- const Positions & getPositionsObject (const std::string & name) const ;
1349-
13501358 /* *
13511359 * Check if there if a user object of given name
13521360 * @param name The name of the user object being checked for
13531361 * @return true if the user object exists, false otherwise
13541362 */
13551363 bool hasUserObject (const std::string & name) const ;
13561364
1365+ #ifdef MOOSE_KOKKOS_ENABLED
1366+ virtual void addKokkosUserObject (const std::string & user_object_name,
1367+ const std::string & name,
1368+ InputParameters & parameters);
1369+
1370+ /* *
1371+ * Get the Kokkos user object by its name
1372+ * @param name The name of the Kokkos user object being retrieved
1373+ * @return Const reference to the Kokkos user object
1374+ */
1375+ template <class T >
1376+ T & getKokkosUserObject (const std::string & name) const
1377+ {
1378+ std::vector<T *> objs;
1379+ theWarehouse ()
1380+ .query ()
1381+ .condition <AttribSystem>(" KokkosUserObject" )
1382+ .condition <AttribName>(name)
1383+ .queryInto (objs);
1384+ if (objs.empty ())
1385+ mooseError (" Unable to find Kokkos user object with name '" + name + " '" );
1386+ return *(objs[0 ]);
1387+ }
1388+
1389+ /* *
1390+ * Check if there if a Kokkos user object of given name
1391+ * @param name The name of the Kokkos user object being checked for
1392+ * @return true if the Kokkos user object exists, false otherwise
1393+ */
1394+ bool hasKokkosUserObject (const std::string & name) const ;
1395+ #endif
1396+
1397+ /* *
1398+ * Check for name collision between different user objects
1399+ * @param name The object name being added
1400+ * @param type The object type being added
1401+ */
1402+ void checkUserObjectNameCollision (const std::string & name, const std::string & type) const ;
1403+
1404+ /* *
1405+ * Get the Positions object by its name
1406+ * @param name The name of the Positions object being retrieved
1407+ * @return Const reference to the Positions object
1408+ */
1409+ const Positions & getPositionsObject (const std::string & name) const ;
1410+
13571411 /* *
13581412 * Whether or not a Postprocessor value exists by a given name.
13591413 * @param name The name of the Postprocessor
@@ -3043,6 +3097,12 @@ class FEProblemBase : public SubProblem, public Restartable
30433097 const Moose::AuxGroup & group,
30443098 TheWarehouse::Query & query);
30453099
3100+ #ifdef MOOSE_KOKKOS_ENABLED
3101+ void computeKokkosUserObjectsInternal (const ExecFlagType & type,
3102+ const Moose::AuxGroup & group,
3103+ TheWarehouse::Query & query);
3104+ #endif
3105+
30463106 // / Verify that SECOND order mesh uses SECOND order displacements.
30473107 void checkDisplacementOrders ();
30483108
@@ -3287,6 +3347,10 @@ class FEProblemBase : public SubProblem, public Restartable
32873347
32883348 void joinAndFinalize (TheWarehouse::Query query, bool isgen = false );
32893349
3350+ #ifdef MOOSE_KOKKOS_ENABLED
3351+ void kokkosJoinAndFinalize (const std::vector<Moose::Kokkos::UserObject *> & userobjs);
3352+ #endif
3353+
32903354 /* *
32913355 * Reset state of this object in preparation for the next evaluation.
32923356 */
0 commit comments