https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Functions
MFEMGenericFunctorVectorMaterial.C File Reference

Go to the source code of this file.

Functions

 registerMooseObject ("MooseApp", MFEMGenericFunctorVectorMaterial)
 
std::vector< MFEMVectorCoefficientName > processLiteralVectors (const std::vector< MFEMVectorCoefficientName > &input)
 Handle any numerical vector values, which should be enclosed in curly braces.
 

Function Documentation

◆ processLiteralVectors()

std::vector< MFEMVectorCoefficientName > processLiteralVectors ( const std::vector< MFEMVectorCoefficientName > &  input)

Handle any numerical vector values, which should be enclosed in curly braces.

Definition at line 19 of file MFEMGenericFunctorVectorMaterial.C.

20{
21 std::vector<MFEMVectorCoefficientName> result;
22 bool in_literal = false;
23 MFEMVectorCoefficientName literal;
24 for (const auto & item : input)
25 {
26 if (in_literal)
27 {
28 if (item.front() == '{')
29 mooseError("Nested numeric vector values are not permitted in "
30 "MFEMGenericFunctorVectoMaterial prop_values.");
31 else if (item.back() == '}')
32 {
33 in_literal = false;
34 literal += " " + item.substr(0, item.size() - 1);
35 result.push_back(literal);
36 }
37 else
38 literal += " " + item;
39 }
40 else if (item.front() == '{')
41 {
42 if (item.back() == '}')
43 result.push_back(item.substr(1, item.size() - 2));
44 else
45 {
46 in_literal = true;
47 literal = item.substr(1);
48 }
49 }
50 else
51 result.push_back(item);
52 }
53 if (in_literal)
54 mooseError("No closing curly brace for vector value in "
55 "MFEMGenericFunctorVectorMaterial prop_values: '{" +
56 literal + "'");
57 return result;
58}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311

◆ registerMooseObject()

registerMooseObject ( "MooseApp"  ,
MFEMGenericFunctorVectorMaterial   
)