Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@594 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information
Showing
2 changed files
with
178 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,104 @@ | ||
-- | ||
-- | ||
Problem with env when using "extends": | ||
|
||
|
||
domain Domain2D | ||
space Real x,y; | ||
end Domain2D; | ||
|
||
model PDECoeff2 | ||
Real u(spacedim=2); | ||
parameter Real da=0; | ||
parameter Real c=0; | ||
parameter Real alfa=0; | ||
parameter Real gamma=0; | ||
parameter Real a=0; | ||
parameter Real beta=0; | ||
parameter Real f=0; | ||
Domain2D defdom; | ||
end PDECoeff2; | ||
|
||
|
||
model GenNeumann | ||
extends PDECoeff2; | ||
parameter Real n=1; | ||
parameter Real q=0; | ||
parameter Real g=0; | ||
end GenNeumann; | ||
|
||
|
||
model HeatTransfer | ||
extends PDECoeff2; | ||
equation | ||
da=1; | ||
c=1; | ||
alfa=0; | ||
gamma=0; | ||
a=0; | ||
beta=0; | ||
f=0; | ||
end HeatTransfer; | ||
|
||
model HeatNeumann | ||
extends GenNeumann; | ||
parameter Real k=1; | ||
parameter Real qh=0; | ||
parameter Real hh=1; | ||
parameter Real Tinf=25; | ||
equation | ||
c=k; | ||
alfa=0; | ||
gamma=0; | ||
q=hh; | ||
g=qh + hh*Tinf; | ||
end HeatNeumann; | ||
|
||
function MyFunc | ||
constant Real PI=3.14159265358979; | ||
parameter Real x0=0, y0=0, ra=1, rb=1; | ||
input Real u; | ||
output Real x,y; | ||
algorithm | ||
x := x0 + ra*sin(u*PI*2); | ||
y := y0 + rb*cos(u*PI*2); | ||
end MyFunc; | ||
|
||
domain Line2D | ||
space Real x,y; | ||
// extends Domain2D; | ||
parameter Real x0=0, y0=0, x1=1, y1=1; | ||
PDECoeff2 eq; | ||
end Line2D; | ||
|
||
domain Rectangular | ||
space Real x,y; | ||
// extends Domain2D; | ||
space Real u; | ||
PDECoeff2 eq; | ||
parameter Real x0=0, y0=0, x1=1, y1=1; | ||
Line2D left(x0=x0, y0=y0, x1=x0, y1=y1); | ||
Line2D top(x0=x0, y0=y1, x1=x1, y1=y1); | ||
Line2D right(x0=x1, y0=y1, x1=x1 ,y1=y0); | ||
Line2D bottom(x0=x1, y0=y0, x1=x0, y1=y0); | ||
end Rectangular; | ||
|
||
|
||
model PDEModel | ||
parameter Real u_init(spacedim=2)=55; | ||
HeatNeumann h_iso; | ||
HeatNeumann h_glass(qh=1.5); | ||
HeatTransfer pde(u(start=u_init)); | ||
Rectangular rect; | ||
|
||
end PDEModel; | ||
|
||
|
||
|
||
The commented extends lines causes: | ||
|
||
# unknown class 'PDECoeff2' while instantiating rect.eq | ||
# unknown class 'Line2D' while instantiating rect.left | ||
# unknown class 'Line2D' while instantiating rect.top | ||
# unknown class 'Line2D' while instantiating rect.right | ||
# unknown class 'Line2D' while instantiating rect.bottom |
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,76 @@ | ||
Debug flags | ||
|
||
Run modeq with comma separated list of flags without spaces, | ||
"+d=flg1,flg2,..." where flg1,flg2,... are one of the strings on the | ||
leftmost column. Special flag named "all" turns on all flags. | ||
|
||
Each debug printing is done by giving a flag name to the print function, like: | ||
|
||
Debug.fprint ("li", "Lookup information:...") | ||
|
||
If modeq is run with +d=foo,li,bar,etc this line will appear on | ||
stdout, not otherwise. For backwards compatibility for debug prints | ||
not yet sorted, the old | ||
|
||
Debug.print | ||
|
||
was changed to a call like | ||
|
||
Debug.fprint ("olddebug",...) | ||
|
||
So if modeq is run with the debug flag "olddebug" (or "all"), these | ||
messages will appear. The calls to Debug.print should eventually be | ||
changed to appropriate flagged calls. | ||
|
||
'-' in front of a flag turns of that flag, i.e. d=all,-dump will turn on all flags | ||
except dump. | ||
|
||
|
||
--------------------------------------------------------------------------- | ||
all Turn on all debugging. | ||
General-------------------------------------------------------------------- | ||
|
||
info General information | ||
olddebug print messages sent to the old Debug.print | ||
Dump----------------------------------------------------------------------- | ||
dump dump the absyn tree | ||
dumpgraphviz dump the absyn tree in graphviz format | ||
daedump dump the dae in printed form | ||
daedumpdebug dump the dae in expression form | ||
dumptr dump trace | ||
Types---------------------------------------------------------------------- | ||
tf functions | ||
tytr trace | ||
Lookup--------------------------------------------------------------------- | ||
li information | ||
lotr trace | ||
locom compare | ||
Static--------------------------------------------------------------------- | ||
sei information | ||
setr trace | ||
SCode---------------------------------------------------------------------- | ||
ecd elab_classdef | ||
Instantiation-------------------------------------------------------------- | ||
insttr trace | ||
Codegen-------------------------------------------------------------------- | ||
cg | ||
cgtr tracing matching rules | ||
codegen code generation | ||
cgpde pde related code generation | ||
cgpdeheader header part of pde related code, use with cgpde | ||
cgpdecode code part of pde related code, use with cgpde | ||
PDE------------------------------------------------------------------------ | ||
pde | ||
pdaedumpdebug dump the pdae in expression form | ||
pdaedumpgraphv dump the pdae in graphviz format | ||
beforefixmodout dump the pdae in expression form before | ||
moving the modification equations into the | ||
VAR declarations | ||
--------------------------------------------------------------------------- | ||
|
||
|
||
|
||
Graphviz | ||
|
||
To use graphviz, give one of the graphviz flags, and redirect the output to a file. | ||
Then run "dot -Tps filename -o filename.ps" or "dotty filename". |