GithubHelp home page GithubHelp logo

reduced_basis's Introduction

Reduced Basis

With this application reduced basis solutions to Stokes flow with linear rheolgy solved by LaMEM can be created. At the moment it is important, that the src files of LaMEM which are stored in the LaMEM_src_files are used. It is feasible for 2D setups with linear rheology.

Workflow

LaMEM input file

  • FSSA needs to be set to 0
  • in the Petsc options sections the following option must be enabled:
    • -objects_dump
    • -dump_sol
    • -dump_precondition_matrixes
    • -dump_precondition_matrixes_prefix Ass
    • -dump_rhs
    • -dump_rho

Create RB components

  • All ingredients that are needed to access a reduced solution can be produced with the file createRB.m.

  • Steps:

    • specify LaMEM input file / filename of marker routine (e.g setup2D.m) / number of cells in every direction / folder in which RB components should be stored
    • specify input parameter with appropriate ranges
    % parameter 2
    st   = 30;  % smallest parameter value
    en   = 40;  % largest parameter value
    n    = 14;  % parameter spacing
    par2 = linspace(st,en,n);
    
    • add parameter to list
    par = allcomb(par1,par2);
    
    • marker file must be adapted according to the number and type of input parameters (here for file setup2D.m). par is the list that was created by the previous step. In this example par(1) belongs to par1 and is in setup2D.m treated as the variable SubductionAngle1
    function [] = setup2D (par)
    
    SubductionAngle1 = par(1);
    SubductionAngle2 = par(2);
    .
    .
    .
    end
    
    • specify tolerance for greedy algorithm
    tol  = 1e-6;    % tolerance for Greedy algorithm
    

access RB solution

  • the file accessRB.m help to access a RB solution with the previously calculated components
  • Steps:
    • specify LaMEM input file / filename of marker routine (e.g setup2D.m) / number of cells in every direction / folder in which RB components were stored
    • specify if simulation is nondimensional or geo units were used.
      % units: geo or none
      unit = 'geo';
      
    • specify values for the parameters that were selceted in createRB.m
      par1 = 32.456;
      par2 = 36.342;
      
    • creates truth solution, RB solution (creaqted without DEIM) and DEIM solution
      % whole solutions
      u_t    % truth solution   
      u_RB   % RB solution      
      u_DEIM % DEIM solution
      
      % only velocity components
      v_t    % truth solution   
      v_RB   % RB solution      
      v_D    % DEIM solution
      
      
    • some plotting routines are added. Example:
      [V3d_t] = arrange_vel (nel_x, nel_y, nel_z, coordx, coordy, coordz, v_t,'z','xz');  % z velocity is plotted in xz plane
      x     = linspace(0,coordx,nel_x);
      y     = linspace(0,coordz,nel_z+1);         % nel_z +1 velocity nodes in z direction
      [X,Y] = meshgrid(x,y);
      pcolor(X,Y,V3d_t(:,:,2).'); c = colorbar;   %   V3d_t(:,:,n) n decides about the number of the plane which should be plotted 
      

    2D example: double subduction zone

reduced_basis's People

Contributors

christianschuler avatar

Watchers

 avatar

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.