File size: 6,845 Bytes
66cd287
 
d095916
 
 
 
 
 
 
 
7d19e50
 
 
 
d095916
 
 
 
 
 
 
 
 
 
 
66cd287
d095916
 
 
 
 
 
 
 
 
 
7d19e50
 
 
 
 
 
e2dc0ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d095916
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
license: cc-by-4.0
language:
- en
tags:
- agentfem
- finite-element-method
- scientific-machine-learning
- physics-ai
- simulation
- heat-transfer
- thermal-conduction
- temperature-field
pretty_name: AgentFEM Multi-Source Heat Conduction
size_categories:
- n<1K
configs:
- config_name: default
  data_files:
  - split: train
    path: train.jsonl
  - split: validation
    path: validation.jsonl
  - split: test
    path: test.jsonl
---
# AgentFEM · Multi-source heat conduction

Two smooth volumetric heat sources in a rectangular conducting plate. Learn how source placement, spread, intensity, geometry and conductivity shape the temperature field.

![AgentFEM finite-element examples](preview.png)

**256 independently solved parameter sets · full meshes and fields · 192 / 32 / 32 split · CC BY 4.0**

Built with [AgentFEM](https://github.com/haoming-luo/agentfem). A small, reproducible engineering dataset for surrogate learning, field prediction and numerical-method experiments.

## A first experiment

Predict peak temperature rise from the source and material parameters, then compare with the supplied held-out scalar baselines. For a full-field study, use the HDF5 mesh and nodal temperatures rather than treating the JSONL rows as images.

[Load the test split](load_example.py) · [Inspect baseline results](baselines.json) · [Practice heat conduction with AgentFEM](https://lab.haoming-luo.com/learn/)

### See the source and temperature together

Run [plot_heat.py](plot_heat.py) to draw one recorded sample: heat generation on the left, temperature rise on the right. It downloads only the pinned test split (about 1.9 MB), uses the actual triangular mesh, and prints the peak temperature and its coordinates. No FEM installation or GPU is needed.

```bash
pip install numpy h5py matplotlib huggingface_hub
python plot_heat.py
# Or use a file you already downloaded:
python plot_heat.py --data test.h5 --sample 00016 --output heat.png
```

![Heat-generation input beside the recorded finite-element temperature rise](heat-input-output.png)

The circle marks the hottest mesh node. Compare the two source locations with that point: source strength alone does not determine the temperature, because heat spreads through the plate and escapes at the cooled edges. This figure reads a stored solution; changing a source parameter requires a new solve, not recolouring this image.

## Physical problem

Steady isotropic conduction: -div(k grad(T)) = q. All four edges are held at 300 K. The two Gaussian sources are uniform through the unit out-of-plane thickness. No air flow, contact resistance, radiation, or convection is solved.

Linear triangular temperature elements; 48 by 32 structured subdivisions (3,072 triangles).

An idealized heat-spreading plate with isothermal cooled edges, not a complete electronic cooling system. Positive Gaussian heat sources may overlap. Sampling confines source 1 to the lower-left and source 2 to the upper-right part of the plate.

## What is included

- `train.h5`, `validation.h5`, `test.h5`: one group per sample ID, geometry, connectivity, point fields and cell fields. Gzip-compressed without floating-point downcasting.
- HDF5 `inputs/`: boundary-node masks and, for heat, the prescribed Gaussian source evaluated at mesh nodes. These are model inputs, not predicted fields or integrated nodal loads.
- Corresponding JSONL files: browsable parameters and engineering observables; they point to HDF5 groups, not serialized full fields.
- `quality.json`: checks, dependency versions, convergence evidence.
- `baselines.json`, `baseline.py`: held-out scalar mean/nearest-neighbor baselines with train-only normalization; no neural-model claims.
- `generate.py`, `quality.py`, `load_example.py`: generation, audit and minimal loading workflows.

SI units: coordinates and U in m; stress S and MISES in Pa; strain E dimensionless; temperature in K. `coordinates` are undeformed reference nodes. Connectivity follows the AgentFEM XDMF export order: Triangle (heat), Triangle_6 (notch), or Quadrilateral_9 (cylinder). Cell stress is projected and unsmoothed. See generated XDMF for native export semantics.

Tensor components are flattened row-major: 2×2 for plane stress (x,y), 3×3 for axisymmetry (r,theta,z). Displacement U uses padded three-component storage; active components are (x,y) for the plate and (r,z) for the cylinder. The HDF5 files contain mesh connectivity, not an assumed common image grid.

Parameters, in generator order: `length_m, height_m, conductivity_w_m_k, source1_x_fraction, source1_y_fraction, source2_x_fraction, source2_y_fraction, source1_sigma_m, source2_sigma_m, source1_peak_w_m3, source2_peak_w_m3`.

Observed sample ranges (exact values are in JSONL; intended sampling bounds are in `generate.py`):

| Parameter | Minimum | Maximum |
|---|---:|---:|
| length_m | 0.0801395 | 0.159853 |
| height_m | 0.0501502 | 0.0998562 |
| conductivity_w_m_k | 15.6592 | 199.899 |
| source1_x_fraction | 0.150413 | 0.449133 |
| source1_y_fraction | 0.151047 | 0.449245 |
| source2_x_fraction | 0.550528 | 0.849329 |
| source2_y_fraction | 0.550023 | 0.849833 |
| source1_sigma_m | 0.00402783 | 0.0119955 |
| source2_sigma_m | 0.00402299 | 0.0119821 |
| source1_peak_w_m3 | 1.01861e+06 | 7.97658e+06 |
| source2_peak_w_m3 | 1.0042e+06 | 7.97922e+06 |

## Quality evidence

Eight mesh-refinement audits: maximum relative change in peak_temperature_rise_k = 0.44%. This is an observable convergence check, not a bound on full-field error.

All published field arrays are finite; all parameter sets and geometry/source-layout parameter tuples are unique. Splits use one fixed random permutation after scrambled Sobol sampling (seed 20260923; split seed 20260924). All splits are **in-distribution**; no claim of unseen-family generalization. One row is one independently solved case, not a frame or a rescaled duplicate.

Generic continuous material ranges are synthetic, not calibrated material grades. Dataset generation does not imply experimental validation. These are original parameterized examples, not certified NAFEMS benchmarks or copies of commercial solver datasets.

## Load and reproduce

```bash
python load_example.py --repo HaomingLuo/AgentFEM-MultiSource-Heat-2D --split test
# In the pinned AgentFEM/FEniCSx environment:
python generate.py heat --count 256
```

Loading requires only h5py, numpy and huggingface_hub; FEniCSx is needed only to regenerate FEM results. Generation writes a local `generated/` directory and uses one MPI rank. The heat manufactured-solution check is available via `python generate.py heat --validate`.

## Attribution

Haoming Luo, *Multi-source heat conduction — AgentFEM parametric FEM dataset*, 2026. Please cite this repository URL and the commit revision used. Data: CC BY 4.0. Example code: Apache-2.0.