block
expression_statement
string
string_start "\"\"\""
string_content "Returns LB node(s) relevant for interpolation around the giv"...
string_end "\"\"\""
comment "# helper to get lb node from index with folding"
function_definition (+26 nodes collapsed)
comment "# center of first lb lattice point is at 0.5 in each Cartesi"...
comment "# determine position in lb units for 3 cases;"
comment "# unshifted, lees-edwards shifted to the left and to the rig"...
expression_statement
assignment
identifier "pos_unshifted_lb_units"
= "="
binary_operator
binary_operator
identifier "folded_pos"
/ "/"
attribute
identifier "lbf"
. "."
identifier "agrid"
- "-"
float "0.5"
comment "# relative to node centers"
expression_statement
assignment
identifier "shear_vec"
= "="
call
identifier "unit_vec"
argument_list
( "("
identifier "shear_direction"
) ")"
expression_statement (+23 nodes collapsed)
expression_statement (+23 nodes collapsed)
comment "# Particle couples to its 8 neighboring lattice sites"
comment "# when a particle is at a lattice site in any coordinate,"
comment "# the right hand side neighbor is included"
comment "# but the coupling weight for that neighbor is 0"
comment "# find the lower left lb node to which the particle couples"
expression_statement (+26 nodes collapsed)
expression_statement (+26 nodes collapsed)
expression_statement (+26 nodes collapsed)
expression_statement (+36 nodes collapsed)
expression_statement
assignment
identifier "indices_unshifted"
= "="
list_comprehension
[ "["
binary_operator
identifier "lower_idx_unshifted"
+ "+"
identifier "ijk"
for_in_clause
for "for"
identifier "ijk"
in "in"
identifier "ijks"
] "]"
comment "# Nodes with an index within the primary box in shear_plane_"...
comment "# do not need Lees-Edwards handling"
expression_statement (+34 nodes collapsed)
expression_statement
assignment
identifier "unshifted_nodes"
= "="
list_comprehension
[ "["
call
identifier "lb_node"
argument_list
( "("
identifier "idx"
) ")"
for_in_clause
for "for"
identifier "idx"
in "in"
identifier "dont_need_shift"
] "]"
expression_statement (+25 nodes collapsed)
comment "# Handle indices which are not in the primary box in the she"...
comment "# normal"
expression_statement (+45 nodes collapsed)
expression_statement (+38 nodes collapsed)
comment "# replace the index in shear direction"
expression_statement
assignment
identifier "shifted_left"
= "="
call
attribute
identifier "copy"
. "."
identifier "deepcopy"
argument_list
( "("
identifier "to_be_shifted_left"
) ")"
for_statement (+31 nodes collapsed)
expression_statement
assignment
identifier "shifted_right"
= "="
call
attribute
identifier "copy"
. "."
identifier "deepcopy"
argument_list
( "("
identifier "to_be_shifted_right"
) ")"
for_statement (+31 nodes collapsed)
expression_statement (+28 nodes collapsed)
expression_statement (+28 nodes collapsed)
expression_statement (+27 nodes collapsed)
expression_statement
assignment
identifier "shifted_weights"
= "="
binary_operator
identifier "weights_shifted_left"
+ "+"
identifier "weights_shifted_right"
expression_statement (+23 nodes collapsed)
assert_statement
assert "assert"
comparison_operator
call
identifier "len"
argument_list
( "("
binary_operator
identifier "shifted_nodes"
+ "+"
identifier "unshifted_nodes"
) ")"
== "=="
integer "8"
assert_statement
assert "assert"
comparison_operator
call
identifier "len"
argument_list
( "("
call
identifier "set"
argument_list
( "("
binary_operator
identifier "shifted_nodes"
+ "+"
identifier "unshifted_nodes"
) ")"
) ")"
== "=="
integer "8"
comment "# no duplicates"
return_statement
return "return"
expression_list
identifier "unshifted_nodes"
, ","
identifier "shifted_nodes"
, ","
identifier "unshifted_weights"
, ","
identifier "shifted_weights"