10 #ifdef MOOSE_MFEM_ENABLED 20 return std::make_tuple(this->make<mfem::PWVectorCoefficient>(coeff->GetVDim()),
21 std::map<
const std::string, std::shared_ptr<mfem::VectorCoefficient>>());
26 MatrixMap::emptyPWData(std::shared_ptr<mfem::MatrixCoefficient> coeff)
28 return std::make_tuple(
29 this->make<mfem::PWMatrixCoefficient>(coeff->GetHeight(), coeff->GetWidth()),
30 std::map<
const std::string, std::shared_ptr<mfem::MatrixCoefficient>>());
35 VectorMap::checkPWData(std::shared_ptr<mfem::VectorCoefficient> coeff,
36 std::shared_ptr<mfem::PWVectorCoefficient> existing_pw,
37 const std::string & name)
39 const int new_dim = coeff->GetVDim(), old_dim = existing_pw->GetVDim();
40 if (new_dim != old_dim)
41 mooseError(
"Trying to assign vector of dimension " + std::to_string(new_dim) +
42 " to property '" + name +
"' with dimension dimension " + std::to_string(old_dim));
47 MatrixMap::checkPWData(std::shared_ptr<mfem::MatrixCoefficient> coeff,
48 std::shared_ptr<mfem::PWMatrixCoefficient> existing_pw,
49 const std::string & name)
51 const int new_height = coeff->GetHeight(), new_width = coeff->GetWidth(),
52 old_height = existing_pw->GetHeight(), old_width = existing_pw->GetWidth();
53 if (new_height != old_height || new_width != old_width)
54 mooseError(
"Trying to assign matrix with dimensions (" + std::to_string(new_height) +
", " +
55 std::to_string(new_width) +
") to property '" + name +
"' with dimensions (" +
56 std::to_string(old_height) +
", " + std::to_string(old_width) +
")");
PWData emptyPWData(std::shared_ptr< mfem::VectorCoefficient >)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
std::tuple< std::shared_ptr< mfem::PWVectorCoefficient >, std::map< const std::string, std::shared_ptr< mfem::VectorCoefficient > >> PWData
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).