Skip to content

Vanishing Viscosity solution predicting Graph Neural Networks and Domain Decomposable Reduced Order Models based on the Discontinuous Galerking method applied to Friedrichs' systems

License

Notifications You must be signed in to change notification settings

fraromor/DD-ROM-GNN-Friedrichs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of contents

Description

This repository contains the code used to generate the results in the pre-print "Friedrichs’ systems discretized with the Discontinuous Galerkin method: domain decomposable model order reduction and Graph Neural Networks approximating vanishing viscosity solutions", https://arxiv.org/pdf/2308.03378.

Dependencies and installation

The following packages are required deal.II, PETSc, petsc4py, torch, torch_geometric, pytorch_lightning among others.

Documentation DD-ROMs for Friedrichs' systems

Procedure for DD-ROMs with repartitioning strategies

Compile the deal.II script. As first step we need to save the matrices needed for the affine decomposition:

> cd maxwellParallel
> cmake .
> make release
> make 
> mpirun -np 4 ./maxwell

we also need the positions of the support points of the dofs for our repartitioning strategies. Inside "parameters.prm" set "task to perform" from "affine" to "save_pos". Then run:

> mpirun -np 4 ./maxwell
> cd affine_matrices
> python3 postprocess.py 4
> cd ..
> cd ..

run offline and online stages in parallel with:

> mpirun -np 4 python3 run_FOM_ROM.py

Additionally: to see the partitioning of the computational domain do the following:

> cd maxwellParallel

inside "parameters.prm" set "task to perform" from "affine" to "labels"

> mpirun -np 4 ./maxwell

and open in paraview:

> paraview partition_0.pvtu

Additionally: to plot the FOM and ROM solutions do the following:

> cd maxwellParallel

inside "parameters.prm" set "task to perform" from "affine" to "plot"

> mpirun -np 4 ./maxwell

and open the fields in paraview: the FOM fields with

> paraview snapshots/reconstructed_[0-9].pvtu

and the DD-ROM predicted fields

> paraview snapshots/rreconstructed_[0-9].pvtu

Procedure for vanishing viscosity solutions inference with GNNs

The following procedure is used to infer the vanishing viscosity solutions through our multi-fidelity multi-resolution strategy that makes use of DD-ROMs and GNNs. Run the following to train a GNN with data already obtained from an advection-diffusion-reaction test case: download first the dataset with

> cd vv
> wget https://zenodo.org/records/13946510/files/vv.tar.gz
> tar -zxfv vv.tar.gz

then run the training with:

> python3 vvgraph_all.py

move the file that starts with "tb_logs/vv/version_0/checkpoints/epoch*" in "tb_logs/vv.ckpt" so that it can be loaded by the script "predict.py"

> python3 predict.py

How to cite

If you use this package in your publications please cite the package as follows:

Romor, F., Torlo, D. and Rozza, G., 2023. Friedrichs' systems discretized with the Discontinuous Galerkin method: domain decomposable model order reduction and Graph Neural Networks approximating vanishing viscosity solutions. arXiv preprint arXiv:2308.03378.

Or if you use LaTeX:

@article{romor2023friedrichs,
  title={Friedrichs' systems discretized with the Discontinuous Galerkin method: domain decomposable model order reduction and Graph Neural Networks approximating vanishing viscosity solutions},
  author={Romor, Francesco and Torlo, Davide and Rozza, Gianluigi},
  journal={arXiv preprint arXiv:2308.03378},
  year={2023}
}

Authors and contributors

The authors of the reported results are

under the supervision of Prof. Gianluigi Rozza.

Contact us by email for further information or questions, or suggest pull requests. Contributions improving either the code or the documentation are welcome!

License

See the LICENSE file for license rights and limitations (MIT).

About

Vanishing Viscosity solution predicting Graph Neural Networks and Domain Decomposable Reduced Order Models based on the Discontinuous Galerking method applied to Friedrichs' systems

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published