DOI: 10.5281/zenodo.15875783
title: Code and data of GENVOR

description: Here are the data and code for the six cases in our paper.



Software environment




COMSOL Multiphysics 6.2

Matlab 2023b

Python 3.9



PyTorch 1.12.1




Code

Fluid-structure optimization

Two test cases are constructed with mesh resolutions of 160 (fluid_20_8) and 640 (fluid_40_16) elements.

fluid_20_8

1.5577_201sample: Process data for optimal results in the paper.

10ntrain_train_step.mat: Initial sample.

fluid.mph: COMSOL Simulation Model.

main.m: Main program.

func_inputs_gen: MATLAB code to build the initial sample.

func_outputs_nowrite.m: MATLAB code for calculating FEA.

WAE_func_edit.py: Python program for exploration and exploitation strategy.

Functions.py: Auxiliary functions.

PSO20.py: Python program to run PSO.

Gpre_model.py: Surrogate model for PSO.

utils.py: Python program to determine if the flow path is blocked.

fluid_40_16

2.0042_2207sample: Process data for optimal results in the paper.

10ntrain_train_step.mat: Initial sample.

fluid.mph: COMSOL Simulation Model.

main.m: Main program.

func_inputs_gen: MATLAB code to build the initial sample.

func_outputs_nowrite.m: MATLAB code for calculating FEA.

WAE_func_edit.py: Python program for exploration and exploitation strategy.

Functions.py: Auxiliary functions.

PSO20.py: Python program to run PSO.

Gpre_model.py: Surrogate model for PSO.

utils.py: Python program to determine if the flow path is blocked.

fitnessFunctionWithPenalty.m: Fitness function for particleswarm function in MATLAB (when using MATLAB to run PSO).

Cooling plate design of battery packs for electric vehicles

cooling_plate

1.7849_2747: Process data for optimal results in the paper.

cooling_plate.mph: COMSOL Simulation Model.

main.m: Main program.

func_inputs: MATLAB code to build the initial sample.

func_outputs_gs.m: MATLAB code for calculating FEA.

WAE_func_edit.py: Python program for exploration and exploitation strategy.

Functions.py: Auxiliary functions.

3D Dimensional optimization of integrated inlet and outlet pipelines

inlet_outlet_pipe

2.1054_145: Process data for optimal results in the paper.

m1.mph: COMSOL Simulation Model.

main.m: Main program.

func_inputs: MATLAB code to build the initial sample.

func_outputs_nowrite.m: MATLAB code for calculating FEA.

WAE_func_edit.py: Python program for exploration and exploitation strategy.

Functions.py: Auxiliary functions.

func_limitation.m: MATLAB program for selecting samples that satisfy boundary conditions.

Inverse design of elastic metamaterials

Two cases are set up as maximum bandgap width optimization and specific bandgap design.

metamaterial

1.2390_3363: Process data for optimal results in the paper.

m1.mph: COMSOL Simulation Model.

main.m: Main program.

func_inputs: MATLAB code to build the initial sample.

func_outputs_nowrite.m: MATLAB code for calculating FEA.

WAE_func_edit.py: Python program for exploration and exploitation strategy.

Functions.py: Auxiliary functions.

func_limitation.m: MATLAB program for selecting samples that satisfy boundary conditions.

func_transform.m: MATLAB program for interconversion between metamaterial structures and design vectors.

metamaterial_accurate

0.0038(0.2386)_2237: Process data for optimal results in the paper.

m1.mph: COMSOL Simulation Model.

main.m: Main program.

func_inputs: MATLAB code to build the initial sample.

func_outputs_nowrite.m: MATLAB code for calculating FEA.

WAE_func_edit.py: Python program for exploration and exploitation strategy.

Functions.py: Auxiliary functions.

func_limitation.m: MATLAB program for selecting samples that satisfy boundary conditions.

func_transform.m: MATLAB program for interconversion between metamaterial structures and design vectors.

obj.mat: Target bandgap for inverse design.

Data

The data_g is used to store the updated data set after each iteration. data_latent_g is used to store the new samples generated by the exploration and exploitation strategy. opt_g is used to store the new samples obtained by the evolutionary algorithm.

Below is the process data for generating optimal values for each case in the paper.

Fluid-structure optimization

Two test cases are constructed with mesh resolutions of 160 (fluid_20_8) and 640 (fluid_40_16) elements.

fluid_20_8

1.5577_201sample: Process data for optimal results in the paper.

fluid_40_16

2.0042_2207sample: Process data for optimal results in the paper.

Cooling plate design of battery packs for electric vehicles

cooling_plate

1.7849_2747: Process data for optimal results in the paper.

3D Dimensional optimization of integrated inlet and outlet pipelines

inlet_outlet_pipe

2.1054_145: Process data for optimal results in the paper.

Inverse design of elastic metamaterials

Two cases are set up as maximum bandgap width optimization and specific bandgap design.

metamaterial

1.2390_3363: Process data for optimal results in the paper.

metamaterial_accurate

0.0038(0.2386)_2237: Process data for optimal results in the paper.

How to run



Connect MATLAB with COMSOL server.

Adjust python environment and function paths in main.m.

Run main.m.

After the optimization process has converged or the maximum number of iterations has been reached, the last generation dataset can be obtained from the folder data_g.