-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
98 additions
and
7 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
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,65 @@ | ||
import msgpi.ms.blade as msb | ||
from msgpi.design_analysis import DesignAnalysis | ||
import dakota.interfacing as di | ||
|
||
|
||
class BladeDesignAnalysis(DesignAnalysis): | ||
|
||
class_name = 'blade' | ||
|
||
def __init__(self, name='', inputs={}, outputs={}, settings={}, prepros=[], postpros=[], analyses=[], logger=None, parent=None): | ||
DesignAnalysis.__init__(self, inputs, outputs, settings, prepros, postpros, analyses, logger, parent) | ||
|
||
self.name = name | ||
|
||
self.blade = None | ||
|
||
self.sg_names = [] | ||
|
||
|
||
def generateDesign(self): | ||
return | ||
|
||
|
||
def run(self): | ||
self.logger.info(f'running design analysis for {self.name}...') | ||
|
||
# Pre-process data | ||
# ---------------- | ||
self.preprocess() | ||
|
||
# Substitute parameters | ||
# --------------------- | ||
try: | ||
di.dprepro( | ||
template=self.inputs['template'], | ||
output=self.inputs['input_file'], | ||
include=self.inputs | ||
) | ||
except KeyError: | ||
pass | ||
|
||
# Create a blade object | ||
# --------------------- | ||
if not self.blade: | ||
self.blade = msb.readBladeInput(self.inputs['input_file']) | ||
|
||
self.blade.summary() | ||
|
||
if self.settings['analysis'] == 1: | ||
self.inputs['cs'] = {} | ||
# Generate cross-sectional designs | ||
for k, bs in self.blade.segments.items(): | ||
for i, cs_name in enumerate(bs.css): | ||
cs_name, cs_params = self.blade.genCrossSectionDesign(k, i) | ||
self.inputs['cs'][cs_name] = cs_params | ||
self.sg_names.append(cs_name) | ||
|
||
|
||
|
||
# Post-process data | ||
# ----------------- | ||
self.postprocess() | ||
|
||
return | ||
|
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,7 @@ | ||
def updateDict(source:dict, target:dict, ignore:list=[]): | ||
|
||
for k, v in source.items(): | ||
if not k in ignore: | ||
target[k] = v | ||
|
||
return |