Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (23)
Showing
with 7220 additions and 492 deletions
...@@ -16,4 +16,5 @@ _local_tmp ...@@ -16,4 +16,5 @@ _local_tmp
doc/bibtex.json doc/bibtex.json
/db /db
/lbmpy/phasefield/simplex_projection.*.so /lbmpy/phasefield/simplex_projection.*.so
/lbmpy/phasefield/simplex_projection.c /lbmpy/phasefield/simplex_projection.c
\ No newline at end of file *.swp
...@@ -173,12 +173,11 @@ class UBB(LbBoundary): ...@@ -173,12 +173,11 @@ class UBB(LbBoundary):
def __call__(self, f_out, f_in, dir_symbol, inv_dir, lb_method, index_field): def __call__(self, f_out, f_in, dir_symbol, inv_dir, lb_method, index_field):
vel_from_idx_field = callable(self._velocity) vel_from_idx_field = callable(self._velocity)
vel = [index_field(f'vel_{i}') for i in range(self.dim)] if vel_from_idx_field else self._velocity vel = [index_field(f'vel_{i}') for i in range(self.dim)] if vel_from_idx_field else self._velocity
direction = dir_symbol
assert self.dim == lb_method.dim, \ assert self.dim == lb_method.dim, \
f"Dimension of UBB ({self.dim}) does not match dimension of method ({lb_method.dim})" f"Dimension of UBB ({self.dim}) does not match dimension of method ({lb_method.dim})"
neighbor_offset = NeighbourOffsetArrays.neighbour_offset(direction, lb_method.stencil) neighbor_offset = NeighbourOffsetArrays.neighbour_offset(dir_symbol, lb_method.stencil)
velocity = tuple(v_i.get_shifted(*neighbor_offset) velocity = tuple(v_i.get_shifted(*neighbor_offset)
if isinstance(v_i, Field.Access) and not vel_from_idx_field if isinstance(v_i, Field.Access) and not vel_from_idx_field
...@@ -193,7 +192,7 @@ class UBB(LbBoundary): ...@@ -193,7 +192,7 @@ class UBB(LbBoundary):
c_s_sq = sp.Rational(1, 3) c_s_sq = sp.Rational(1, 3)
weight_of_direction = LbmWeightInfo.weight_of_direction weight_of_direction = LbmWeightInfo.weight_of_direction
vel_term = 2 / c_s_sq * sum([d_i * v_i for d_i, v_i in zip(neighbor_offset, velocity)]) * weight_of_direction( vel_term = 2 / c_s_sq * sum([d_i * v_i for d_i, v_i in zip(neighbor_offset, velocity)]) * weight_of_direction(
direction, lb_method) dir_symbol, lb_method)
# Better alternative: in conserved value computation # Better alternative: in conserved value computation
# rename what is currently called density to "virtual_density" # rename what is currently called density to "virtual_density"
...@@ -205,12 +204,12 @@ class UBB(LbBoundary): ...@@ -205,12 +204,12 @@ class UBB(LbBoundary):
density_equations = cqc.output_equations_from_pdfs(pdf_field_accesses, {'density': density_symbol}) density_equations = cqc.output_equations_from_pdfs(pdf_field_accesses, {'density': density_symbol})
density_symbol = lb_method.conserved_quantity_computation.defined_symbols()['density'] density_symbol = lb_method.conserved_quantity_computation.defined_symbols()['density']
result = density_equations.all_assignments result = density_equations.all_assignments
result += [Assignment(f_in(inv_dir[direction]), result += [Assignment(f_in(inv_dir[dir_symbol]),
f_out(direction) - vel_term * density_symbol)] f_out(dir_symbol) - vel_term * density_symbol)]
return result return result
else: else:
return [Assignment(f_in(inv_dir[direction]), return [Assignment(f_in(inv_dir[dir_symbol]),
f_out(direction) - vel_term)] f_out(dir_symbol) - vel_term)]
# end class UBB # end class UBB
......
from .mapping import SparseLbBoundaryMapper, SparseLbMapper from .mapping import SparseLbBoundaryMapper, SparseLbMapper, SparseLbPeriodicityMapper, SparseLbCommunicationMapper
from .update_rule_sparse import ( from .update_rule_sparse import (
create_lb_update_rule_sparse, create_macroscopic_value_getter_sparse, create_lb_update_rule_sparse, create_macroscopic_value_getter_sparse,
create_macroscopic_value_setter_sparse, create_symbolic_list) create_macroscopic_value_setter_sparse, create_symbolic_list)
__all__ = ['SparseLbBoundaryMapper', 'SparseLbMapper', 'create_lb_update_rule_sparse', __all__ = ['SparseLbBoundaryMapper', 'SparseLbPeriodicityMapper', 'SparseLbMapper', 'SparseLbCommunicationMapper', 'create_lb_update_rule_sparse',
'create_macroscopic_value_setter_sparse', 'create_macroscopic_value_getter_sparse', 'create_macroscopic_value_setter_sparse', 'create_macroscopic_value_getter_sparse',
'create_symbolic_list'] 'create_symbolic_list']
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.5" "version": "3.8.2"
} }
}, },
"nbformat": 4, "nbformat": 4,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.