Commit be4a4290 authored by Martin Bauer's avatar Martin Bauer
Browse files

Import sorting using isort

parent f28c8504
import sympy as sp
import numpy as np
import warnings
import numpy as np
import sympy as sp
from lbmpy.phasefield.analytical import (
free_energy_functional_3_phases, free_energy_functional_n_phases,
free_energy_functional_n_phases_penalty_term, symbolic_order_parameters)
from lbmpy.phasefield.phasefieldstep import PhaseFieldStep
from lbmpy.phasefield.analytical import free_energy_functional_3_phases, free_energy_functional_n_phases, \
symbolic_order_parameters, free_energy_functional_n_phases_penalty_term
def create_three_phase_model(alpha=1, kappa=(0.015, 0.015, 0.015), include_rho=True, **kwargs):
......
......@@ -3,11 +3,12 @@ Method to construct a quadratic equilibrium using a generic quadratic ansatz acc
Wolf-Gladrow, section 5.4
"""
import sympy as sp
import numpy as np
from pystencils.sympyextensions import scalar_product
from lbmpy.moments import discrete_moment
import sympy as sp
from lbmpy.maxwellian_equilibrium import compressible_to_incompressible_moment_value
from lbmpy.moments import discrete_moment
from pystencils.sympyextensions import scalar_product
def generic_equilibrium_ansatz(stencil, u=sp.symbols("u_:3")):
......
import sympy as sp
from lbmpy.moments import is_shear_moment, get_order
from lbmpy.moments import get_order, is_shear_moment
def relaxation_rate_from_lattice_viscosity(nu):
......
......@@ -26,11 +26,12 @@ at :mod:`lbmpy.creationfunctions`. The only mandatory keyword parameter is ``rel
that defines the viscosity of the fluid (valid values being between 0 and 2).
"""
import numpy as np
from lbmpy.geometry import add_pipe_walls, add_pipe_inflow_boundary
from lbmpy.boundaries import UBB, FixedDensity, NoSlip
from lbmpy.geometry import add_pipe_inflow_boundary, add_pipe_walls
from lbmpy.lbstep import LatticeBoltzmannStep
from pystencils.datahandling import create_data_handling
from pystencils.slicing import slice_from_direction
from lbmpy.boundaries import NoSlip, UBB, FixedDensity
def create_fully_periodic_flow(initial_velocity, periodicity_in_kernel=False, lbm_kernel=None,
......
from pystencils.sympy_gmpy_bug_workaround import *
import pystencils as ps
import sympy as sp
import numpy as np
from lbmpy.scenarios import *
from lbmpy.creationfunctions import *
from pystencils import make_slice, show_code
import sympy as sp
import lbmpy.plot as plt
import pystencils as ps
from lbmpy.boundaries import *
from lbmpy.postprocessing import *
from lbmpy.lbstep import LatticeBoltzmannStep
from lbmpy.creationfunctions import *
from lbmpy.geometry import *
from lbmpy.lbstep import LatticeBoltzmannStep
from lbmpy.parameterization import ScalingWidget
import lbmpy.plot as plt
from lbmpy.postprocessing import *
from lbmpy.scenarios import *
from pystencils import make_slice, show_code
from pystencils.jupyter import *
from pystencils.sympy_gmpy_bug_workaround import *
import sympy as sp
from lbmpy.innerloopsplit import create_lbm_split_groups
from lbmpy.methods.cumulantbased import CumulantBasedLbMethod
from pystencils.simp import apply_to_all_assignments, \
subexpression_substitution_in_main_assignments, sympy_cse, add_subexpressions_for_divisions
from pystencils.simp import (
add_subexpressions_for_divisions, apply_to_all_assignments,
subexpression_substitution_in_main_assignments, sympy_cse)
def create_simplification_strategy(lb_method, cse_pdfs=False, cse_global=False, split_inner_loop=False):
......
from .mapping import SparseLbBoundaryMapper, SparseLbMapper
from .update_rule_sparse import create_lb_update_rule_sparse, create_macroscopic_value_getter_sparse, \
create_macroscopic_value_setter_sparse, create_symbolic_list
from .update_rule_sparse import (
create_lb_update_rule_sparse, create_macroscopic_value_getter_sparse,
create_macroscopic_value_setter_sparse, create_symbolic_list)
__all__ = ['SparseLbBoundaryMapper', 'SparseLbMapper', 'create_lb_update_rule_sparse',
'create_macroscopic_value_setter_sparse', 'create_macroscopic_value_getter_sparse',
......
import sympy as sp
import numpy as np
from typing import Tuple
import numpy as np
import sympy as sp
from lbmpy.boundaries.boundaryhandling import LbmWeightInfo
from pystencils import Field, TypedSymbol, Assignment
from pystencils import Assignment, Field, TypedSymbol
from pystencils.boundaries.boundaryhandling import BoundaryOffsetInfo
from pystencils.boundaries.createindexlist import create_boundary_index_list, boundary_index_array_coordinate_names, \
direction_member_name
from pystencils.boundaries.createindexlist import (
boundary_index_array_coordinate_names, create_boundary_index_list, direction_member_name)
class SparseLbMapper:
......
from pystencils import AssignmentCollection, Assignment
from pystencils.field import Field, FieldType
from pystencils import Assignment, AssignmentCollection
# noinspection PyProtectedMember
from pystencils.field import compute_strides
from pystencils.field import Field, FieldType, compute_strides
AC = AssignmentCollection
......
import sympy as sp
from pystencils import Assignment
from lbmpy.relaxationrates import get_shear_relaxation_rate
from pystencils import Assignment
def second_order_moment_tensor(function_values, stencil):
......
import numpy as np
import sympy as sp
from pystencils import Field, Assignment, AssignmentCollection
from lbmpy.fieldaccess import StreamPullTwoFieldsAccessor
from lbmpy.methods.abstractlbmethod import LbmCollisionRule
from pystencils import Assignment, AssignmentCollection, Field
from pystencils.field import create_numpy_array_with_layout, layout_string_to_tuple
from pystencils.simp import add_subexpressions_for_field_reads
from pystencils.sympyextensions import fast_subs
from lbmpy.methods.abstractlbmethod import LbmCollisionRule
from lbmpy.fieldaccess import StreamPullTwoFieldsAccessor
# -------------------------------------------- LBM Kernel Creation -----------------------------------------------------
......
"""Function to process benchmark results in pandas."""
from pystencils.runhelper.db import remove_constant_columns, Database
from pystencils.runhelper.db import Database, remove_constant_columns
db = None
......
import pytest
from statistics import median
import numpy as np
import pytest
import sympy as sp
from lbmpy.scenarios import create_lid_driven_cavity
from pystencils.runhelper import ParameterStudy
from statistics import median
from pystencils.cpu.cpujit import add_or_change_compiler_flags
from pystencils.runhelper import ParameterStudy
def parameter_filter(parameters):
......
......@@ -4,12 +4,13 @@ Boesch, Chikatamarla, Karlin: Entropic multirelaxation lattice Boltzmann models
"""
import numpy as np
import sympy as sp
import pystencils as ps
from lbmpy.lbstep import LatticeBoltzmannStep
from lbmpy.relaxationrates import relaxation_rate_from_lattice_viscosity, relaxation_rate_from_magic_number
from lbmpy.relaxationrates import (
relaxation_rate_from_lattice_viscosity, relaxation_rate_from_magic_number)
from pystencils.runhelper import ParameterStudy
# --------------------------------------------- Setup ------------------------------------------------------------------
......@@ -288,4 +289,3 @@ def create_full_parameter_study(gpu=False):
if __name__ == '__main__':
parameter_study = create_full_parameter_study(gpu=True)
parameter_study.run_from_command_line()
......@@ -8,8 +8,10 @@ The deficiencies of the D3Q19 model can be resolved by choosing a better equilib
"""
import os
import sys
import numpy as np
import sympy as sp
from lbmpy.boundaries import FixedDensity, NoSlip
from lbmpy.geometry import add_pipe_inflow_boundary, add_pipe_walls
from lbmpy.lbstep import LatticeBoltzmannStep
......
......@@ -5,8 +5,10 @@ a cylinder. In Flow simulation with high-performance computers II (pp. 547-566).
- boundaries are not set correctly yet (halfway-bounce back is not considered)
"""
import numpy as np
import warnings
import numpy as np
from lbmpy.boundaries.boundaryconditions import NoSlip
from lbmpy.geometry import get_pipe_velocity_field
from lbmpy.relaxationrates import relaxation_rate_from_lattice_viscosity
......
......@@ -6,9 +6,11 @@
"""
import numpy as np
import sympy as sp
from lbmpy.scenarios import create_fully_periodic_flow
from lbmpy.relaxationrates import relaxation_rate_from_lattice_viscosity, relaxation_rate_from_magic_number
from lbmpy.creationfunctions import update_with_default_parameters
from lbmpy.relaxationrates import (
relaxation_rate_from_lattice_viscosity, relaxation_rate_from_magic_number)
from lbmpy.scenarios import create_fully_periodic_flow
def get_exponent_term(l, **kwargs):
......
......@@ -12,10 +12,9 @@ python3 scenario_square_channel.py client --host i10staff41 -P '{ "optimization"
import numpy as np
import sympy as sp
from pystencils import make_slice
from lbmpy.scenarios import create_channel
from lbmpy.methods.creationfunctions import relaxation_rate_from_magic_number
from lbmpy.scenarios import create_channel
from pystencils import make_slice
defaultParameters = {
'stencil': 'D3Q19',
......
import itertools
from pystencils.sympyextensions import kronecker_delta as kd
......
......@@ -4,8 +4,10 @@ more stable. Mathematically they should be equivalent.
This test ensures that the complicated pressure tensor formulation yields the same force as computed directly."""
import sympy as sp
from lbmpy.phasefield.analytical import chemical_potentials_from_free_energy, substitute_laplacian_by_sum, \
pressure_tensor_interface_component_new, force_from_pressure_tensor, force_from_phi_and_mu
from lbmpy.phasefield.analytical import (
chemical_potentials_from_free_energy, force_from_phi_and_mu, force_from_pressure_tensor,
pressure_tensor_interface_component_new, substitute_laplacian_by_sum)
from pystencils.fd import Diff, expand_diff_full, normalize_diff_order
......@@ -34,4 +36,4 @@ def force_computation_equivalence(dim=3, num_phases=4):
if __name__ == '__main__':
force_computation_equivalence()
\ No newline at end of file
force_computation_equivalence()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment