Giter VIP home page Giter VIP logo

pressio / pressio-tutorials Goto Github PK

View Code? Open in Web Editor NEW
5.0 7.0 1.0 35.39 MB

Tutorials for the C++ pressio library

License: Other

CMake 0.88% C++ 89.48% Shell 0.17% C 0.86% Python 3.89% Starlark 0.11% Makefile 0.01% JavaScript 0.22% CSS 0.17% HTML 4.22%
snl-applications snl-science-libs cpp dynamical-systems galerkin uq surrogate-modelling model-reduction-techniques snl-science projection

pressio-tutorials's Introduction

pressio-tutorials's People

Contributors

eparish1 avatar fnrizzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

antoinemeyer5

pressio-tutorials's Issues

update default galerkin tutorial

  • see this
  • remove the defintion and figures which should go into the manual or something else
  • also add description on how to solve via implicit time stepping

Galerkin explicit time stepping

add tutorial showing galerkin using random data and a FOM that not necessarily has any physical meaning.
The point of the tutorial is to show the pieces needed

  • case for types that are already supported in pressio
  • case for types not known to pressio so they must be user-supplied

swe2d end-to-end

@eparish1 can you please use this issue to track progress for this tutorial?
and when you are ready open merge request

end2end: ensure all drivers support the dryrun option

what we need to do

check if all these support --dryrun=True cmd line arg. If not, then add support for that (separate PR for each)
That option is useful if one wants to check overall what happens but wihtout running expensive things.
If enabled, the scripts should run without producing any data, but just setting up the directory structure and inputs file.

  • wf_foms.py,
  • wf_galerkin.py
  • wf_offline_rom.py
  • wf_reconstruct_on_full_mesh.py

end2end: add tests for workflow scripts with just dryrun enabled

BEFORE this, we need to complete #27

ensure the workflow scripts execute the correct steps and product the correct dir structure.
To do this, for each driver script, we want to test various workflows by setting up combinations of workflow yaml files.
We can start from the yaml files arelady in the end-to-end-roms subdirs but need to test various combinations that exercise the workflow drivers properly.

end2end drivers: cleanup/propose new solution for first part of the driver

can we do this better?
The only constraint we have is that a driver file HAS be run from within the build directory.

  # set working directory to where we call this file from
  workDirFullPath = os.path.realpath(".")
  print("workingDir =", workDirFullPath)

  # ensure this is NEVER called directly from the tutorials repo
  # because we want to this to be called from within the build
  # directory of the tutorials or any other place
  # except the tutorials source.
  if is_git_repo(workDirFullPath):
    print("you cannot run this script from the tutorials repo!")
    sys.exit(23)

  # find full path to the top-level tutorials repo
  ptutRepoFullPath = str(os.path.split(os.path.dirname(__file__))[0])
  print("PTUT repo  =", ptutRepoFullPath)
  ptutRepoEndToEndFullPath = ptutRepoFullPath + '/end-to-end-roms'

  # read the full workflow dic
  wfDic = read_workflow_yaml_file(workDirFullPath+'/'+wfFile)
  assert_valid_and_supported_problem(wfDic, ptutRepoEndToEndFullPath)
  problemName = find_problem_name_from_wf_dic(wfDic)

  # import customizations from target problem
  # we can do this safely because we already asserted customization exists
  moduleName = 'customizations_'+problemName
  sys.path.append(os.path.realpath(ptutRepoEndToEndFullPath+'/'+moduleName))
  print("Loading customizations from {}".format(moduleName))
  customModule = importlib.import_module(moduleName)

pressio-tutorials installation cannot find pressio

I'm trying to install and build the pressio-tutorial examples as per the instructions provided at

https://pressio.github.io/pressio-tutorials/build.html

I have PRESSIO_SRC set to the right path.

I am getting errors of the following type:

