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
from collections import defaultdict
import numpy as np
import sympy as sp
from lbmpy.phasefield.nphase_nestler import create_model
......@@ -44,4 +46,3 @@ def test_main():
res = run(100)
assert np.isfinite(np.max(res))
import numpy as np
from functools import partial
from lbmpy.phasefield.analytical import n_phases_correction_function, analytic_interface_profile, \
n_phases_correction_function_sign_switch
import numpy as np
from lbmpy.phasefield.analytical import (
analytic_interface_profile, n_phases_correction_function,
n_phases_correction_function_sign_switch)
from lbmpy.phasefield.experiments1D import init_sharp_interface
from lbmpy.phasefield.scenarios import create_n_phase_model
from pystencils import create_data_handling, make_slice
......
import numpy as np
from functools import partial
from lbmpy.phasefield.analytical import n_phases_correction_function, n_phases_correction_function_sign_switch
from time import time
import numpy as np
from lbmpy.phasefield.analytical import (
n_phases_correction_function, n_phases_correction_function_sign_switch)
from lbmpy.phasefield.contact_angle_circle_fitting import liquid_lens_neumann_angles
from lbmpy.phasefield.post_processing import analytic_neumann_angles
from lbmpy.phasefield.scenarios import create_n_phase_model, create_three_phase_model
from pystencils import create_data_handling, make_slice
from pystencils.runhelper import ParameterStudy
from time import time
from pystencils.utils import boolean_array_bounding_box
color = {'yellow': '\033[93m',
......@@ -215,5 +217,3 @@ def main():
if __name__ == '__main__':
main()
import numpy as np
from pystencils import make_slice, create_data_handling
from lbmpy.creationfunctions import create_lb_function
from lbmpy.boundaries import UBB, NeumannByCopy, NoSlip, StreamInConstant
from lbmpy.boundaries.boundaryhandling import LatticeBoltzmannBoundaryHandling
from lbmpy.boundaries import NoSlip, UBB, StreamInConstant, NeumannByCopy
from lbmpy.lbstep import LatticeBoltzmannStep
from lbmpy.creationfunctions import create_lb_function
from lbmpy.geometry import add_box_boundary
from lbmpy.lbstep import LatticeBoltzmannStep
from pystencils import create_data_handling, make_slice
def test_simple():
......
import numpy as np
import pystencils.boundaries.createindexlist as cil
from lbmpy.stencils import get_stencil
......
import numpy as np
from lbmpy.geometry import get_shear_flow_velocity_field
from lbmpy.scenarios import create_fully_periodic_flow
......
import functools
import pytest
import sympy as sp
import functools
from pystencils.fd import Diff, normalize_diff_order
from pystencils.sympyextensions import multidimensional_sum
from lbmpy.chapman_enskog.chapman_enskog_higher_order import determine_higher_order_moments, get_solvability_conditions
from lbmpy.chapman_enskog.chapman_enskog_steady_state import SteadyStateChapmanEnskogAnalysisSRT, \
SteadyStateChapmanEnskogAnalysis
from lbmpy.chapman_enskog.chapman_enskog import ChapmanEnskogAnalysis, LbMethodEqMoments, take_moments, \
get_taylor_expanded_lb_equation, chapman_enskog_ansatz
from lbmpy.relaxationrates import lattice_viscosity_from_relaxation_rate
from lbmpy.chapman_enskog.chapman_enskog import (
ChapmanEnskogAnalysis, LbMethodEqMoments, chapman_enskog_ansatz,
get_taylor_expanded_lb_equation, take_moments)
from lbmpy.chapman_enskog.chapman_enskog_higher_order import (
determine_higher_order_moments, get_solvability_conditions)
from lbmpy.chapman_enskog.chapman_enskog_steady_state import (
SteadyStateChapmanEnskogAnalysis, SteadyStateChapmanEnskogAnalysisSRT)
from lbmpy.creationfunctions import create_lb_method
from lbmpy.forcemodels import Guo
from lbmpy.relaxationrates import lattice_viscosity_from_relaxation_rate
from pystencils.fd import Diff, normalize_diff_order
from pystencils.sympyextensions import multidimensional_sum
def test_srt():
......
from hashlib import sha256
from lbmpy.creationfunctions import create_lb_ast
from pystencils.backends.cbackend import generate_c
from pystencils.llvm.llvmjit import generate_llvm
from lbmpy.creationfunctions import create_lb_ast
def test_hash_equivalence():
......@@ -10,7 +11,7 @@ def test_hash_equivalence():
exactly the same code (not only functionally equivalent code) should be produced.
Due to undefined order in sets and dicts this may no be the case.
"""
ref_value = "bd20ebb3cb8ca2aa00128a0920c5c0fa5b1b15251111e5695c1759fe29849743"
ref_value = "2cde9763ab71a9d5caba056e6d0011e553fa01ab71668ee32024ce3f68e7d698"
ast = create_lb_ast(stencil='D3Q19', method='srt', optimization={'openmp': False})
code = generate_c(ast)
hash_value = sha256(code.encode()).hexdigest()
......
......@@ -2,15 +2,17 @@
The update equations should not change if a relaxation rate of a conserved quantity (density/velocity)
changes. This test checks that for moment-based methods
"""
from copy import copy
import pytest
import sympy as sp
from copy import copy
from lbmpy.methods.creationfunctions import create_srt, create_trt, create_trt_kbc, RelaxationInfo
from lbmpy.methods.creationfunctions import RelaxationInfo, create_srt, create_trt, create_trt_kbc
from lbmpy.methods.cumulantbased import CumulantBasedLbMethod
from lbmpy.methods.momentbased import MomentBasedLbMethod
from lbmpy.moments import MOMENT_SYMBOLS
from lbmpy.simplificationfactory import create_simplification_strategy
from lbmpy.stencils import get_stencil
from lbmpy.moments import MOMENT_SYMBOLS
def __change_relaxation_rate_of_conserved_moments(method, new_relaxation_rate=sp.Symbol("test_omega")):
......
import pytest
import numpy as np
from copy import deepcopy
import numpy as np
import pytest
from lbmpy.scenarios import create_channel
......
from lbmpy.creationfunctions import create_lb_method
from lbmpy.moments import discrete_moment, exponents_to_polynomial_representations, \
exponent_to_polynomial_representation
from lbmpy.stencils import get_stencil
from lbmpy.cumulants import *
from lbmpy.moments import (
discrete_moment, exponent_to_polynomial_representation, exponents_to_polynomial_representations)
from lbmpy.stencils import get_stencil
def test_cumulants_from_pdfs():
......
import numpy as np
import sympy as sp
from lbmpy.forcemodels import Guo
from lbmpy.methods.entropic_eq_srt import create_srt_entropic
from lbmpy.scenarios import create_lid_driven_cavity
......
from pystencils import show_code
from lbmpy.scenarios import create_lid_driven_cavity
from lbmpy.creationfunctions import create_lb_function
from lbmpy.scenarios import create_lid_driven_cavity
from pystencils import show_code
def test_creation():
......
import numpy as np
from pystencils import make_slice
from lbmpy.boundaries import NoSlip, UBB
from lbmpy.boundaries import UBB, NoSlip
from lbmpy.scenarios import create_channel
from pystencils import make_slice
try:
import waLBerla as wLB
......
import numpy as np
import os
import numpy as np
from lbmpy.boundaries import NoSlip
from lbmpy.geometry import add_black_and_white_image, add_pipe_walls
from lbmpy.lbstep import LatticeBoltzmannStep
from pystencils.slicing import make_slice
from lbmpy.geometry import add_pipe_walls, add_black_and_white_image
from lbmpy.boundaries import NoSlip
def test_pipe():
......
from lbmpy.creationfunctions import create_lb_method
from lbmpy.methods.creationfunctions import compare_moment_based_lb_methods
from lbmpy.moments import moment_equality_table_by_stencil, moment_equality_table, moments_up_to_component_order
from lbmpy.moments import (
moment_equality_table, moment_equality_table_by_stencil, moments_up_to_component_order)
from lbmpy.stencils import get_stencil
......
import pytest
import numpy as np
from lbmpy.scenarios import create_lid_driven_cavity, create_fully_periodic_flow
import pytest
from lbmpy.scenarios import create_fully_periodic_flow, create_lid_driven_cavity
try:
import pycuda.driver
......
import numpy as np
from lbmpy.creationfunctions import create_lb_method
from lbmpy.macroscopic_value_kernels import compile_macroscopic_values_getter, compile_macroscopic_values_setter
from lbmpy.macroscopic_value_kernels import (
compile_macroscopic_values_getter, compile_macroscopic_values_setter)
def test_set_get_density_velocity_with_fields():
......@@ -51,4 +53,3 @@ def test_set_get_constant_velocity():
computed_velocity = velocity_output_field[0, 0, 0, :]
np.testing.assert_almost_equal(np.array(ref_velocity[:method.dim]), computed_velocity)
from lbmpy.cumulants import raw_moment_as_function_of_cumulants
from lbmpy.maxwellian_equilibrium import *
from lbmpy.moments import MOMENT_SYMBOLS, moments_up_to_order, moments_up_to_component_order, moment_matrix, \
exponents_to_polynomial_representations
from lbmpy.moments import (
MOMENT_SYMBOLS, exponents_to_polynomial_representations, moment_matrix,
moments_up_to_component_order, moments_up_to_order)
from lbmpy.stencils import get_stencil
from lbmpy.cumulants import raw_moment_as_function_of_cumulants
from pystencils.sympyextensions import remove_higher_order_terms
......
......@@ -4,11 +4,12 @@ This test checks if the equilibrium formula obtained by this method is the same
given discrete_maxwellian_equilibrium
"""
import sympy as sp
from lbmpy.methods import create_srt, create_trt, create_mrt_orthogonal
from lbmpy.creationfunctions import create_lb_method
from lbmpy.maxwellian_equilibrium import discrete_maxwellian_equilibrium
from lbmpy.methods import create_mrt_orthogonal, create_srt, create_trt
from lbmpy.relaxationrates import get_shear_relaxation_rate
from lbmpy.stencils import get_stencil
from lbmpy.creationfunctions import create_lb_method
def check_for_matching_equilibrium(method_name, stencil, compressibility):
......
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