Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #408 from simphony/update-to-5628c9e6e24f9b7ce0bdd…
Browse files Browse the repository at this point in the history
…c9ec7d6dc07b41ec265

Sync against metadata 5628c9e6e24f9b7ce0bddc9ec7d6dc07b41ec265
  • Loading branch information
stefanoborini committed Mar 31, 2017
2 parents b7d24bc + 4d12440 commit 2b21e58
Show file tree
Hide file tree
Showing 14 changed files with 176 additions and 38 deletions.
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ exclude = doc/*
# Post 0.6.0.
# Addition of CFD metadata: 1b64cc80045cf99ffa3594342b44098c1c09be8d
# Addition of PDE conditions: 19daa41858438d93c79c4957c56b7c78693083a8
repotag = 19daa41858438d93c79c4957c56b7c78693083a8
# Addition of PR #129, #130, #132: 5628c9e6e24f9b7ce0bddc9ec7d6dc07b41ec265
repotag = 5628c9e6e24f9b7ce0bddc9ec7d6dc07b41ec265
3 changes: 2 additions & 1 deletion simphony/core/cuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class CUBA(Enum):
FLUX = "FLUX"
FORCE = "FORCE"
FREE = "FREE"
FREE_SLIP_VELOCITY = "FREE_SLIP_VELOCITY"
FREE_SURFACE_MODEL = "FREE_SURFACE_MODEL"
FRICTION_COEFFICIENT = "FRICTION_COEFFICIENT"
FULL = "FULL"
Expand Down Expand Up @@ -147,6 +148,7 @@ class CUBA(Enum):
MOMENTUM = "MOMENTUM"
MOMENT_INERTIA = "MOMENT_INERTIA"
MONOCLINIC_LATTICE = "MONOCLINIC_LATTICE"
MULTIPHASE_MATERIAL = "MULTIPHASE_MATERIAL"
MULTIPHASE_MODEL = "MULTIPHASE_MODEL"
NAME = "NAME"
NAME_UC = "NAME_UC"
Expand Down Expand Up @@ -204,7 +206,6 @@ class CUBA(Enum):
SINGLE_PHASE_MODEL = "SINGLE_PHASE_MODEL"
SIZE = "SIZE"
SJKR_COHESION_FORCE = "SJKR_COHESION_FORCE"
SLIP_VELOCITY = "SLIP_VELOCITY"
SMOOTHING_LENGTH = "SMOOTHING_LENGTH"
SOFTWARE_TOOL = "SOFTWARE_TOOL"
SOLVER_PARAMETER = "SOLVER_PARAMETER"
Expand Down
21 changes: 14 additions & 7 deletions simphony/core/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,13 @@
shape=[1],
length=None,
dtype=None),
'FREE_SLIP_VELOCITY': Keyword(
name='FreeSlipVelocity',
definition='Wall free slip velocity boundary condition, normal velocity is zero and tangential velocities are solved for.', # noqa
key='FREE_SLIP_VELOCITY',
shape=[1],
length=None,
dtype=None),
'FREE_SURFACE_MODEL': Keyword(
name='FreeSurfaceModel',
definition='Free surface model', # noqa
Expand Down Expand Up @@ -1388,6 +1395,13 @@
shape=[1],
length=None,
dtype=None),
'MULTIPHASE_MATERIAL': Keyword(
name='MultiphaseMaterial',
definition='a multiphase material system, specifies the materials composing the mixture, or suspension, or multicrystal, etc.', # noqa
key='MULTIPHASE_MATERIAL',
shape=[1],
length=None,
dtype=None),
'MULTIPHASE_MODEL': Keyword(
name='MultiphaseModel',
definition='Multiphase model', # noqa
Expand Down Expand Up @@ -1563,13 +1577,6 @@
shape=[1],
length=None,
dtype=None),
'SLIP_VELOCITY': Keyword(
name='SlipVelocity',
definition='Wall free slip velocity boundary condition', # noqa
key='SLIP_VELOCITY',
shape=[1],
length=None,
dtype=None),
'SOFTWARE_TOOL': Keyword(
name='SoftwareTool',
definition='Represents a software tool which is used to solve the model or in pre/post processing', # noqa
Expand Down
3 changes: 2 additions & 1 deletion simphony/cuds/meta/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from .face_centered_orthorhombic_lattice import FaceCenteredOrthorhombicLattice # noqa
from .fem import Fem # noqa
from .free import Free # noqa
from .free_slip_velocity import FreeSlipVelocity # noqa
from .free_surface_model import FreeSurfaceModel # noqa
from .fvm import Fvm # noqa
from .granular_dynamics import GranularDynamics # noqa
Expand Down Expand Up @@ -74,6 +75,7 @@
from .molecular_dynamics import MolecularDynamics # noqa
from .molecular_statics import MolecularStatics # noqa
from .monoclinic_lattice import MonoclinicLattice # noqa
from .multiphase_material import MultiphaseMaterial # noqa
from .multiphase_model import MultiphaseModel # noqa
from .neumann import Neumann # noqa
from .newtonian_fluid_model import NewtonianFluidModel # noqa
Expand All @@ -99,7 +101,6 @@
from .simple_relative_velocity_model import SimpleRelativeVelocityModel # noqa
from .single_phase_model import SinglePhaseModel # noqa
from .sjkr_cohesion_force import SjkrCohesionForce # noqa
from .slip_velocity import SlipVelocity # noqa
from .software_tool import SoftwareTool # noqa
from .solver_parameter import SolverParameter # noqa
from .sph import Sph # noqa
Expand Down
11 changes: 11 additions & 0 deletions simphony/cuds/meta/constant_pressure_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self, pressure, material, description=Default, name=Default):
super(ConstantPressureCondition, self).__init__(
material=material, description=description, name=name)
self._init_models()
self._init_variables()
self._init_pressure(pressure)

@classmethod
Expand All @@ -38,6 +39,16 @@ def _default_models(self):
def _default_definition(self):
return "Constant pressure condition" # noqa

def _init_variables(self):
self._variables = self._default_variables() # noqa

@property
def variables(self):
return self._variables

def _default_variables(self):
return ['CUBA.PRESSURE'] # noqa

def _init_pressure(self, value):
if value is Default:
value = self._default_pressure()
Expand Down
11 changes: 11 additions & 0 deletions simphony/cuds/meta/constant_velocity_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self, velocity, material, description=Default, name=Default):
super(ConstantVelocityCondition, self).__init__(
material=material, description=description, name=name)
self._init_models()
self._init_variables()
self._init_velocity(velocity)

@classmethod
Expand All @@ -38,6 +39,16 @@ def _default_models(self):
def _default_definition(self):
return "Constant velocity condition" # noqa

def _init_variables(self):
self._variables = self._default_variables() # noqa

@property
def variables(self):
return self._variables

def _default_variables(self):
return ['CUBA.VELOCITY'] # noqa

def _init_velocity(self, value):
if value is Default:
value = self._default_velocity()
Expand Down
11 changes: 11 additions & 0 deletions simphony/cuds/meta/constant_volume_fraction_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self,
super(ConstantVolumeFractionCondition, self).__init__(
material=material, description=description, name=name)
self._init_models()
self._init_variables()
self._init_volume_fraction(volume_fraction)

@classmethod
Expand All @@ -42,6 +43,16 @@ def _default_models(self):
def _default_definition(self):
return "Constant volume fraction condition" # noqa

def _init_variables(self):
self._variables = self._default_variables() # noqa

@property
def variables(self):
return self._variables

def _default_variables(self):
return ['CUBA.VOLUME_FRACTION'] # noqa

def _init_volume_fraction(self, value):
if value is Default:
value = self._default_volume_fraction()
Expand Down
26 changes: 26 additions & 0 deletions simphony/cuds/meta/free_slip_velocity.py
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
53 changes: 53 additions & 0 deletions simphony/cuds/meta/multiphase_material.py
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")
28 changes: 0 additions & 28 deletions simphony/cuds/meta/slip_velocity.py

This file was deleted.

11 changes: 11 additions & 0 deletions simphony/cuds/meta/wetting_angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self,
super(WettingAngle, self).__init__(
material=material, description=description, name=name)
self._init_models()
self._init_variables()
self._init_contact_angle(contact_angle)

@classmethod
Expand All @@ -43,6 +44,16 @@ def _default_models(self):
def _default_definition(self):
return "Wetting angle Volume fraction wall boundary condition" # noqa

def _init_variables(self):
self._variables = self._default_variables() # noqa

@property
def variables(self):
return self._variables

def _default_variables(self):
return ['CUBA.CONTACT_ANGLE'] # noqa

def _init_material(self, value):
if value is Default:
value = self._default_material()
Expand Down
11 changes: 11 additions & 0 deletions simphony/cuds/meta/zero_gradient_pressure_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self, pressure, material, description=Default, name=Default):
super(ZeroGradientPressureCondition, self).__init__(
material=material, description=description, name=name)
self._init_models()
self._init_variables()
self._init_pressure(pressure)

@classmethod
Expand All @@ -38,6 +39,16 @@ def _default_models(self):
def _default_definition(self):
return "Zero gradient pressure condition" # noqa

def _init_variables(self):
self._variables = self._default_variables() # noqa

@property
def variables(self):
return self._variables

def _default_variables(self):
return ['CUBA.PRESSURE'] # noqa

def _init_pressure(self, value):
if value is Default:
value = self._default_pressure()
Expand Down
11 changes: 11 additions & 0 deletions simphony/cuds/meta/zero_gradient_velocity_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self, velocity, material, description=Default, name=Default):
super(ZeroGradientVelocityCondition, self).__init__(
material=material, description=description, name=name)
self._init_models()
self._init_variables()
self._init_velocity(velocity)

@classmethod
Expand All @@ -38,6 +39,16 @@ def _default_models(self):
def _default_definition(self):
return "Zero gradient velocity condition" # noqa

def _init_variables(self):
self._variables = self._default_variables() # noqa

@property
def variables(self):
return self._variables

def _default_variables(self):
return ['CUBA.VELOCITY'] # noqa

def _init_velocity(self, value):
if value is Default:
value = self._default_velocity()
Expand Down
11 changes: 11 additions & 0 deletions simphony/cuds/meta/zero_gradient_volume_fraction_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self,
super(ZeroGradientVolumeFractionCondition, self).__init__(
material=material, description=description, name=name)
self._init_models()
self._init_variables()
self._init_volume_fraction(volume_fraction)

@classmethod
Expand All @@ -42,6 +43,16 @@ def _default_models(self):
def _default_definition(self):
return "Zero gradient volume fraction condition" # noqa

def _init_variables(self):
self._variables = self._default_variables() # noqa

@property
def variables(self):
return self._variables

def _default_variables(self):
return ['CUBA.VOLUME_FRACTION'] # noqa

def _init_volume_fraction(self, value):
if value is Default:
value = self._default_volume_fraction()
Expand Down

0 comments on commit 2b21e58

Please sign in to comment.