/mnt/c/Work/Ubuntu/Software/github/pressio-tutorials/ode-using-eigen-types/main1.cc:48:10: fatal error: pressio/ode_advancers.hpp: No such file or directory
48 | #include "pressio/ode_advancers.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
/mnt/c/Work/Ubuntu/Software/github/pressio-tutorials/ode-using-eigen-types/tutorial2/main.cc:48:10: fatal error: pressio/ode_advancers.hpp: No such file or directory
48 | #include "pressio/ode_advancers.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [ode-using-eigen-types/CMakeFiles/ode_eigen_exe1.dir/build.make:76: ode-using-eigen-types/CMakeFiles/ode_eigen_exe1.dir/main1.cc.o] Error 1
make[2]: *** [ode-using-eigen-types/tutorial2/CMakeFiles/ode_eigen_exe2.dir/build.make:76: ode-using-eigen-types/tutorial2/CMakeFiles/ode_eigen_exe2.dir/main.cc.o] Error 1
/mnt/c/Work/Ubuntu/Software/github/pressio-tutorials/ode-using-eigen-types/tutorial3/main.cc:48:10: fatal error: pressio/ode_advancers.hpp: No such file or directory
48 | #include "pressio/ode_advancers.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~

[ 72%] Built target yaml-cpp
make: *** [Makefile:101: all] Error 2

The headers appear to be in

/mnt/c/Work/Ubuntu/Software/github/pressio/install/include/pressio

What am I missing? Is there a way to provide the headers to CMAke?

Thanks,

Nachiket

break apart all.py logically

end-to-end-roms/all.py cntains lots of functions. I like to separate them into multiple files logically.
And of course, the wf_*.py drivers have to be updated as a consequence.

list of tutorials to add [do not close]

  • solvers_nonlinear

    • newton-raphson
    • newton-raphson custom types
    • gauss-newton
    • gauss-newton custom types
    • gauss-newtonQR
    • gauss-newtonQR custom types
    • lm
    • lm custom types
  • ode_advancers

    • advance_n_times
    • advance_n_times_and_observe
    • advance_n_times with custom dt setter
    • advance_n_times_and_observe with custom dt setter and
  • ode_steppers

    • explicit
    • explicit custom types
    • implicit
    • implicit custom types
  • rom

    • linear decoder
    • custom decoder
    • galerkin
    • etc

naming convention

  • default galerkin:

  • hyperreduced galerkin

  • masked galerkin

  • default lspg

  • masked lspg

  • hyperreduced galerkin

move descriptions from tutorials source files to the website

The currrent code in the tutorials contains lots of descriptions/comments, which is more suited to be moved to the website which actually described the tutorial. This way the code becomes more readable, we have more flexibility to edit the descriptions and don't need to change the source files.

add CI support

should be simple enough to setup since we just need to follow the build instructions of the website

how to do 2D Burgers hyperreduction?

I've been able to install pressio-tutorials and I'm able to run 2D SWE: hyper-reduced LSPG

https://pressio.github.io/pressio-tutorials/endtoend/swe_lspg_hypred_1.html

I've been able to install pressio-demoapps and I've been able to run the 2d Burgers' code

https://pressio.github.io/pressio-demoapps/burgers_2d_periodic.html

How would I go about doing hyper-reduction for 2D Burgers? Do I just need a new workflow file? Or, do I need to modify the driver files (wf_foms.py etc) residing in the following directory?

https://github.com/Pressio/pressio-tutorials/tree/develop/end-to-end-roms

Or, is there something else I need to do?

Thanks,

Nachiket

handling dependencies

This code has a few dependencies that are currently snapshotted inside the repo itself, either by copy the whole code or via github submodules.
I would like to change this somehow. I don't yet know the best way so I like a few options proposed.

IMPORTANT: the reference branch to work off is develop since main is old and not updated.

tutorial3 compilation error

Tutorials 1 and 2 compile and run fine. Tutorial 3 gives the following error:

install/include/ode/src/explicit/./impl/ode_explicit_euler_stepper_impl.hpp:178:5: error: no matching function for call to 'update'
::pressio::ops::update(stateInOut, one, auxRhs0, dt);

FYI, I am using a custom builder, not cmake.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.