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

Import sorting using isort

parent f28c8504
import abc
import sympy as sp
from collections import OrderedDict
from pystencils import Field, Assignment, AssignmentCollection
import sympy as sp
from pystencils import Assignment, AssignmentCollection, Field
class AbstractConservedQuantityComputation(abc.ABC):
......
import itertools
import operator
from collections import OrderedDict
from functools import reduce
from warnings import warn
import sympy as sp
from collections import OrderedDict
from functools import reduce
import operator
import itertools
from lbmpy.maxwellian_equilibrium import (
compressible_to_incompressible_moment_value, get_cumulants_of_continuous_maxwellian_equilibrium,
get_cumulants_of_discrete_maxwellian_equilibrium,
get_moments_of_continuous_maxwellian_equilibrium,
get_moments_of_discrete_maxwellian_equilibrium)
from lbmpy.methods.abstractlbmethod import RelaxationInfo
from lbmpy.methods.conservedquantitycomputation import DensityVelocityComputation
from lbmpy.methods.cumulantbased import CumulantBasedLbMethod
from lbmpy.methods.momentbased import MomentBasedLbMethod
from lbmpy.moments import (
MOMENT_SYMBOLS, discrete_moment, exponents_to_polynomial_representations,
get_default_moment_set_for_stencil, get_order, gram_schmidt, is_even, moments_of_order,
moments_up_to_component_order, sort_moments_into_groups_of_same_order)
from lbmpy.relaxationrates import default_relaxation_rate_names, relaxation_rate_from_magic_number
from lbmpy.stencils import get_stencil
from pystencils.stencil import have_same_entries
from lbmpy.moments import is_even, gram_schmidt, get_default_moment_set_for_stencil, MOMENT_SYMBOLS, \
exponents_to_polynomial_representations, moments_of_order, moments_up_to_component_order, \
sort_moments_into_groups_of_same_order, get_order, discrete_moment
from pystencils.sympyextensions import common_denominator
from lbmpy.methods.conservedquantitycomputation import DensityVelocityComputation
from lbmpy.methods.abstractlbmethod import RelaxationInfo
from lbmpy.maxwellian_equilibrium import get_moments_of_discrete_maxwellian_equilibrium, \
get_moments_of_continuous_maxwellian_equilibrium, get_cumulants_of_discrete_maxwellian_equilibrium, \
get_cumulants_of_continuous_maxwellian_equilibrium, compressible_to_incompressible_moment_value
from lbmpy.relaxationrates import relaxation_rate_from_magic_number, default_relaxation_rate_names
def create_with_discrete_maxwellian_eq_moments(stencil, moment_to_relaxation_rate_dict, compressible=False,
......
import sympy as sp
from collections import OrderedDict
from pystencils import Assignment
from pystencils.sympyextensions import fast_subs, subs_additive
import sympy as sp
from lbmpy.cumulants import cumulant_as_function_of_raw_moments, raw_moment_as_function_of_cumulants
from lbmpy.methods.abstractlbmethod import AbstractLbMethod, LbmCollisionRule, RelaxationInfo
from lbmpy.methods.conservedquantitycomputation import AbstractConservedQuantityComputation
from lbmpy.moments import MOMENT_SYMBOLS, extract_monomials, moment_matrix, monomial_to_polynomial_transformation_matrix
from lbmpy.cumulants import cumulant_as_function_of_raw_moments, raw_moment_as_function_of_cumulants
from lbmpy.moments import (
MOMENT_SYMBOLS, extract_monomials, moment_matrix, monomial_to_polynomial_transformation_matrix)
from pystencils import Assignment
from pystencils.sympyextensions import fast_subs, subs_additive
class CumulantBasedLbMethod(AbstractLbMethod):
......
import sympy as sp
from lbmpy.relaxationrates import get_shear_relaxation_rate
from pystencils import Assignment
from pystencils.sympyextensions import fast_subs
from lbmpy.relaxationrates import get_shear_relaxation_rate
def add_entropy_condition(collision_rule, omega_output_field=None):
......
import sympy as sp
from pystencils import Assignment
from lbmpy.maxwellian_equilibrium import get_weights
from lbmpy.methods.abstractlbmethod import AbstractLbMethod, LbmCollisionRule
from lbmpy.methods.conservedquantitycomputation import DensityVelocityComputation
from pystencils import Assignment
class EntropicEquilibriumSRT(AbstractLbMethod):
......
import sympy as sp
from collections import OrderedDict
from pystencils import Assignment
from pystencils.sympyextensions import subs_additive
import sympy as sp
from lbmpy.methods.abstractlbmethod import AbstractLbMethod, LbmCollisionRule, RelaxationInfo
from lbmpy.methods.conservedquantitycomputation import AbstractConservedQuantityComputation
from lbmpy.moments import MOMENT_SYMBOLS, moment_matrix
from pystencils import Assignment
from pystencils.sympyextensions import subs_additive
class MomentBasedLbMethod(AbstractLbMethod):
......
......@@ -7,7 +7,8 @@ import sympy as sp
from lbmpy.methods.abstractlbmethod import LbmCollisionRule
from pystencils import Assignment
from pystencils.sympyextensions import subs_additive, replace_second_order_products, extract_most_common_factor
from pystencils.sympyextensions import (
extract_most_common_factor, replace_second_order_products, subs_additive)
def replace_second_order_velocity_products(cr: LbmCollisionRule):
......
......@@ -36,15 +36,15 @@ Functions
"""
import itertools
import math
from copy import copy
from collections import Counter, defaultdict
from typing import Iterable, List, Sequence, Tuple, TypeVar, Optional
from copy import copy
from typing import Iterable, List, Optional, Sequence, Tuple, TypeVar
import sympy as sp
from pystencils.cache import memorycache
from pystencils.sympyextensions import remove_higher_order_terms
MOMENT_SYMBOLS = sp.symbols('x y z')
T = TypeVar('T')
......
from collections import namedtuple
import ipywidgets.widgets as widgets
from IPython.display import display
from ipywidgets.widgets import FloatText, Label, VBox, HBox, Select, BoundedFloatText, Button
from lbmpy.relaxationrates import relaxation_rate_from_lattice_viscosity, lattice_viscosity_from_relaxation_rate
from ipywidgets.widgets import BoundedFloatText, Button, FloatText, HBox, Label, Select, VBox
from lbmpy.relaxationrates import (
lattice_viscosity_from_relaxation_rate, relaxation_rate_from_lattice_viscosity)
class ScalingWidget:
......
import sympy as sp
from collections import defaultdict
from pystencils.sympyextensions import multidimensional_sum as multi_sum, normalize_product, prod
from pystencils.fd import functional_derivative, expand_diff_linear, Diff, expand_diff_full
import sympy as sp
from pystencils.fd import Diff, expand_diff_full, expand_diff_linear, functional_derivative
from pystencils.sympyextensions import multidimensional_sum as multi_sum
from pystencils.sympyextensions import normalize_product, prod
order_parameter_symbol_name = "phi"
surface_tension_symbol_name = "tau"
......
import sympy as sp
from lbmpy.maxwellian_equilibrium import get_weights
from lbmpy.methods.creationfunctions import create_from_equilibrium
from lbmpy.stencils import get_stencil
from pystencils.sympyextensions import kronecker_delta, multidimensional_sum
from lbmpy.maxwellian_equilibrium import get_weights
def cahn_hilliard_lb_method(stencil, mu, relaxation_rate=sp.Symbol("omega"), gamma=1):
......
import sympy as sp
from pystencils.cache import disk_cache
from pystencils.cache import disk_cache
# ---------------------------------- Equations of state ----------------------------------------------------------------
from pystencils.sympyextensions import remove_small_floats
......
import sympy as sp
from lbmpy.phasefield.phasefieldstep import PhaseFieldStep
from lbmpy.phasefield.analytical import free_energy_functional_n_phases_penalty_term
from lbmpy.phasefield.phasefieldstep import PhaseFieldStep
from lbmpy.phasefield.scenarios import create_three_phase_model
from pystencils import make_slice
......
import sympy as sp
from pystencils.fd import Diff
from lbmpy.phasefield.eos import free_energy_from_eos
from pystencils.fd import Diff
from pystencils.sympyextensions import remove_small_floats
......
import sympy as sp
from lbmpy.phasefield.analytical import (
chemical_potentials_from_free_energy, force_from_phi_and_mu, force_from_pressure_tensor,
pressure_tensor_bulk_sqrt_term, pressure_tensor_from_free_energy, substitute_laplacian_by_sum,
symmetric_tensor_linearization)
from pystencils import Assignment
from pystencils.fd import Discretization2ndOrder, discretize_spatial
from lbmpy.phasefield.analytical import chemical_potentials_from_free_energy, substitute_laplacian_by_sum, \
force_from_phi_and_mu, symmetric_tensor_linearization, pressure_tensor_from_free_energy, \
force_from_pressure_tensor, pressure_tensor_bulk_sqrt_term
# ---------------------------------- Kernels to compute force ----------------------------------------------------------
......
......@@ -2,13 +2,14 @@
Hierarchy of consistent n-component Cahn-Hilliard systems by Franck Boyer, Sebastian Minjeaud
"""
import sympy as sp
from itertools import combinations
import sympy as sp
import pystencils.fd as fd
from lbmpy.phasefield.analytical import chemical_potentials_from_free_energy
from pystencils.cache import memorycache
from pystencils.fd import Diff
import pystencils.fd as fd
from pystencils.sympyextensions import prod
......
import pyximport
import sympy as sp
from lbmpy.creationfunctions import create_lb_update_rule
from lbmpy.macroscopic_value_kernels import pdf_initialization_assignments
from lbmpy.phasefield.analytical import chemical_potentials_from_free_energy, force_from_phi_and_mu
from lbmpy.phasefield.cahn_hilliard_lbm import cahn_hilliard_lb_method
from lbmpy.phasefield.simplex_projection import simplex_projection_2d # NOQA
from lbmpy.stencils import get_stencil
from pystencils import create_data_handling, Assignment, create_kernel
from pystencils.fd import Diff, expand_diff_full, discretize_spatial
from pystencils import Assignment, create_data_handling, create_kernel
from pystencils.fd import Diff, discretize_spatial, expand_diff_full
from pystencils.fd.derivation import FiniteDifferenceStencilDerivation
import pyximport
pyximport.install(language_level=3)
from lbmpy.phasefield.simplex_projection import simplex_projection_2d # NOQA
def forth_order_isotropic_discretize(field):
......
from types import MappingProxyType
import sympy as sp
import numpy as np
import sympy as sp
from lbmpy.lbstep import LatticeBoltzmannStep
from lbmpy.phasefield.analytical import (
chemical_potentials_from_free_energy, symmetric_tensor_linearization)
from lbmpy.phasefield.cahn_hilliard_lbm import cahn_hilliard_lb_method
from lbmpy.phasefield.kerneleqs import mu_kernel, CahnHilliardFDStep, pressure_tensor_kernel, \
force_kernel_using_pressure_tensor
from pystencils import create_kernel, create_data_handling
from lbmpy.phasefield.analytical import chemical_potentials_from_free_energy, symmetric_tensor_linearization
from lbmpy.phasefield.kerneleqs import (
CahnHilliardFDStep, force_kernel_using_pressure_tensor, mu_kernel, pressure_tensor_kernel)
from pystencils import create_data_handling, create_kernel
from pystencils.boundaries.boundaryhandling import FlagInterface
from pystencils.boundaries.inkernel import add_neumann_boundary
from pystencils.simp import sympy_cse_on_assignment_list
from pystencils.slicing import make_slice, SlicedGetter
from pystencils.slicing import SlicedGetter, make_slice
class PhaseFieldStep:
......
import numpy as np
from lbmpy.creationfunctions import create_lb_function
from lbmpy.macroscopic_value_kernels import pdf_initialization_assignments
from lbmpy.phasefield.analytical import force_from_phi_and_mu
from lbmpy.phasefield.cahn_hilliard_lbm import cahn_hilliard_lb_method
from lbmpy.phasefield.kerneleqs import mu_kernel
from lbmpy.stencils import get_stencil
from pystencils import create_data_handling, Assignment, create_kernel
from pystencils import Assignment, create_data_handling, create_kernel
from pystencils.fd import discretize_spatial
from pystencils.fd.spatial import fd_stencils_forth_order_isotropic
from pystencils.simp import sympy_cse_on_assignment_list
......
from collections import namedtuple
import numpy as np
import warnings
from collections import namedtuple
import numpy as np
TriplePoint = namedtuple("TriplePoint", ['center', 'branch_points', 'angles'])
......
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