Git Product home page Git Product logo

numerical-solutions-to-stokes-equation's Introduction

Numerical Linear Algebra: Numerical solutions to Stokes Equation

This repository implements the final project for the course Numerical Linear Algebra in Autumn 2018. Submitted version.

Description of codes

The main codes of my implementations are stored under 'Matlab_Code'. Certain auxiliary programs which help us build the matrix for the problem are catogorized into components. The notations are consistent with my report.

The main program is VCycle.m . It implements V-Cycle multigrid method to solve the saddle point problem, which is the discretization of the Stokes Equation.

The smoothers contain:

  • DGS-p (in Long Chen's paper): DGS.m.
  • DGS-s (in the notes): DGS_seq.m and DGS_seqM.m. Their inner loop programs are DGS_InnerC2.c and DGS_InnerM.m . The former is implemented in C and the latter is implemenented in Matlab. DGS_InnerC.c is the history version of DGS_InnerC2.c.
  • Uzawa: Uzawa.m. We simply use \ in Matlab to solve the subproblem.
  • Inexact Uzawa: Inexact_Uzawa.m. We call CG_solver.m to solve the subproblem.

We also implement Inexact Uzawa based on V-Cycle multi-grid. The main program is ieuzawaVC.m. We use V-Cycle multi-grid method to solve the subproblem. This is implemented in VCycle_Inner.m. The smoother for V-Cycle is Gauss-Seidel Iteration, which is implemented in GS.m.

In Appendix, we propose a modified V-Cycle multi-grid method based on DGS. The main program is VCycle_mod.m. The smoothers contain:

  • DGS-p(in Long Chen's paper): DGS_mod.m.

  • DGS-s (in the notes): DGS_seqM_mod.m. Its innner loop program is DGS_InnerM_mod.m

How to run the codes

To run the codes, first, please use MEX in Matlab to compile DGS_innerC2.c in the following way:

mex DGS_innerC2.c

To recover the results for DGS-s and DGS-p, please run:

  • $N=64, 128, 256$: Test_DGS1.m (DGS-s), Test_DGS2.m (DGS-p);
  • $N=512, 1024, 2048$: Test_DGS3.m (DGS-s), Test_DGS4.m (DGS-p).

To recover the results for Uzawa, please run:

  • $N = 64, 128$ : Test_uzawa.m

  • $N = 256, 512$ : Test_uzawa2.m

  • $N = 1024, 2048$ : Test_uzawa3.m

To recover the results for Inexact Uzawa, please run:

  • $N = 64, 128$ : Test_ieuzawa.m

  • $N = 256, 512$ : Test_ieuzawa2.m

  • $N = 1024, 2048$ : Test_ieuzawa3.m

To recover the results for Inexact Uzawa based on V-Cycle, please run:

  • $N = 64, 128$ : Test_ieuzawaVC.m

  • $N = 256, 512$ : Test_ieuzawaVC2.m

  • $N = 1024, 2048$ : Test_ieuzawaVC3.m

Catogory

Our Matlab programs are generally catogorized as follows:

bnd

'comp_*.m' generates the vector to describe the Neurman boundary condition

comp

'comp_*.m' generates matrix which is component in the formulation of saddle point problem.

spp

'comp_*.m' generates matrix in the saddle point problem

test

'test_*.m' implements the numerical experiements in the report

true

'true_*.m' returns the true value of the function

numerical-solutions-to-stokes-equation's People

Contributors

yiifeiwang avatar

Watchers

 avatar

Forkers

chspku

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.