kirchhoff modules¶
kirchhoff.circuit_init¶
- class kirchhoff.circuit_init.Circuit(G: networkx.classes.graph.Graph = <factory>, info: str = 'unknown')[source]¶
Bases:
objectA class of linear circuits (for lumped parameter modelling).
scales (dictionary):
A dictionary holding the unit system.
graph (dictionary):
A dictionary holding circuit initial conditions.
nodes (pd.DataFrame):
A container for node data.
edges (pd.DataFrame):
A container for edge data.
draw_weight_scaling (float):
Standard wights for drawing.
- calc_root_incidence()[source]¶
Find the incidence for a system with binary-type periphehal nodes.
- Returns:
list:
A list of nodes adjacent to the source.
list:
A list of nodes adjacent to the sink.
- clipp_graph()[source]¶
Prune the internal graph and generate a new internal variable represting the pruned based on an interanl threshold value.
- default_init()[source]¶
Initialize the default setting of a circuit, by taking a networkx graph and setting containers
- get_edges_data(*args)[source]¶
Get internal nodal DataFrame columns by keywords.
- Args:
args (list):
A list of keywords to check for in the internal DataFrames.
- Returns:
pd.DataFrame: A cliced DataFrame.
- Raises:
Exception: description
- get_incidence_matrices()[source]¶
Get the incidence matrices from the internal graph objects.
- Returns:
ndarray:
A internal circuit graph’s incidence matrix.
ndarray.T:
A internal circuit graph’s incidence matrix, transposed.
- get_nodes_data(*args)[source]¶
Get internal nodal DataFrame columns by keywords.
- Args:
args (list):
A list of keywords to check for in the internal DataFrames.
- Returns:
pd.DataFrame: A cliced DataFrame.
- Raises:
Exception: description
- get_pos()[source]¶
Getting positions of the vertices from the internal graphs.
- Returns:
dictionary:
A dictionary holding nodes and their positions in euclidean space.
- plot_circuit(*args, **kwargs)[source]¶
Use Plotly.GraphObjects to create interactive plots that have optionally the graph atributes displayed.
- Args:
args (list):
A list of keywords for the internal edge and nodal DataFrames which are to be displayed.
kwargs (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
GraphObject.Figure: A plotly figure displaying the circuit.
- set_graph_pars(new_parameters)[source]¶
Set a circuit boundary conditions.
- Args:
new_parameters (dictionary):
A new set of conditions to bet set.
- set_pos(pos_data={})[source]¶
Set the postions of the internal graph.
- Args:
pos_data (dictionary):
A dictionary of nodal positions.
- set_scale_pars(new_parameters)[source]¶
Set a new internal unit system.
- Args:
new_parameters (dictionary):
A new set of units to bet set.
kirchhoff.circuit_flow¶
- class kirchhoff.circuit_flow.FlowCircuit(G: networkx.classes.graph.Graph = <factory>, info: str = 'unknown', source_mode: dict = <factory>, plexus_mode: dict = <factory>)[source]¶
Bases:
kirchhoff.circuit_init.CircuitA derived class for flow circuits.
source_mode (dictionary):
A dictionary of custom source-sink boundaries.
plexus_mode (dictionary):
A dictionary of custom plexus initializations.
- get_edges_data(*args)[source]¶
Get internal nodal DataFrame columns by keywords.
- Args:
args (list):
A list of keywords to check for in the internal DataFrames.
- Returns:
pd.DataFrame: A cliced DataFrame.
- get_nodes_data(*args)[source]¶
Get internal nodal DataFrame columns by keywords.
- Args:
args (list):
A list of keywords to check for in the internal DataFrames.
- Returns:
pd.DataFrame: A cliced DataFrame.
- init_source_dipole_border()[source]¶
Set sources on one side of the graph, sinks on the opposing side.
- init_source_dipole_wall()[source]¶
Set sources on one side of the graph, sinks on the opposing side.
- init_source_root_central_geometric()[source]¶
Set one geometrically central source, sinks otherwise.
- plot_circuit(*args, **kwargs)[source]¶
Use Plotly.GraphObjects to create interactive plots that have optionally the graph atributes displayed.
- Args:
args (list):
A list of keywords for the internal edge and nodal DataFrames which are to be displayed.
kwargs (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Figure: A plotly figure displaying the circuit.
- set_plexus_landscape(modePLX='default', **kwargs)[source]¶
Set the intial conductivity landscape of the plexus.
- Args:
mode (string): The specific plexus mode. kwargs (dictonary): Plexus attribute specifiers, optional.
- kirchhoff.circuit_flow.initialize_flow_circuit_from_crystal(crystal_type='default', periods=1)[source]¶
Initialize a flow circuit from a spatially embedded, crystal networkx graph.
- Args:
crystal_type (string):
The type of crystal skeleton (default, simple, chain, bcc, fcc, diamond, laves, square, hexagonal, trigonal_planar).
periods (int):
Repetition number of the lattice’s unit cell.
- Returns:
flow_circuit: A flow_circuit object.
- kirchhoff.circuit_flow.initialize_flow_circuit_from_random(random_type='default', periods=10, sidelength=1)[source]¶
Initialize a flow circuit from a random, spatially embedded networkx graph.
- Args:
random_type (string):
The type of random lattice to be constructed(voronoi_planar, voronoi_volume).
periods (int):
Number of random points.
sidelength (float):
The box size into which random points in space are generated.
- Returns:
flow_circuit: A flow_circuit object.
- kirchhoff.circuit_flow.setup_default_flow_circuit(skeleton=None)[source]¶
Initialize a flow circuit from a given networkx graph.
- Args:
skeleton (nx.Graph): A networkx graph.
- Returns:
flow_circuit: A flow_circuit object.
- kirchhoff.circuit_flow.setup_flow_circuit(skeleton=None, sourceMode=None, plexusMode=None, **kwargs)[source]¶
Initialize a flow circuit from a given networkx graph and dictioinary of boundary conditions.
- Args:
skeleton (nx.Graph):
A networkx graph.
source (string):
A key for source_mode (default, root_geometric, root_short, root_long, dipole_border, dipole_point, root_multi, custom).
plexus (string):
A key for plexus_mode.(default, custom)
- Returns:
flow_circuit: A flow_circuit object.
kirchhoff.circuit_flux¶
- class kirchhoff.circuit_flux.FluxCircuit(G: networkx.classes.graph.Graph = <factory>, info: str = 'unknown', source_mode: dict = <factory>, plexus_mode: dict = <factory>)[source]¶
Bases:
kirchhoff.circuit_flow.FlowCircuitA derived class for flux circuits.
solute_mode (dictionary):
A dictionary of custom solute outflux/influx boundaries.
absorption_mode (dictionary):
A dictionary of custom absorption rate initializations.
geom_mode (dictionary):
A dictionary of custom plexus geometrical initializations.
- get_edges_data(**kwargs)[source]¶
Get internal nodal DataFrame columns by keywords.
- Args:
args (list):
A list of keywords to check for in the internal DataFrames.
- Returns:
pd.DataFrame: A cliced DataFrame.
- Raises:
Exception: description
- get_nodes_data()[source]¶
Get internal nodal DataFrame columns by keywords.
- Args:
args (list):
A list of keywords to check for in the internal DataFrames.
- Returns:
pd.DataFrame: A cliced DataFrame.
- Raises:
Exception: description
- set_absorption_landscape(mode='default', **kwargs)[source]¶
Set the internal bounday state of sinks and sources.
- Args:
mode (string):
The specific absorption mode.
kwargs (dictonary):
Absorption attribute specifiers, optional.
- set_geom_landscape(mode='default', **kwargs)[source]¶
Set the internal bounday state of sinks and sources.
- Args:
mode (string):
The specific geometric initialization mode.
kwargs (dictonary):
Geometric initialization specifiers, optional.
- kirchhoff.circuit_flux.initialize_flux_circuit_from_crystal(crystal_type='default', periods=1)[source]¶
Initialize a flux circuit from a spatially embedded, crystal networkx graph.
- Args:
crystal_type (string):
The type of crystal skeleton (default, simple, chain, bcc, fcc, diamond, laves, square, hexagonal, trigonal_planar).
periods (int):
Repetition number of the lattice’s unit cell.
- Returns:
flux_circuit: A flux_circuit object.
- kirchhoff.circuit_flux.initialize_flux_circuit_from_random(random_type='default', periods=10, sidelength=1)[source]¶
Initialize a flux circuit from a random, spatially embedded networkx graph.
- Args:
random_type (string):
The type of random lattice to be constructed(voronoi_planar, voronoi_volume).
periods (int):
Number of random points.
sidelength (float):
The box size into which random points in space are generated.
- Returns:
flux_circuit: A flux_circuit object.
- kirchhoff.circuit_flux.setup_default_flux_circuit(skeleton=None, diffusion=None, absorption=None)[source]¶
Initialize a flux circuit from a given networkx graph.
- Args:
skeleton (nx.Graph):
A networkx graph.
diffusion (float):
Diffusion constant.
absorption (float):
Absorption rate.
- Returns:
flux_circuit: A flow_circuit object.
kirchhoff.circuit_dual¶
- class kirchhoff.circuit_dual.DualCircuit(layer: list = <factory>, e_adj: list = <factory>, e_adj_idx: list = <factory>, n_adj: list = <factory>)[source]¶
Bases:
objectA base class for flow circuits.
layer (list):
List of the graphs contained in the multilayer circuit.
e_adj (list):
A list off edge affiliation between the different layers, edge view.
e_adj_idx (list):
A list off edge affiliation between the different layers, label view.
n_adj (list): An internal nodal varaible.
- plot_circuit(*args, **kwargs)[source]¶
Use Plotly.GraphObjects to create interactive plots that have optionally the graph atributes displayed. Args:
kwargs (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Figure: A plotly figure displaying the circuit.
- kirchhoff.circuit_dual.initialize_dual_from_catenation(dual_type='catenation', num_periods=1, circuit_type='default')[source]¶
Initialize a dual spatially embedded circuit, with internal graphs based on simple catenatednetwork skeletons.
- Args:
dual_type (string):
The type of dual skeleton (simple, diamond, laves, catenation).
num_periods (int):
Repetition number of the lattice’s unit cell.
- Returns:
dual_circuit: A dual circuit system.
- kirchhoff.circuit_dual.initialize_dual_from_minsurf(dual_type='simple', num_periods=2, circuit_type='default')[source]¶
Initialize a dual spatially embedded flux circuit, with internal graphs based on the network skeletons of triply-periodic minimal surfaces.
- Args:
dual_type (string):
The type of dual skeleton (simple, diamond, laves, catenation).
num_periods (int):
Repetition number of the lattice’s unit cell.
- Returns:
dual_circuit: A flow_circuit object.
kirchhoff.draw_networkx¶
- kirchhoff.draw_networkx.add_traces_edges(fig, options, input_graph, extra_data)[source]¶
Add line traces for interactive edge data display.
- Args:
fig (plotly.graph_objects.Figure:
A plotly figure object
options (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
input_graph (nx.Graph):
A networkx graph.
extra_data (pandas.DataFrame):
A dataframe holding the data.
- kirchhoff.draw_networkx.add_traces_nodes(fig, options, input_graph, extra_data)[source]¶
Add point traces for interactive node data display.
- Args:
fig (plotly.graph_objects.Figure:
A plotly figure object
options (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
input_graph (nx.Graph):
A networkx graph.
extra_data (pandas.DataFrame):
A dataframe holding the data.
- kirchhoff.draw_networkx.create_tag(vals, columns)[source]¶
Create a hover tag.
- Args:
vals (list): A list of values. columns (list):A list of keywords.
- Returns:
string: A string in makrdown format.
- kirchhoff.draw_networkx.get_edge_invd_traces(input_graph, extra_data, **kwargs)[source]¶
Return individual line traces for interactive edge data display.
- Args:
input_graph (nx.Graph):
A networkx graph.
extra_data (pandas.DataFrame):
A dataframe holding the data.
kwargs (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Scatter: A plotly scatter object
- kirchhoff.draw_networkx.get_edge_mid_trace(input_graph, extra_data, **kwargs)[source]¶
Return transparent line traces for interactive edge data display.
- Args:
input_graph (nx.Graph):
A networkx graph.
extra_data (pandas.DataFrame):
A dataframe holding the data.
kwargs (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Scatter: A plotly scatter object
- kirchhoff.draw_networkx.get_hover_scatter_from_template(dim, options)[source]¶
Get scatter hover info for figure traces.
- Args:
dim (int):
A dimensional identifier.
options (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Scatter: A plotly scatter object
- kirchhoff.draw_networkx.get_line_from_template(dim, options)[source]¶
Get a line trace element.
- Args:
dim (int):
A dimensional identifier.
options (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Scatter: A plotly scatter object
- kirchhoff.draw_networkx.get_node_coords(input_graph, options)[source]¶
Return nodal coordinates in specified tuple format.
- Args:
input_graph (nx.Graph):
A networkx graph.
options (dictionary):
A dictionary for circuit keywords for readout.
- Returns:
list: A list of nodal postions [X, Y, Z]
- kirchhoff.draw_networkx.get_node_scatter(node_xyz, extra_data, options)[source]¶
Return nodal traces for interactive node data display.
- Args:
node_xyz (list):
A list of nodal postions [X, Y, Z].
extra_data (pandas.DataFrame):
A dataframe holding the data.
options (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Scatter: A plotly scatter object
- kirchhoff.draw_networkx.get_node_trace(input_graph, extra_data, **kwargs)[source]¶
Return nodal traces for interactive node data display.
- Args:
input_graph (nx.Graph):
A networkx graph.
extra_data (pandas.DataFrame):
A dataframe holding the data.
kwargs (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Scatter: A plotly scatter object
- kirchhoff.draw_networkx.plot_networkx(input_graph, **kwargs)[source]¶
- Return an interactive network plot, which shows the internal edge and node
data via hover and text.
- Args:
input_graph (nx.Graph):
A networkx graph.
kwargs (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Figure: A plotly figure object
- kirchhoff.draw_networkx.plot_networkx_dual(dual_circuit, *args, **kwargs)[source]¶
- Return an interactive network plot, which shows the internal edge and node
data via hover and text for a multilayer system.
- Args:
dual_circuit (dual_circuit):
A dual_circuit object.
args (list):
A list for keywoprd data for display.
kwargs (dictionary):
A dictionary for plotly keywords customizing the plots’ layout.
- Returns:
plotly.graph_objects.Figure: A plotly figure object
kirchhoff.io_networkx¶
kirchhoff.init_random¶
- class kirchhoff.init_random.NetworkxRandom(num_periods: int = 0, sidelength: float = 0)[source]¶
Bases:
objectA base class for spatial, random networks.
num_periods(int):
Number of points for internal Voronoi construction.
sidelength (float):
Box length for spatial initialization.
G (dictionary):
An internal simple graph.
- is_in_box(v, sl)[source]¶
Test whether new random point is inside the constraining boundaries.
- Args:
v (list):
The point vector to be tested.
sl (float):
The sidelength, acting as scale for the transition vector.
- Returns:
bool: The boolean value, True if inside the original volume.
- class kirchhoff.init_random.NetworkxVoronoiPlanar(num_periods: int = 0, sidelength: float = 0)[source]¶
Bases:
kirchhoff.init_random.NetworkxRandomA class algorithms to generate spatial, 2D random networks, generated via voronoi tesselation of a periodic plane.
num_periods(int):
Number of points for internal Voronoi construction.
sidelength (float):
Box length for spatial initialization.
G (dict):
An internal simple graph.
- construct_voronoi_periodic(number, sidelength)[source]¶
Generate random points in 2D, mirror them periodically and perform a Voronoi tesselation for a 2D random point set.
- Args:
number (int):
The number of points to be generated.
sidelength (float):
The sidelength of the box which hold points
- Returns:
Voronoi: A scipy.spatial.Voronoi output object
- class kirchhoff.init_random.NetworkxVoronoiVolume(num_periods: int = 0, sidelength: float = 0)[source]¶
Bases:
kirchhoff.init_random.NetworkxRandom- A class algorithms to generate spatial, 3D random networks, generated via
voronoi tesselation of a periodic volume.
num_periods(int):
Number of points for internal Voronoi construction.
sidelength (float):
Box length for spatial initialization.
G (dict):
An internal simple graph.
- construct_voronoi_periodic(number, sidelength)[source]¶
Generate random points in 3D, mirror them periodically and perform a Voronoi tesselation for a 3D random point set.
- Args:
number (int): The number of points to be generated. sidelength (float): The sidelength of the box which hold points
- Returns:
Voronoi: A scipy.spatial.Voronoi output object
- kirchhoff.init_random.init_graph_from_random(random_type, periods, sidelength)[source]¶
Initialize a random spatial graph customized by type and size.
- Args:
random_type (string):
The type of random lattice to be constructed(voronoi_planar, voronoi_volume).
periods (int):
Number of random points.
sidelength (float):
The box size into which random points in space are generated.
- Returns:
nx.Graph: A random spatial graph.
kirchhoff.init_crystal¶
- class kirchhoff.init_crystal.NetworkxBcc(num_periods)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, simple bcc graphs.
- class kirchhoff.init_crystal.NetworkxChain(num_periods)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, 1D chain graphs.
- class kirchhoff.init_crystal.NetworkxCrystal[source]¶
Bases:
objectA base class for spatial, crystal-like graphs.
G (nx.Graph):
An internal networkx graph variable.
dict_cells (dictionary):
A dictionary of the current cells.
lattice_constant (float):
Scale for the lattice. spacing
translation_length (float):
Scale for the translational offset.
- class kirchhoff.init_crystal.NetworkxDiamond(num_periods)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, diamond graphs.
- class kirchhoff.init_crystal.NetworkxFcc(num_periods)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, simple fcc graphs.
- class kirchhoff.init_crystal.NetworkxHexagonal(tiling_factor, periodic=False)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, planar hexagonal graphs.
- class kirchhoff.init_crystal.NetworkxLaves(num_periods)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, Laves graphs.
- class kirchhoff.init_crystal.NetworkxSimple(num_periods)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, simple cubic graphs.
- class kirchhoff.init_crystal.NetworkxSquare(tiling_factor)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, simpley tiled graphs.
- class kirchhoff.init_crystal.NetworkxTriagonalPlanar(tiling_factor)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, planar triangulated graphs.
- class kirchhoff.init_crystal.NetworkxTriagonalStack(stacks, tiling_factor)[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA derived class for spatial, stacked, triangulated graphs, contained in hexagonal shapes.
- construct_spine_stack(z, n)[source]¶
- Generate new nodes and connections for spines of stacked hexagons of
the internal graph and set spine length internally.
- Args:
z (float):
The current stack indicator.
n (int):
Length of the hexagon’s outer sites.
- kirchhoff.init_crystal.init_graph_from_asymCrystal(crystal_type, periodsZ, periodsXY)[source]¶
Initialize a spatially embedded graph, with based on an asymmetric crystal lattice.
- Args:
crystal_type (string):
The type of crystal skeleton (trigonal_stack).
periodsZ (int):
Vertical repetition number of the lattice’s unit cell.
periodsXY (int):
Lateral repetition number of the lattice’s unit cell.
- Returns:
nx.Graph: A networkx graph.
- kirchhoff.init_crystal.init_graph_from_crystal(crystal_type, periods)[source]¶
Initialize a spatially embedded graph, with based on crystal lattice.
- Args:
crystal_type (string):
The type of crystal skeleton (default, simple, chain, bcc, fcc, diamond, laves, square, hexagonal, trigonal_planar).
periods (int):
Repetition number of the lattice’s unit cell.
- Returns:
nx.Graph: A networkx graph.
kirchhoff.init_dual¶
- class kirchhoff.init_dual.NetworkxDual[source]¶
Bases:
kirchhoff.init_crystal.NetworkxCrystalA base class for spatial, dual circuits.
layer (list):
List of the graphs contained in the multilayer network.
lattice_constant (float):
Scale for the spacing between the networks.
translation_length (float):
Scale for the translation difference between the multiple networks.
- periodic_cell_structure_offset(cell, num_periods, offset)[source]¶
Repeat the unit cell with translational offset to create a graph.
- Args:
cell (nx.Graph): unit cell in networkx graph format. num_periods (int): Repetition number for the unit cells. offset (ndarray): A translational offset for the lattice.
- Returns:
nx.Graph: A simple, periodic Graph.
- prune_leaves(G, H, adj)[source]¶
Remove non-affiliated edges in dual graphs.
- Args:
G(nx.Graph):
A networkx graph.
H (nx.Graph):
A networkx graph.
adj (list):
A list of affiliated edge pairs of the two graphs.
- Returns:
list: A list of networkx graphs.
- class kirchhoff.init_dual.NetworkxDualCatenation(num_periods)[source]¶
Bases:
kirchhoff.init_dual.NetworkxDualA class for spatial, dual Laves circuits.
layer (list):
List of the mutlilayered circuits.
lattice_constant (float):
Scale for the spacing between the networks.
- class kirchhoff.init_dual.NetworkxDualCrossMesh(num_periods)[source]¶
Bases:
kirchhoff.init_dual.NetworkxDualA class for spatial, dual Laves circuits.
layer (list):
List of the mutlilayered circuits.
lattice_constant (float):
Scale for the spacing between the networks.
- class kirchhoff.init_dual.NetworkxDualDiamond(num_periods)[source]¶
Bases:
kirchhoff.init_dual.NetworkxDualA class for spatial, dual diamond circuits.
layer (list):
List of the mutlilayered circuits.
lattice_constant (float):
Scale for the spacing between the networks.
translation_length (float):
Scale for the translation difference between the multiple networks.
- dualDiamond(num_periods)[source]¶
Set internal networks structure, dual diamond.
- Args:
num_periods (int):
Repetition number of the unit cells.
- init_graph(G_aux)[source]¶
Generate points for a diamond lattice return dual graph representations.
- Args:
G_aux (nx.Graph):
A networkx graph.
- Returns:
nx.Graph:
A networkx graph.
- init_graph_nuclei(G_aux, H_aux)[source]¶
- Generate points for a diamond lattice and its dual via copy+translation
and return dual graph representations.
- Args:
G_aux (nx.Graph):
Inner networkx graph.
H_aux (nx.Graph):
Outer networkx graph.
- Returns:
nx.Graph:
Inner networkx graph.
nx.Graph:
Outer networkx graph.
- class kirchhoff.init_dual.NetworkxDualLaves(num_periods)[source]¶
Bases:
kirchhoff.init_dual.NetworkxDualA class for spatial, dual Laves circuits.
layer (list):
List of the mutlilayered circuits.
lattice_constant (float):
Scale for the spacing between the networks.
- dualLaves(num_periods)[source]¶
Set internal networks structure, dual diamond.
- Args:
num_periods (int):
A networkx graph.
- init_graph(G_aux)[source]¶
Built labeled, attributed graphs from raw point sets.
- Args:
G_aux (nx.Graph):
Inner networkx graph holding unlabeled data.
- Returns:
nx.Graph: A networkx graph
- init_graph_nuclei(G_aux, H_aux)[source]¶
Generate points for a Laves lattice and its dual via mirroring + translation and return dual graph representations.
- Args:
G_aux (nx.Graph):
Inner networkx graph.
H_aux (nx.Graph):
Outer networkx graph.
- Returns:
nx.Graph: A networkx graph
- laves_graph(num_periods, chirality, offset)[source]¶
Generate points for a Laves lattice and its dual via mirroring + translation and return dual graph representations.
- Args:
num_periods (int):
Repetition number of the unit cells..
chirality (string):
Chirality identifier for the current lattice generator.
offset (ndarray):
A translation vector.
- Returns:
nx.Graph: A networkx graph
- class kirchhoff.init_dual.NetworkxDualSimple(num_periods)[source]¶
Bases:
kirchhoff.init_dual.NetworkxDualA class for spatial, dual cubic circuits.
layer (list):
List of the mutlilayered circuits.
lattice_constant (float):
Scale for the spacing between the networks.
translation_length (float):
Scale for the translation difference between the multiple networks.
- dualSimple(num_periods)[source]¶
Set internal networks structure, dual cubic.
- Args:
num_periods (int):
A networkx graph.
- init_graph_nuclei(V)[source]¶
Generate points for a cubic lattice and its dual via Voronois tesselation and return dual graph representations.
- Args:
Voronoi (scipy.spatial.Voronoi):
A Tesselation object.
- Return:
nx.Graph:
Inner networkx graph.
nx.Graph:
Outer networkx graph.
- set_graph_adjacency(V, G, H)[source]¶
Return the affiliation list of two dual cubic lattices.
- Args:
Voronoi (scipy.spatial.Voronoi):
A Voronoi-Tesselation object.
G (nx.Graph):
The inner networkx graph.
H (nx.Graph):
The outer networkx graph.
- Return:
list:
The edge affiliation list of the dual cubic lattice.
- kirchhoff.init_dual.init_dualCatenation(dual_type, num_periods)[source]¶
Initialize a dual spatially embedded multilayer graph, with internal graphs based on simple catenated network skeletons.
- Args:
dual_type (string):
The type of dual skeleton (simple, diamond, laves, catenation).
num_periods (int):
Repetition number of the lattice’s unit cell.
- Returns:
NetworkxDual: A dual networkx object.
- kirchhoff.init_dual.init_dual_minsurf_graphs(dual_type, num_periods)[source]¶
Initialize a dual spatially embedded multilayer graph, with internal graphs based on the network skeletons of triply-periodic minimal surfaces.
- Args:
dual_type (string):
The type of dual skeleton (simple, diamond, laves, catenation).
num_periods (int):
Repetition number of the lattice’s unit cell.
- Returns:
NetworkxDual: A dual networkx object.