-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #335 from PaulTalbot-INL/poly_doverefactor
Polynomial transfer function
- Loading branch information
Showing
18 changed files
with
671 additions
and
231 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,40 @@ | ||
|
||
# Copyright 2020, Battelle Energy Alliance, LLC | ||
# ALL RIGHTS RESERVED | ||
|
||
from ravenframework.utils import InputData, InputTypes | ||
from ravenframework.EntityFactoryBase import EntityFactory | ||
|
||
from .Ratio import Ratio | ||
from .Polynomial import Polynomial | ||
|
||
class TransferFuncFactory(EntityFactory): | ||
""" | ||
Factory for Transfer Functions | ||
""" | ||
def make_input_specs(self, name, descr=None): | ||
""" | ||
Fill input specs for the provided name and description. | ||
@ In, name, str, name of new spec | ||
@ In, descr, str, optional, description of spec | ||
@ Out, spec, InputData, specification | ||
""" | ||
add_descr = '' | ||
if descr is None: | ||
description = add_descr | ||
else: | ||
description = descr + r"""\\ \\""" + add_descr | ||
|
||
spec = InputData.parameterInputFactory(name, descr=description) | ||
for name, klass in self._registeredTypes.items(): | ||
sub_spec = klass.get_input_specs() | ||
sub_spec.name = name | ||
spec.addSub(sub_spec) | ||
return spec | ||
|
||
factory = TransferFuncFactory('TransferFunc') | ||
|
||
# fixed in inner | ||
factory.registerType('ratio', Ratio) | ||
factory.registerType('linear', Ratio) | ||
factory.registerType('poly', Polynomial) |
Oops, something went wrong.