This repository has been archived by the owner on Apr 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
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 #408 from simphony/update-to-5628c9e6e24f9b7ce0bdd…
…c9ec7d6dc07b41ec265 Sync against metadata 5628c9e6e24f9b7ce0bddc9ec7d6dc07b41ec265
- Loading branch information
Showing
14 changed files
with
176 additions
and
38 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from simphony.core import Default # noqa | ||
from .condition import Condition | ||
from simphony.core.cuba import CUBA | ||
|
||
|
||
class FreeSlipVelocity(Condition): | ||
""" | ||
Wall free slip velocity boundary condition, normal velocity | ||
is zero and tangential velocities are solved for. | ||
""" | ||
cuba_key = CUBA.FREE_SLIP_VELOCITY | ||
|
||
def __init__(self, description=Default, name=Default): | ||
super(FreeSlipVelocity, self).__init__( | ||
description=description, name=name) | ||
|
||
@classmethod | ||
def supported_parameters(cls): | ||
try: | ||
base_params = super(FreeSlipVelocity, cls).supported_parameters() | ||
except AttributeError: | ||
base_params = () | ||
return tuple(set(() + base_params)) | ||
|
||
def _default_definition(self): | ||
return "Wall free slip velocity boundary condition, normal velocity is zero and tangential velocities are solved for." # noqa |
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,53 @@ | ||
from simphony.core import Default # noqa | ||
from simphony.cuds import meta_validation | ||
from simphony.core.cuba import CUBA | ||
from .material import Material | ||
|
||
|
||
class MultiphaseMaterial(Material): | ||
""" | ||
a multiphase material system, specifies the materials | ||
composing the mixture, or suspension, or multicrystal, etc. | ||
""" | ||
cuba_key = CUBA.MULTIPHASE_MATERIAL | ||
|
||
def __init__(self, material, description=Default, name=Default): | ||
super(MultiphaseMaterial, self).__init__( | ||
description=description, name=name) | ||
self._init_material(material) | ||
|
||
@classmethod | ||
def supported_parameters(cls): | ||
try: | ||
base_params = super(MultiphaseMaterial, cls).supported_parameters() | ||
except AttributeError: | ||
base_params = () | ||
return tuple(set((CUBA.MATERIAL, ) + base_params)) | ||
|
||
def _default_definition(self): | ||
return "a multiphase material system, specifies the materials composing the mixture, or suspension, or multicrystal, etc." # noqa | ||
|
||
def _init_material(self, value): | ||
if value is Default: | ||
value = self._default_material() | ||
|
||
self.material = value | ||
|
||
@property | ||
def material(self): | ||
return self.data[CUBA.MATERIAL] | ||
|
||
@material.setter | ||
def material(self, value): | ||
value = self._validate_material(value) | ||
self.data[CUBA.MATERIAL] = value | ||
|
||
def _validate_material(self, value): | ||
value = meta_validation.cast_data_type(value, 'MATERIAL') | ||
meta_validation.check_valid_shape(value, [None], 'MATERIAL') | ||
meta_validation.check_elements(value, [None], 'MATERIAL') | ||
|
||
return value | ||
|
||
def _default_material(self): | ||
raise TypeError("No default for material") |
This file was deleted.
Oops, something went wrong.
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