@@ -343,17 +343,16 @@ class MFEMProblem : public ExternalProblem
343343 }
344344
345345 /* *
346- * Retrieve an MFEM object from the warehouse by system and name.
346+ * Retrieve an MFEM object from the warehouse by type and name.
347347 */
348348 template <typename T>
349- T & getMFEMObject (const std::string & system,
350- const std::string & name,
351- const THREAD_ID tid = 0 ) const ;
349+ T & getMFEMObject (const std::string & name, const THREAD_ID tid = 0 ) const ;
352350
353351 /* *
354- * Determine whether an MFEM object with the supplied system and name exists.
352+ * Determine whether an MFEM object with the supplied type and name exists.
355353 */
356- bool hasMFEMObject (const std::string & system, const std::string & name) const ;
354+ template <typename T>
355+ bool hasMFEMObject (const std::string & name, const THREAD_ID tid = 0 ) const ;
357356
358357 /* *
359358 * Enumerates the supported numeric representations for MFEM variables and operators.
@@ -378,21 +377,33 @@ class MFEMProblem : public ExternalProblem
378377
379378template <typename T>
380379T &
381- MFEMProblem::getMFEMObject (const std::string & system,
382- const std::string & name,
383- const THREAD_ID tid) const
380+ MFEMProblem::getMFEMObject (const std::string & name, const THREAD_ID tid) const
384381{
385382 std::vector<T *> objs;
386383 theWarehouse ()
387384 .query ()
388- .condition <AttribSystem>(system )
385+ .condition <AttribSystem>(" MFEMObject " )
389386 .condition <AttribThread>(tid)
390387 .condition <AttribName>(name)
391388 .queryInto (objs);
392389 if (objs.empty ())
393- mooseError (" Unable to find MFEM object with system '" + system + " ' and name '" + name + " '" );
390+ mooseError (" No MFEM object '" + name + " ' of type '" + MooseUtils::prettyCppType<T>() + " '" );
394391 mooseAssert (objs.size () == 1 , " Shouldn't find more than one object with given system and name" );
395392 return *(objs[0 ]);
396393}
397394
395+ template <typename T>
396+ bool
397+ MFEMProblem::hasMFEMObject (const std::string & name, const THREAD_ID tid) const
398+ {
399+ std::vector<T *> objs;
400+ theWarehouse ()
401+ .query ()
402+ .condition <AttribSystem>(" MFEMObject" )
403+ .condition <AttribThread>(tid)
404+ .condition <AttribName>(name)
405+ .queryInto (objs);
406+ return !objs.empty ();
407+ }
408+
398409#endif
0 commit comments