Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Holzer
lbmpy
Commits
be4a4290
Commit
be4a4290
authored
Jul 11, 2019
by
Martin Bauer
Browse files
Import sorting using isort
parent
f28c8504
Changes
95
Hide whitespace changes
Inline
Side-by-side
.isort.cfg
0 → 100644
View file @
be4a4290
[settings]
line_length=100
balanced_wrapping=True
multi_line_output=4
lbmpy/boundaries/__init__.py
View file @
be4a4290
from
lbmpy.boundaries.boundaryconditions
import
NoSlip
,
UBB
,
FixedDensity
,
NeumannByCopy
,
StreamInConstant
from
lbmpy.boundaries.boundaryconditions
import
(
UBB
,
FixedDensity
,
NeumannByCopy
,
NoSlip
,
StreamInConstant
)
from
lbmpy.boundaries.boundaryhandling
import
LatticeBoltzmannBoundaryHandling
__all__
=
[
'NoSlip'
,
'UBB'
,
'FixedDensity'
,
'NeumannByCopy'
,
'LatticeBoltzmannBoundaryHandling'
,
'StreamInConstant'
]
lbmpy/boundaries/boundaryconditions.py
View file @
be4a4290
import
sympy
as
sp
from
pystencils
import
Field
,
Assignment
from
lbmpy.boundaries.boundaryhandling
import
BoundaryOffsetInfo
,
LbmWeightInfo
from
lbmpy.simplificationfactory
import
create_simplification_strategy
from
pystencils
import
Assignment
,
Field
from
pystencils.astnodes
import
SympyAssignment
from
pystencils.sympyextensions
import
get_symmetric_part
from
pystencils.data_types
import
create_type
from
lbmpy.simplificationfactory
import
create_simplification_strategy
from
lbmpy.boundaries.boundaryhandling
import
BoundaryOffsetInfo
,
LbmWeightInfo
from
pystencils.sympyextensions
import
get_symmetric_part
class
Boundary
:
...
...
lbmpy/boundaries/boundaryhandling.py
View file @
be4a4290
import
numpy
as
np
import
sympy
as
sp
from
pystencils
import
TypedSymbol
,
create_indexed_kernel
,
Assignment
from
pystencils
import
Assignment
,
TypedSymbol
,
create_indexed_kernel
from
pystencils.backends.cbackend
import
CustomCodeNode
from
pystencils.boundaries
import
BoundaryHandling
from
pystencils.boundaries.boundaryhandling
import
BoundaryOffsetInfo
...
...
lbmpy/chapman_enskog/__init__.py
View file @
be4a4290
from
lbmpy.chapman_enskog.chapman_enskog
import
ChapmanEnskogAnalysis
,
remove_higher_order_u
,
\
take_moments
,
chapman_enskog_ansatz
,
CeM
oment
from
lbmpy.chapman_enskog.chapman_enskog
import
(
CeMoment
,
ChapmanEnskogAnalysis
,
chapman_enskog_ansatz
,
remove_higher_order_u
,
take_m
oment
s
)
from
lbmpy.chapman_enskog.chapman_enskog_steady_state
import
SteadyStateChapmanEnskogAnalysis
__all__
=
[
'ChapmanEnskogAnalysis'
,
'remove_higher_order_u'
,
'take_moments'
,
'chapman_enskog_ansatz'
,
'CeMoment'
,
...
...
lbmpy/chapman_enskog/chapman_enskog.py
View file @
be4a4290
import
sympy
as
sp
from
collections
import
namedtuple
import
sympy
as
sp
from
sympy.core.cache
import
cacheit
from
lbmpy.chapman_enskog.derivative
import
(
chapman_enskog_derivative_expansion
,
chapman_enskog_derivative_recombination
)
from
lbmpy.moments
import
(
discrete_moment
,
get_moment_indices
,
moment_matrix
,
non_aliased_moment
,
polynomial_to_exponent_representation
)
from
pystencils.cache
import
disk_cache
from
pystencils.fd
import
expand_diff_full
,
Diff
,
DiffOperator
,
expand_diff_linear
,
\
expand_diff_products
,
normalize_diff_order
from
pystencils.fd
import
(
Diff
,
DiffOperator
,
expand_diff_full
,
expand_diff_linear
,
expand_diff_products
,
normalize_diff_order
)
from
pystencils.sympyextensions
import
normalize_product
,
symmetric_product
from
lbmpy.moments
import
discrete_moment
,
moment_matrix
,
polynomial_to_exponent_representation
,
get_moment_indices
,
\
non_aliased_moment
from
lbmpy.chapman_enskog.derivative
import
chapman_enskog_derivative_recombination
,
chapman_enskog_derivative_expansion
class
ChapmanEnskogAnalysis
:
...
...
lbmpy/chapman_enskog/chapman_enskog_higher_order.py
View file @
be4a4290
from
collections
import
OrderedDict
,
namedtuple
import
sympy
as
sp
from
lbmpy.chapman_enskog.chapman_enskog
import
CeMoment
,
Diff
,
expanded_symbol
,
take_moments
from
lbmpy.moments
import
moments_of_order
,
moments_up_to_order
from
pystencils.fd
import
expand_diff_full
from
lbmpy.chapman_enskog.chapman_enskog
import
CeMoment
,
Diff
,
take_moments
from
lbmpy.chapman_enskog.chapman_enskog
import
expanded_symbol
from
lbmpy.moments
import
moments_up_to_order
,
moments_of_order
from
collections
import
OrderedDict
,
namedtuple
def
poly_moments
(
order
,
dim
):
...
...
lbmpy/chapman_enskog/chapman_enskog_steady_state.py
View file @
be4a4290
import
sympy
as
sp
import
functools
from
pystencils.fd
import
Diff
,
DiffOperator
,
expand_diff_linear
,
normalize_diff_order
,
\
collect_diffs
from
pystencils.sympyextensions
import
normalize_product
,
multidimensional_sum
,
kronecker_delta
from
lbmpy.chapman_enskog.chapman_enskog
import
LbMethodEqMoments
,
CeMoment
,
take_moments
,
insert_moments
from
lbmpy.chapman_enskog.chapman_enskog
import
expanded_symbol
,
chapman_enskog_ansatz
,
remove_higher_order_u
import
sympy
as
sp
from
lbmpy.chapman_enskog.chapman_enskog
import
(
CeMoment
,
LbMethodEqMoments
,
chapman_enskog_ansatz
,
expanded_symbol
,
insert_moments
,
remove_higher_order_u
,
take_moments
)
from
pystencils.fd
import
(
Diff
,
DiffOperator
,
collect_diffs
,
expand_diff_linear
,
normalize_diff_order
)
from
pystencils.sympyextensions
import
kronecker_delta
,
multidimensional_sum
,
normalize_product
class
SteadyStateChapmanEnskogAnalysis
:
...
...
lbmpy/chapman_enskog/derivative.py
View file @
be4a4290
import
sympy
as
sp
from
pystencils.fd
import
Diff
...
...
lbmpy/creationfunctions.py
View file @
be4a4290
...
...
@@ -163,31 +163,32 @@ For example, to modify the AST one can run::
func = create_lb_function(ast=ast, ...)
"""
import
sympy
as
sp
from
copy
import
copy
import
sympy
as
sp
import
lbmpy.forcemodels
as
forcemodels
from
lbmpy.fieldaccess
import
(
AAEvenTimeStepAccessor
,
AAOddTimeStepAccessor
,
CollideOnlyInplaceAccessor
,
EsoTwistEvenTimeStepAccessor
,
EsoTwistOddTimeStepAccessor
,
PdfFieldAccessor
,
PeriodicTwoFieldsAccessor
,
StreamPullTwoFieldsAccessor
,
StreamPushTwoFieldsAccessor
)
from
lbmpy.methods
import
(
create_mrt3
,
create_mrt_orthogonal
,
create_mrt_raw
,
create_srt
,
create_trt
,
create_trt_kbc
)
from
lbmpy.methods.creationfunctions
import
create_generic_mrt
from
lbmpy.methods.cumulantbased
import
CumulantBasedLbMethod
from
pystencils.cache
import
disk_cache_no_fallback
from
pystencils.data_types
import
collate_types
from
pystencils
import
AssignmentCollection
from
pystencils.field
import
get_layout_of_array
,
Field
from
pystencils
import
create_kernel
,
Assignment
from
lbmpy.turbulence_models
import
add_smagorinsky_model
from
lbmpy.methods
import
create_srt
,
create_trt
,
create_mrt_orthogonal
,
create_trt_kbc
,
\
create_mrt_raw
,
create_mrt3
from
lbmpy.methods.entropic
import
add_iterative_entropy_condition
,
add_entropy_condition
from
lbmpy.methods.entropic
import
add_entropy_condition
,
add_iterative_entropy_condition
from
lbmpy.methods.entropic_eq_srt
import
create_srt_entropic
from
lbmpy.relaxationrates
import
relaxation_rate_from_magic_number
from
lbmpy.simplificationfactory
import
create_simplification_strategy
from
lbmpy.stencils
import
get_stencil
from
lbmpy.turbulence_models
import
add_smagorinsky_model
from
lbmpy.updatekernels
import
create_lbm_kernel
,
create_stream_pull_with_output_kernel
from
pystencils
import
Assignment
,
AssignmentCollection
,
create_kernel
from
pystencils.cache
import
disk_cache_no_fallback
from
pystencils.data_types
import
collate_types
from
pystencils.field
import
Field
,
get_layout_of_array
from
pystencils.simp
import
add_subexpressions_for_field_reads
from
pystencils.stencil
import
have_same_entries
import
lbmpy.forcemodels
as
forcemodels
from
lbmpy.simplificationfactory
import
create_simplification_strategy
from
lbmpy.fieldaccess
import
StreamPullTwoFieldsAccessor
,
PeriodicTwoFieldsAccessor
,
CollideOnlyInplaceAccessor
,
\
EsoTwistEvenTimeStepAccessor
,
EsoTwistOddTimeStepAccessor
,
AAEvenTimeStepAccessor
,
AAOddTimeStepAccessor
,
\
StreamPushTwoFieldsAccessor
,
PdfFieldAccessor
from
lbmpy.updatekernels
import
create_lbm_kernel
,
create_stream_pull_with_output_kernel
def
create_lb_function
(
ast
=
None
,
optimization
=
{},
**
kwargs
):
...
...
lbmpy/cumulants.py
View file @
be4a4290
...
...
@@ -8,8 +8,7 @@ import sympy as sp
from
lbmpy.continuous_distribution_measures
import
multi_differentiation
from
lbmpy.moments
import
moments_up_to_component_order
from
pystencils.cache
import
memorycache
from
pystencils.sympyextensions
import
fast_subs
from
pystencils.sympyextensions
import
scalar_product
from
pystencils.sympyextensions
import
fast_subs
,
scalar_product
def
__get_indexed_symbols
(
passed_symbols
,
prefix
,
indices
):
...
...
lbmpy/fieldaccess.py
View file @
be4a4290
import
sympy
as
sp
import
abc
from
pystencils.stencil
import
inverse_direction
from
pystencils
import
Field
import
sympy
as
sp
from
pystencils
import
Field
# ------------------------------------------------ Interface -----------------------------------------------------------
from
pystencils.astnodes
import
LoopOverCoordinate
from
pystencils.stencil
import
inverse_direction
__all__
=
[
'PdfFieldAccessor'
,
'CollideOnlyInplaceAccessor'
,
'StreamPullTwoFieldsAccessor'
,
'AAEvenTimeStepAccessor'
,
'AAOddTimeStepAccessor'
,
...
...
@@ -10,10 +13,6 @@ __all__ = ['PdfFieldAccessor', 'CollideOnlyInplaceAccessor', 'StreamPullTwoField
'visualize_pdf_field_accessor'
,
'visualize_field_mapping'
]
# ------------------------------------------------ Interface -----------------------------------------------------------
from
pystencils.astnodes
import
LoopOverCoordinate
class
PdfFieldAccessor
:
"""
Defines how data is read and written in an LBM time step.
...
...
@@ -24,6 +23,7 @@ class PdfFieldAccessor:
- esoteric twist single field update
-
"""
@
abc
.
abstractmethod
def
read
(
self
,
field
,
stencil
):
"""Returns sequence of field accesses for all stencil values where pdfs are read from"""
...
...
lbmpy/forcemodels.py
View file @
be4a4290
...
...
@@ -87,6 +87,7 @@ second moment nonzero :class:`Luo` :class:`Guo`
"""
import
sympy
as
sp
from
lbmpy.relaxationrates
import
get_shear_relaxation_rate
...
...
lbmpy/geometry.py
View file @
be4a4290
import
numpy
as
np
from
lbmpy.boundaries
import
NoSlip
,
UBB
from
pystencils.slicing
import
normalize_slice
,
shift_slice
,
slice_intersection
,
slice_from_direction
from
lbmpy.boundaries
import
UBB
,
NoSlip
from
pystencils.slicing
import
(
normalize_slice
,
shift_slice
,
slice_from_direction
,
slice_intersection
)
def
add_box_boundary
(
boundary_handling
,
boundary
=
NoSlip
(),
replace
=
True
):
...
...
lbmpy/innerloopsplit.py
View file @
be4a4290
import
sympy
as
sp
from
collections
import
defaultdict
from
pystencils
import
Field
import
sympy
as
sp
from
lbmpy.methods.abstractlbmethod
import
LbmCollisionRule
from
pystencils
import
Field
def
create_lbm_split_groups
(
cr
:
LbmCollisionRule
,
opposing_directions
=
True
):
...
...
lbmpy/lbstep.py
View file @
be4a4290
from
types
import
MappingProxyType
import
numpy
as
np
from
lbmpy.boundaries.boundaryhandling
import
LatticeBoltzmannBoundaryHandling
from
lbmpy.creationfunctions
import
switch_to_symbolic_relaxation_rates_for_omega_adapting_methods
,
\
create_lb_function
,
update_with_default_parameters
from
lbmpy.macroscopic_value_kernels
import
create_advanced_velocity_setter_collision_rule
,
\
pdf_initialization_assignments
from
lbmpy.creationfunctions
import
(
create_lb_function
,
switch_to_symbolic_relaxation_rates_for_omega_adapting_methods
,
update_with_default_parameters
)
from
lbmpy.macroscopic_value_kernels
import
(
create_advanced_velocity_setter_collision_rule
,
pdf_initialization_assignments
)
from
lbmpy.simplificationfactory
import
create_simplification_strategy
from
lbmpy.stencils
import
get_stencil
from
pystencils
import
create_
kernel
,
make_slice
,
create_data_handling
from
pystencils
import
create_
data_handling
,
create_kernel
,
make_slice
from
pystencils.slicing
import
SlicedGetter
from
pystencils.timeloop
import
TimeLoop
...
...
lbmpy/macroscopic_value_kernels.py
View file @
be4a4290
import
functools
from
copy
import
deepcopy
from
pystencils.field
import
Field
,
get_layout_of_array
from
lbmpy.simplificationfactory
import
create_simplification_strategy
from
pystencils.field
import
Field
,
get_layout_of_array
def
pdf_initialization_assignments
(
lb_method
,
density
,
velocity
,
pdfs
):
...
...
lbmpy/max_domain_size_info.py
View file @
be4a4290
...
...
@@ -23,9 +23,10 @@ Examples:
"""
import
numpy
as
np
import
warnings
import
numpy
as
np
# Optional packages cpuinfo, pycuda and psutil for hardware queries
try
:
from
cpuinfo
import
get_cpu_info
...
...
lbmpy/methods/__init__.py
View file @
be4a4290
from
lbmpy.methods.momentbased
import
RelaxationInfo
,
AbstractLbMethod
,
AbstractConservedQuantityComputation
,
\
MomentBasedLbMethod
from
lbmpy.methods.creationfunctions
import
(
create_mrt3
,
create_mrt_orthogonal
,
create_mrt_raw
,
create_srt
,
create_trt
,
create_trt_kbc
,
create_trt_with_magic_number
,
create_with_continuous_maxwellian_eq_moments
,
create_with_discrete_maxwellian_eq_moments
)
from
lbmpy.methods.momentbased
import
(
AbstractConservedQuantityComputation
,
AbstractLbMethod
,
MomentBasedLbMethod
,
RelaxationInfo
)
from
.conservedquantitycomputation
import
DensityVelocityComputation
from
lbmpy.methods.creationfunctions
import
create_srt
,
create_trt
,
create_trt_with_magic_number
,
create_trt_kbc
,
\
create_mrt_orthogonal
,
create_mrt_raw
,
create_mrt3
,
\
create_with_continuous_maxwellian_eq_moments
,
create_with_discrete_maxwellian_eq_moments
__all__
=
[
'RelaxationInfo'
,
'AbstractLbMethod'
,
'AbstractConservedQuantityComputation'
,
'DensityVelocityComputation'
,
'MomentBasedLbMethod'
,
...
...
lbmpy/methods/abstractlbmethod.py
View file @
be4a4290
import
abc
import
sympy
as
sp
from
collections
import
namedtuple
from
pystencils
import
AssignmentCollection
import
sympy
as
sp
from
pystencils
import
AssignmentCollection
RelaxationInfo
=
namedtuple
(
'RelaxationInfo'
,
[
'equilibrium_value'
,
'relaxation_rate'
])
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment