Skip to content

Commit aefc492

Browse files
committed
Docs: Add Julia API doc and graphviz to sphinx doc
1 parent 6b51208 commit aefc492

2 files changed

Lines changed: 173 additions & 0 deletions

File tree

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Julia
2+
3+
This section documents the Julia implementation of the MOLE toolkit, MOLE.jl.
4+
5+
The API documentation is generated automatically from the docstrings in the Julia source files located in `mole/julia/MOLE.jl/src`.
6+
7+
The published MOLE.jl documentation can be found on the [MOLE.jl Documentation website](https://www.mole-ose.org/MOLE.jl-docs/dev/).
8+
9+
```{eval-rst}
10+
.. only:: html
11+
12+
The following diagram shows the key modules and functions in the MOLE.jl API and their relationships:
13+
14+
.. graphviz::
15+
16+
digraph mole_jl_api_structure {
17+
bgcolor="transparent";
18+
rankdir=TB; // Top to Bottom layout
19+
compound=true;
20+
node [shape=box, style=filled, fontname="Arial", fontsize=10, margin="0.3,0.1"];
21+
edge [fontname="Arial", fontsize=9];
22+
23+
// Color definitions
24+
node [fillcolor="#E8F4F9"]; // Light blue for base nodes
25+
26+
// Core package
27+
subgraph cluster_base {
28+
label="Core Package";
29+
style=filled;
30+
color="#F5F5F5";
31+
32+
MOLE [label="MOLE.jl\n(Package)"];
33+
}
34+
35+
// Core modules
36+
subgraph cluster_modules {
37+
label="Core Modules";
38+
style=filled;
39+
color="#F5F5F5";
40+
node [fillcolor="#E8F4F9"];
41+
42+
Operators [label="Operators"];
43+
BCs [label="BCs"];
44+
}
45+
46+
// Operators
47+
subgraph cluster_operators {
48+
label="Core Operators";
49+
style=filled;
50+
color="#F5F5F5";
51+
node [fillcolor="#D5E8D4"]; // Light green for operators
52+
53+
Interpol [label="interpol\n(Interpolation)"];
54+
Gradient [label="grad\n(Gradient)"];
55+
Divergence [label="div\n(Divergence)"];
56+
Laplacian [label="lap\n(Laplacian)"];
57+
}
58+
59+
// Boundary Conditions
60+
subgraph cluster_bc {
61+
label="Boundary Conditions";
62+
style=filled;
63+
color="#F5F5F5";
64+
node [fillcolor="#FFE6CC"]; // Light orange for boundary conditions
65+
66+
RobinBC [label="robinBC\n(Robin/Neumann/Dirichlet)"];
67+
ScalarBC1D [label="ScalarBC1D"];
68+
ScalarBC2D [label="ScalarBC2D"];
69+
AddScalarBC [label="addScalarBC!\n(Apply Scalar BCs)"];
70+
}
71+
72+
// Grid Variants
73+
subgraph cluster_grids {
74+
label="Grid and Dimension Variants";
75+
style=filled;
76+
color="#F5F5F5";
77+
node [fillcolor="#DAE8FC"]; // Light blue for utilities
78+
79+
OneD [label="1D Operators"];
80+
TwoD [label="2D Operators"];
81+
Uniform [label="Uniform Grids"];
82+
NonUniform [label="Non-uniform Grids"];
83+
}
84+
85+
// Module relationships
86+
edge [color="#0000AA", penwidth=1.5];
87+
MOLE -> {Operators BCs};
88+
89+
// API ownership relationships
90+
edge [color="#0000AA", penwidth=1.5];
91+
Operators -> {Interpol Gradient Divergence Laplacian};
92+
BCs -> {RobinBC ScalarBC1D ScalarBC2D AddScalarBC};
93+
94+
// Usage relationships
95+
edge [style=dashed, dir=forward, color="#006600", penwidth=1.0];
96+
Gradient -> Laplacian;
97+
Divergence -> Laplacian;
98+
99+
// Grid and dimension relationships
100+
edge [style=dotted, dir=forward, color="#990000", penwidth=1.0];
101+
OneD -> {Interpol Gradient Divergence Laplacian RobinBC ScalarBC1D AddScalarBC};
102+
TwoD -> {Gradient Divergence Laplacian RobinBC ScalarBC2D AddScalarBC};
103+
Uniform -> {Interpol Gradient Divergence Laplacian};
104+
NonUniform -> {Gradient Divergence};
105+
106+
// Boundary condition relationships
107+
edge [style=dashed, constraint=false, color="#AA6600", penwidth=1.0];
108+
RobinBC -> {Gradient Divergence Laplacian};
109+
ScalarBC1D -> AddScalarBC;
110+
ScalarBC2D -> AddScalarBC;
111+
AddScalarBC -> {Gradient Divergence Laplacian};
112+
113+
// Add a legend
114+
subgraph cluster_legend {
115+
label="Legend";
116+
style=filled;
117+
color="#F5F5F5";
118+
fontsize=10;
119+
120+
node [shape=none, style=none, label=""];
121+
edge [style=none];
122+
123+
leg_title [label="Relationship Types:", shape=none, fontsize=9];
124+
leg_module [label="Module/API Ownership", shape=none, fontsize=9];
125+
leg_usage [label="Operator Usage", shape=none, fontsize=9];
126+
leg_grid [label="Grid/Dimension Support", shape=none, fontsize=9];
127+
leg_boundary [label="Boundary Modification", shape=none, fontsize=9];
128+
129+
leg_title -> leg_module [style=solid, color="#0000AA", penwidth=1.5];
130+
leg_title -> leg_usage [style=dashed, color="#006600", penwidth=1.0];
131+
leg_title -> leg_grid [style=dotted, color="#990000", penwidth=1.0];
132+
leg_title -> leg_boundary [style=dashed, color="#AA6600", penwidth=1.0];
133+
}
134+
}
135+
136+
.. only:: latex
137+
138+
The MOLE.jl API consists of several key components:
139+
140+
Core Package:
141+
* **MOLE.jl**: Julia implementation of Mimetic Operators Library Enhanced.
142+
143+
Core Modules:
144+
* **MOLE.Operators**: Provides mimetic discrete operators.
145+
* **MOLE.BCs**: Provides boundary-condition utilities and scalar boundary-condition support.
146+
147+
Core Operators:
148+
* **interpol**: Interpolation operator for grid transformations.
149+
* **grad**: Gradient operator with support for one- and two-dimensional grids.
150+
* **div**: Divergence operator with support for one- and two-dimensional grids.
151+
* **lap**: Laplacian operator related to gradient and divergence operators.
152+
153+
Boundary Conditions:
154+
* **robinBC**: Constructs Robin, Neumann, and Dirichlet boundary-condition contributions.
155+
* **ScalarBC1D**: Scalar boundary-condition data for one-dimensional problems.
156+
* **ScalarBC2D**: Scalar boundary-condition data for two-dimensional problems.
157+
* **addScalarBC!**: Applies scalar boundary conditions to operators or systems.
158+
159+
Grid and Dimension Variants:
160+
* **1D Operators**: One-dimensional versions of interpolation, gradient, divergence, Laplacian, and boundary-condition routines.
161+
* **2D Operators**: Two-dimensional versions of gradient, divergence, Laplacian, and boundary-condition routines.
162+
* **Uniform Grids**: Operators defined using regular grid spacing.
163+
* **Non-uniform Grids**: Operators defined using coordinate ticks or non-uniform grid spacing.
164+
165+
Key Features:
166+
* MOLE.jl exposes operators through Julia modules rather than C++ classes.
167+
* Core operators are grouped under **MOLE.Operators**.
168+
* Boundary-condition tools are grouped under **MOLE.BCs**.
169+
* Laplacian functionality is closely related to Gradient and Divergence.
170+
* Boundary-condition utilities can modify operator behavior or system matrices.
171+
* Several operators support both uniform and non-uniform grids.
172+
```

doc/sphinx/source/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Documentation Guide <intros/doc_readme_wrapper>
2525
2626
api/cpp/index
2727
api/matlab_octave/index-beta
28+
api/julia/index
2829
```
2930

3031
```{toctree}

0 commit comments

Comments
 (0)