11 #include "yaml-cpp/yaml.h" 32 else if (s ==
"xPlus")
34 else if (s ==
"yMinus")
36 else if (s ==
"yPlus")
40 printf(
"Error: Unknown location '%s'!\n", s.c_str());
57 else if (s ==
"NEUMANN")
59 else if (s ==
"CONVECTIVE")
61 else if (s ==
"PERIODIC")
63 else if (s ==
"SPECIAL")
67 printf(
"Error: Unknown boundary type '%s'!\n", s.c_str());
81 std::string dbKey =
"flow";
82 DB[dbKey][
"nu"].set<
real>(node[
"nu"].as<
real>(0.01));
83 DB[dbKey][
"uInitial"].set<
real>(node[
"initialVelocity"][0].as<
real>(1.0));
84 DB[dbKey][
"vInitial"].set<
real>(node[
"initialVelocity"][1].as<
real>(0.0));
85 DB[dbKey][
"uPerturb"].set<
real>(node[
"initialPerturbation"][0].as<
real>(0.0));
86 DB[dbKey][
"vPerturb"].set<
real>(node[
"initialPerturbation"][1].as<
real>(0.0));
92 printf(
"Error: BoundaryConditions pointer not initialized.\n");
95 const YAML::Node &BCs = node[
"boundaryConditions"];
96 for (
unsigned int i=0; i<BCs.size(); i++)
100 bcTypeFromString(BCs[i][
"u"][0].as<std::string>()), BCs[i][
"u"][1].as<real>());
102 bcTypeFromString(BCs[i][
"v"][0].as<std::string>()), BCs[i][
"v"][1].as<real>());
115 printf(
"Parsing YAML file with flow conditions ...\n");
116 YAML::Node nodes = YAML::LoadFile(flowFile);
117 for (
unsigned int i=0; i<nodes.size(); i++)
void parseFlowFile(std::string &flowFile, parameterDB &DB)
Parses the flow file and stores the parameters in the database.
double real
Is a float or a double depending on the machine precision.
Dirichlet boundary condition.
boundary boundaryFromString(std::string s)
Converts a string to a boundary location type.
Neumann boundary condition.
Declaration of the functions of the namespace io.
std::map< std::string, componentParameter > parameterDB
Map from a string to a componentParameter.
Contains functions related to I/O tasks.
convective boundary condition
bcType bcTypeFromString(std::string s)
Converts string to a boundary condition type.
periodic boundary condition
bcType
Specifies the type of boundary condition.
boundary
Specifies the location of the boundary.
void parseFlow(const YAML::Node &node, parameterDB &DB)
Fills the database with the flow parameters.
Stores the type of boundary condition and its value.