Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/OpenModelica/OpenModelica…
- Loading branch information
Showing
29 changed files
with
1,813 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// name: ConnectArrayCond2 | ||
// keywords: connect conditional #3473 | ||
// status: correct | ||
// | ||
// Tests connecting deleted conditional array components. | ||
// | ||
|
||
connector InConn = input Real; | ||
connector OutConn = output Real; | ||
|
||
block Foo | ||
parameter Boolean enabled = false; | ||
InConn x if enabled; | ||
end Foo; | ||
|
||
block Src | ||
OutConn x = time; | ||
end Src; | ||
|
||
model ConnectArrayCond2 | ||
Foo[2] foo(enabled = {true, false}); | ||
Src src; | ||
Src src1; | ||
equation | ||
connect(src.x, foo[1].x); | ||
connect(src1.x, foo[2].x); | ||
end ConnectArrayCond2; | ||
|
||
// Result: | ||
// class ConnectArrayCond2 | ||
// parameter Boolean foo[1].enabled = true; | ||
// Real foo[1].x; | ||
// parameter Boolean foo[2].enabled = false; | ||
// Real src.x = time; | ||
// Real src1.x = time; | ||
// equation | ||
// foo[1].x = src.x; | ||
// end ConnectArrayCond2; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...pruntime/fmu/modelExchange/1.0/Modelica.Fluid.Examples.BranchingDynamicPipes_FMU1_CPP.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// name: Modelica.Fluid.Examples.BranchingDynamicPipes_FMI_1_0 | ||
// keywords: simulation MSL Examples FMI-Export FMI-Import | ||
// status: correct | ||
// | ||
// Simulation Results | ||
// Modelica Standard Library | ||
// | ||
|
||
loadModel(Modelica, {"3.2.1"}); getErrorString(); | ||
setCommandLineOptions("+simCodeTarget=Cpp"); getErrorString(); | ||
translateModelFMU(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString(); | ||
|
||
setCommandLineOptions("+simCodeTarget=C"); getErrorString(); | ||
importFMU("Modelica_Fluid_Examples_BranchingDynamicPipes.fmu"); getErrorString(); | ||
loadFile("Modelica_Fluid_Examples_BranchingDynamicPipes_me_FMU.mo"); getErrorString(); | ||
simulate(Modelica_Fluid_Examples_BranchingDynamicPipes_me_FMU); getErrorString(); | ||
|
||
resultFile := "Modelica_Fluid_Examples_BranchingDynamicPipes_me_FMU_res.mat"; | ||
referenceFile := getEnvironmentVar("REFERENCEFILES") + "/msl32/Modelica.Fluid.Examples.BranchingDynamicPipes.mat"; | ||
|
||
//val(pipe1_mediums_1__p, 5); | ||
//val(pipe3_flowModel_m_flows_1_, 5); | ||
//val(pipe4_mediums_5__p, 5); | ||
//val(pipe3_flowModel_m_flows_5_, 5); | ||
|
||
// Result: | ||
// true | ||
// "" | ||
// true | ||
// "" | ||
// true | ||
// "" | ||
// "SimCode: The model CoupledClutches has been translated to FMU" | ||
// "Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information. | ||
// " | ||
// "CoupledClutches_me_FMU.mo" | ||
// "" | ||
// true | ||
// "" | ||
// record SimulationResult | ||
// resultFile = "CoupledClutches_me_FMU_res.mat", | ||
// simulationOptions = "startTime = 0.0, stopTime = 1.5, numberOfIntervals = 150, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'CoupledClutches_me_FMU', options = '', outputFormat = 'mat', variableFilter = 'J1_w1|J2_w1|J3_w1|J4_w1', cflags = '', simflags = ''", | ||
// messages = "" | ||
// end SimulationResult; | ||
// "" | ||
// 3.235409814452836 | ||
// 3.382195820527042 | ||
// 3.382195822575476 | ||
// -5.144123568889825e-06 | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
TEST = ../../../rtest -v | ||
|
||
TESTFILES = \ | ||
Modelica.Fluid.Examples.BranchingDynamicPipes_hardcodedStartValues.mos | ||
|
||
# Run make failingtest | ||
FAILINGTESTFILES = | ||
|
||
|
||
# Dependency files that are not .mo .mos or Makefile | ||
# Add them here or they will be cleaned. | ||
DEPENDENCIES = \ | ||
*.mo \ | ||
*.mos \ | ||
Makefile | ||
|
||
|
||
CLEAN = `ls | grep -w -v -f deps.tmp` | ||
|
||
.PHONY : test testAll clean getdeps failingtest | ||
|
||
test: | ||
@echo | ||
@echo Running tests... | ||
@echo | ||
@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) " | ||
@$(TEST) $(TESTFILES) | ||
|
||
# Cleans all files that are not listed as dependencies | ||
clean : | ||
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp | ||
@rm -f $(CLEAN) | ||
|
||
# Run this if you want to list out the files (dependencies). | ||
# do it after cleaning and updating the folder | ||
# then you can get a list of file names (which must be dependencies | ||
# since you got them from repository + your own new files) | ||
# then add them to the DEPENDENCIES. You can find the | ||
# list in deps.txt | ||
getdeps: | ||
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp | ||
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt | ||
@echo Dependency list saved in deps.txt. | ||
@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES | ||
|
||
failingtest: | ||
@echo | ||
@echo Running failing tests... | ||
@echo | ||
@$(TEST) $(FAILINGTESTFILES) |
Oops, something went wrong.