@@ -24,37 +24,37 @@ namespace {
2424 throw std::runtime_error (" Unknown variable type" );
2525 }
2626
27- }
27+ }// namespace
2828
2929
3030std::string fmu_base::make_description () const {
3131
3232 const model_info m = get_model_info ();
3333 std::stringstream ss;
34- ss << R"( <?xml version="1.0" encoding="UTF-8"?>)"
35- << " \n "
36- << R"( <fmiModelDescription fmiVersion="3.0" ) "
37- << " modelName =\" " << m. modelName << " \" "
38- << " instantiationToken =\" " << guid () << " \" "
39- << " generationTool =\" fmu4cpp "
40- << " v " << to_string ( library_version ()) << " \" "
41- << " generationDateAndTime =\" " << now () << " \" "
42- << " description =\" " << m.description << " \" "
43- << " author= \" " << m. author << " \" "
44- << " variableNamingConvention= \" " << m. variableNamingConvention << " \" "
45- << " > \n " ;
46-
47- ss << " \t " << std::boolalpha
48- << " <CoSimulation needsExecutionTool =\" " << m.needsExecutionTool << " \" "
49- << " modelIdentifier =\" " << m.modelIdentifier << " \" "
50- << " canHandleVariableCommunicationStepSize =\" " << m.canHandleVariableCommunicationStepSize << " \" "
51- << " canBeInstantiatedOnlyOncePerProcess =\" " << m.canBeInstantiatedOnlyOncePerProcess << " \" "
52- << " canGetAndSetFMUstate =\" " << m.canGetAndSetFMUstate << " \" "
53- << " canSerializeFMUstate =\" " << m. canSerializeFMUstate << " \" "
54- << R"( canNotUseMemoryManagementFunctions="true" ) "
55- << " > \n "
56- << " \t </CoSimulation> "
57- << " \n " ;
34+ ss << R"( <?xml version="1.0" encoding="UTF-8"?>)" << " \n "
35+ << " <fmiModelDescription fmiVersion= \" 3.0 \" \n"
36+ << " \t modelName= \" " << m. modelName << " \"\n "
37+ << " \t instantiationToken =\" " << guid () << " \"\n "
38+ << " \t generationTool =\" fmu4cpp v " << to_string ( library_version ()) << " \"\n "
39+ << " \t generationDateAndTime =\" " << now () << " \"\n "
40+ << " \t description= \" " << m. description << " \"\n "
41+ << " \t author =\" " << m. author << " \"\n "
42+ << " \t variableNamingConvention =\" " << m.variableNamingConvention << " \" "
43+ << " > \n\n " ;
44+
45+ ss << std::boolalpha
46+ << " \t <CoSimulation \n "
47+ << " \t\t needsExecutionTool= \" " << m. needsExecutionTool << " \"\n "
48+ << " \t\t modelIdentifier =\" " << m.modelIdentifier << " \"\n "
49+ << " \t\t canHandleVariableCommunicationStepSize =\" " << m.canHandleVariableCommunicationStepSize << " \"\n "
50+ << " \t\t canBeInstantiatedOnlyOncePerProcess =\" " << m.canBeInstantiatedOnlyOncePerProcess << " \"\n "
51+ << " \t\t canGetAndSetFMUstate =\" " << m.canGetAndSetFMUstate << " \"\n "
52+ << " \t\t canSerializeFMUstate =\" " << m.canSerializeFMUstate << " \"\n "
53+ << " \t\t providesDirectionalDerivatives =\" false \" " << " \n "
54+ << " \t\t providesAdjointDerivatives= \" false \" " << " \n "
55+ << " \t\t providesPerElementDependencies= \" false \" " << " \n "
56+ << " \t\t providesEvaluateDiscreteStates= \" false \" "
57+ << " /> \n \n" ;
5858
5959 // if (!m.vendorAnnotations.empty()) {
6060 // ss << "\t<Annotations>\n";
@@ -65,6 +65,17 @@ std::string fmu_base::make_description() const {
6565 // ss << "\t</Annotations>\n";
6666 // }
6767
68+ if (m.defaultExperiment ) {
69+ ss << " \t <DefaultExperiment " ;
70+
71+ ss << " startTime=\" " << m.defaultExperiment ->startTime << " \" " ;
72+ if (m.defaultExperiment ->stopTime ) ss << " stopTime=\" " << *m.defaultExperiment ->stopTime << " \" " ;
73+ if (m.defaultExperiment ->stepSize ) ss << " stepSize=\" " << *m.defaultExperiment ->stepSize << " \" " ;
74+ if (m.defaultExperiment ->tolerance ) ss << " tolerance=\" " << *m.defaultExperiment ->tolerance << " \" " ;
75+
76+ ss << " />\n\n " ;
77+ }
78+
6879 ss << " \t <ModelVariables>\n " ;
6980
7081 const auto allVars = [&] {
@@ -131,7 +142,7 @@ std::string fmu_base::make_description() const {
131142 // }
132143 }
133144
134- ss << " \t </ModelVariables>\n " ;
145+ ss << " \t </ModelVariables>\n\n " ;
135146
136147 ss << " \t <ModelStructure>\n " ;
137148
@@ -173,7 +184,7 @@ std::string fmu_base::make_description() const {
173184 }
174185 }
175186
176- ss << " \t </ModelStructure>\n " ;
187+ ss << " \t </ModelStructure>\n\n " ;
177188
178189 ss << " </fmiModelDescription>\n " ;
179190
0 commit comments