Skip to content
Snippets Groups Projects
Commit 16a284a6 authored by Martin Bauer's avatar Martin Bauer
Browse files

SerialDataHandling now also supports arbitrary tensor fields

parent 160123f5
No related branches found
No related tags found
No related merge requests found
...@@ -20,15 +20,19 @@ class Boundary: ...@@ -20,15 +20,19 @@ class Boundary:
""" """
This function defines the boundary behavior and must therefore be implemented by all boundaries. This function defines the boundary behavior and must therefore be implemented by all boundaries.
Here the boundary is defined as a list of sympy equations, from which a boundary kernel is generated. Here the boundary is defined as a list of sympy equations, from which a boundary kernel is generated.
:param pdf_field: pystencils field describing the pdf. The current cell is cell next to the boundary,
which is influenced by the boundary cell i.e. has a link from the boundary cell to Args:
itself. pdf_field: pystencils field describing the pdf. The current cell is cell next to the boundary,
:param direction_symbol: a sympy symbol that can be used as index to the pdf_field. It describes which is influenced by the boundary cell i.e. has a link from the boundary cell to
the direction pointing from the fluid to the boundary cell itself.
:param lb_method: an instance of the LB method used. Use this to adapt the boundary to the method direction_symbol: a sympy symbol that can be used as index to the pdf_field. It describes
(e.g. compressibility) the direction pointing from the fluid to the boundary cell
:param index_field: the boundary index field that can be used to retrieve and update boundary data lb_method: an instance of the LB method used. Use this to adapt the boundary to the method
:return: list of sympy equations (e.g. compressibility)
index_field: the boundary index field that can be used to retrieve and update boundary data
Returns:
:return: list of sympy equations
""" """
raise NotImplementedError("Boundary class has to overwrite __call__") raise NotImplementedError("Boundary class has to overwrite __call__")
...@@ -84,11 +88,11 @@ class UBB(Boundary): ...@@ -84,11 +88,11 @@ class UBB(Boundary):
def __init__(self, velocity, adapt_velocity_to_force=False, dim=None, name=None): def __init__(self, velocity, adapt_velocity_to_force=False, dim=None, name=None):
""" """
Args:
:param velocity: can either be a constant, an access into a field, or a callback function. velocity: can either be a constant, an access into a field, or a callback function.
The callback functions gets a numpy record array with members, 'x','y','z', 'dir' (direction) The callback functions gets a numpy record array with members, 'x','y','z', 'dir' (direction)
and 'velocity' which has to be set to the desired velocity of the corresponding link and 'velocity' which has to be set to the desired velocity of the corresponding link
:param adapt_velocity_to_force: adapt_velocity_to_force:
""" """
super(UBB, self).__init__(name) super(UBB, self).__init__(name)
self._velocity = velocity self._velocity = velocity
......
...@@ -99,7 +99,7 @@ class CahnHilliardFDStep: ...@@ -99,7 +99,7 @@ class CahnHilliardFDStep:
self.phi_field = self.data_handling.fields[phi_field_name] self.phi_field = self.data_handling.fields[phi_field_name]
self.tmp_field = self.data_handling.add_array_like(name + '_tmp', phi_field_name, latex_name='tmp') self.tmp_field = self.data_handling.add_array_like(name + '_tmp', phi_field_name, latex_name='tmp')
num_phases = self.data_handling.values_per_cell(phi_field_name) num_phases = self.phi_field.index_shape[0]
if not hasattr(mobilities, '__len__'): if not hasattr(mobilities, '__len__'):
mobilities = [mobilities] * num_phases mobilities = [mobilities] * num_phases
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment