Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rotare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rouma Alexandre
Rotare
Commits
75f15da2
Verified
Commit
75f15da2
authored
1 year ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(Result): add perf summary
parent
435e56d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/classes/@Result/Result.m
+62
-1
62 additions, 1 deletion
src/classes/@Result/Result.m
src/classes/@Result/summarize.m
+46
-0
46 additions, 0 deletions
src/classes/@Result/summarize.m
src/rotare.m
+1
-2
1 addition, 2 deletions
src/rotare.m
with
109 additions
and
3 deletions
src/classes/@Result/Result.m
+
62
−
1
View file @
75f15da2
...
...
@@ -47,10 +47,20 @@ classdef Result < handle
indfact
(
1
,
:)
OperRotor
% Results obtained with the indFact solver
indvel
(
1
,
:)
OperRotor
% Results obtained with the indVel solver
stahlhut
(
1
,
:)
OperRotor
% Results obtained with the stalhlut solver
operPts
(:,
4
)
table
% Table of operating points for each individual result
operPts
table
% Table of operating points for each individual result
ModExt
(
1
,
1
)
struct
% Modelling enstension options (losses, etc)
end
properties
(
Dependent
)
cT
cP
cQ
end
properties
(
Constant
,
Hidden
)
SOLVERS
=
{
'leishman'
,
'indfact'
,
'indvel'
,
'stahlhut'
}
% List of allowed solvers
end
methods
function
self
=
Result
()
...
...
@@ -60,8 +70,59 @@ classdef Result < handle
% Currently empty on purpose. Results are to be assigned manually.
end
% ---------------------------------------------
% Set methods
function
set
.
operPts
(
self
,
val
)
% Note: A bug in Matlab prevents the user of variable names when size checks are added
% in the property definition. https://stackoverflow.com/q/48423003
self
.
operPts
=
val
;
self
.
operPts
.
Properties
.
VariableNames
=
{
'Alt'
,
'V_ax'
,
'RPM'
,
'Coll'
};
end
% ---------------------------------------------
% Get methods for dependent properties
function
cT
=
get
.
cT
(
self
)
cT
=
maketable
(
self
,
'cT'
);
end
function
cQ
=
get
.
cQ
(
self
)
cQ
=
maketable
(
self
,
'cQ'
);
end
function
cP
=
get
.
cP
(
self
)
cP
=
maketable
(
self
,
'cP'
);
end
% ---------------------------------------------
% Other methods
save
(
self
,
SaveOpts
)
% Save the results to file
summaryTable
=
summarize
(
self
,
propList
)
% Summarize results
end
end
function
resTable
=
maketable
(
self
,
prop
)
% MAKETABLE Gather properties from all solvers and all operating points in a table
resTable
=
table
(
'Size'
,
[
size
(
self
.
operPts
,
1
),
4
],
...
'VariableTypes'
,
{
'double'
,
'double'
,
'double'
,
'double'
});
propName
=
cell
(
1
,
4
);
for
i
=
1
:
length
(
self
.
SOLVERS
)
propName
{
i
}
=
[
prop
,
'_'
,
self
.
SOLVERS
{
i
}];
end
resTable
.
Properties
.
VariableNames
=
propName
;
for
iOp
=
1
:
size
(
self
.
operPts
,
1
)
for
iSolv
=
1
:
length
(
self
.
SOLVERS
)
solver
=
self
.
SOLVERS
{
iSolv
};
if
~
isempty
(
self
.
(
solver
))
resTable
.
(
iSolv
)(
iOp
)
=
self
.
(
solver
)(
iOp
)
.
(
prop
);
else
resTable
.
(
iSolv
)(
iOp
)
=
NaN
;
end
end
end
end
This diff is collapsed.
Click to expand it.
src/classes/@Result/summarize.m
0 → 100644
+
46
−
0
View file @
75f15da2
function
summaryTable
=
summarize
(
self
,
propList
)
% SUMMARIZE Summarize results into a single clean table.
% This method outputs a table with the operating conditions and the final values found for
% various properties.
% -----
%
% Syntax:
% Result.summarize() Outputs a table with all available data (cT, cQ, cP).
%
% Result.summarize(propList) Outputs a table with only the data listed in propList.
%
% Inputs:
% propList : (optional) Array with the names of the properties to ouptut. {'cT', 'cQ', 'cP'}
%
% Outputs:
% summaryTable : Table with the operating points and the corresponding rotor performance.
%
% See also: rotare, Result, template.
%
% <a href="https://gitlab.uliege.be/rotare/documentation">Complete documentation (online)</a>
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022-2023 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
% Repo: https://gitlab.uliege.be/rotare/rotare
% Docs: https://gitlab.uliege.be/rotare/documentation
% Issues: https://gitlab.uliege.be/rotare/rotare/-/issues
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Defaults and constants
ALLOWED_PROPERTIES
=
{
'cT'
,
'cQ'
,
'cP'
};
if
nargin
<
2
propList
=
ALLOWED_PROPERTIES
;
end
propTable
=
table
;
for
i
=
1
:
length
(
propList
)
propTable
=
[
propTable
,
self
.
(
propList
{
i
})];
end
summaryTable
=
[
self
.
operPts
,
propTable
];
self
.
operPts
;
end
This diff is collapsed.
Click to expand it.
src/rotare.m
+
1
−
2
View file @
75f15da2
...
...
@@ -156,8 +156,7 @@ function [Results] = rotare(configFile)
end
% Add context to the Results and save if needed
Results
.
operPts
=
array2table
(
operPoints
,
...
'VariableNames'
,
{
'Alt'
,
'V_ax'
,
'RPM'
,
'Coll'
});
Results
.
operPts
=
array2table
(
operPoints
);
Results
.
ModExt
=
Mod
.
Ext
;
if
Sim
.
Save
.
autosave
Results
.
save
(
Sim
.
Save
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment