Spaces:
Sleeping
Sleeping
tiffank1802 commited on
Commit ·
327041c
1
Parent(s): 9f20e46
Add debug logging for thermique simulation
Browse files
frontend/src/components/thermique/ThermiqueApp.jsx
CHANGED
|
@@ -39,6 +39,10 @@ export default function ThermiqueApp({ onBack }) {
|
|
| 39 |
};
|
| 40 |
|
| 41 |
const handleSimulationCreated = async (simulation) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
setSelectedSimulation(simulation);
|
| 43 |
setMeshPreview(null);
|
| 44 |
setViewMode('animation'); // Go to animation for thermal diffusion
|
|
@@ -77,12 +81,16 @@ export default function ThermiqueApp({ onBack }) {
|
|
| 77 |
};
|
| 78 |
|
| 79 |
const getCurrentSolutionData = () => {
|
|
|
|
| 80 |
if (selectedSimulation?.result_data) {
|
| 81 |
-
|
| 82 |
mesh: selectedSimulation.mesh_data,
|
| 83 |
solution: selectedSimulation.result_data,
|
| 84 |
};
|
|
|
|
|
|
|
| 85 |
}
|
|
|
|
| 86 |
return null;
|
| 87 |
};
|
| 88 |
|
|
|
|
| 39 |
};
|
| 40 |
|
| 41 |
const handleSimulationCreated = async (simulation) => {
|
| 42 |
+
console.log('Simulation created:', simulation);
|
| 43 |
+
console.log('result_data:', simulation.result_data);
|
| 44 |
+
console.log('animation_frames:', simulation.animation_frames);
|
| 45 |
+
console.log('mesh_data:', simulation.mesh_data);
|
| 46 |
setSelectedSimulation(simulation);
|
| 47 |
setMeshPreview(null);
|
| 48 |
setViewMode('animation'); // Go to animation for thermal diffusion
|
|
|
|
| 81 |
};
|
| 82 |
|
| 83 |
const getCurrentSolutionData = () => {
|
| 84 |
+
console.log('getCurrentSolutionData - selectedSimulation:', selectedSimulation);
|
| 85 |
if (selectedSimulation?.result_data) {
|
| 86 |
+
const data = {
|
| 87 |
mesh: selectedSimulation.mesh_data,
|
| 88 |
solution: selectedSimulation.result_data,
|
| 89 |
};
|
| 90 |
+
console.log('Returning solution data:', data);
|
| 91 |
+
return data;
|
| 92 |
}
|
| 93 |
+
console.log('No result_data available');
|
| 94 |
return null;
|
| 95 |
};
|
| 96 |
|
frontend/src/components/thermique/ThermiqueForm.jsx
CHANGED
|
@@ -47,8 +47,17 @@ export default function ThermiqueForm({ onPreviewMesh, onSimulationCreated, load
|
|
| 47 |
e.preventDefault();
|
| 48 |
setLoading(true);
|
| 49 |
try {
|
|
|
|
| 50 |
const simulation = await thermiqueApi.createSimulation(params);
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
} catch (err) {
|
| 53 |
console.error('Erreur création:', err);
|
| 54 |
alert('Erreur: ' + err.message);
|
|
|
|
| 47 |
e.preventDefault();
|
| 48 |
setLoading(true);
|
| 49 |
try {
|
| 50 |
+
console.log('Creating simulation with params:', params);
|
| 51 |
const simulation = await thermiqueApi.createSimulation(params);
|
| 52 |
+
console.log('Simulation response:', simulation);
|
| 53 |
+
console.log('Status:', simulation.status);
|
| 54 |
+
console.log('Error message:', simulation.error_message);
|
| 55 |
+
|
| 56 |
+
if (simulation.status === 'failed') {
|
| 57 |
+
alert('Erreur de simulation: ' + (simulation.error_message || 'Erreur inconnue'));
|
| 58 |
+
} else {
|
| 59 |
+
onSimulationCreated(simulation);
|
| 60 |
+
}
|
| 61 |
} catch (err) {
|
| 62 |
console.error('Erreur création:', err);
|
| 63 |
alert('Erreur: ' + err.message);
|
static/assets/{index-BePigqiZ.js → index-Vw8IJEst.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
static/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<title>Simulation FEniCS</title>
|
| 7 |
-
<script type="module" crossorigin src="/static/assets/index-
|
| 8 |
<link rel="stylesheet" crossorigin href="/static/assets/index-CR559KX0.css">
|
| 9 |
</head>
|
| 10 |
<body>
|
|
|
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<title>Simulation FEniCS</title>
|
| 7 |
+
<script type="module" crossorigin src="/static/assets/index-Vw8IJEst.js"></script>
|
| 8 |
<link rel="stylesheet" crossorigin href="/static/assets/index-CR559KX0.css">
|
| 9 |
</head>
|
| 10 |
<body>
|