CGAL, eigen, suitesparse, cmake tweaking

A very technical summary of the changes I had to introduce in CMakeLists.txt in order to include correctly the eigen libs, then the suitesparse libs.

Continue reading

Advertisements

Sparse Poisson problem in eigen

OwlgenBack to scientific computing. Lately, I have been using the Eigen libraries for linear algebra. They were recommended by the CGAL project, and they indeed share a common philosophy. Thanks to the rather high C++ level they can accomplish this sort of magic:


  int n = 100;
  VectorXd x(n), b(n);
  SpMat A(n,n);

  fill_A(A);

  fill_b(b);

  // solve Ax = b
  Eigen::BiCGSTAB<SpMat> solver;
  //ConjugateGradient<SpMat> solver;

  solver.compute(A);

  x = solver.solveWithGuess(b,x0);

Notice that A is a sparse matrix! I am next describing how to use this in order to solve the 1D Poisson equation.

Continue reading

OpenFOAM cheatlist

A quick cheatsheet for OpenFOAM. In italics, things that are useful but not part of OpenFOAM proper. Interesting read: The OpenFOAM Technology Primer

Sites

Shortcuts to directories

(type “alias” to reveal these)

  • run (go to own’s running directory)
  • foam
  • foamfv
  • foam3rdParty (hit <tab> for these longish commands!)
  • tut
  • app
  • sol
  • util
  • lib
  • src

Environment variables

  • echo $FOAM_ <tab>  (directories)
  • echo $WM_ <tab>  (building, aka compiling, settings)

Mesh

  • Generation
  • Import / export
    • foamMeshToFluent
    • fluentMeshToFoam, etc …
  • Operations
    • refineHexMesh
    • transformPoints
    • makeAxialMesh
    • collapseEdges
    • autoPatch
    • mirorMesh
  • Properties
    • checkMesh

Fields

  • setFields
  • topoSet
  • patchAverage
  • patchIntegrate
  • vorticity
  • yPlusRAS
  • yPlusLES
  • boxTurb
  • applyBoundaryLayer
  • R
  • wallShearStress

Help

  • foamHelp (e.g. foamHelp boudary -field U)

Postprocessing

  • sample
  • paraview
  • probeLocations

Solvers

  • icoFoam
  • interFoam
  • many, many others

Running

  • foamJob
  • decomposePar
  • reconstructPar
  • mpirun
  • nohup

Building

  • foamNew source App …
  • doxygen doxyfile
  • gdb
  • valgrind
  • wmake
  • wclean
  • aliases for settings: wm32, wm64, wmSP, wmDP, wmSET, wmUNSET

Sorting eivenvectors in octave

A brief note. Doing ee= eig(m); produces a vector with all eigenvalues of matrix m. These are unsorted, so ee=sort(eig(m)); produces a vector with a sorted list of all eigenvalues of matrix m.

If we want the eigenvectors, [vv,eed]=eig(m); produces a diagonal matrix eed whose elements are the same as ee, and are unsorted. Who to produce a sorted vector with the eigenvalues, and re-order the eigenvectors accordingly? Thus:

[vv,eed]=eig(m);

[ee,perm] = sort(diag(eed));

vv=vv(:,perm);

Anime for grown-ups

I didn’t want to write “for adults”…

A list of very interesting anime movie for grown-ups, from classics to now. I’m staying off Ghibli here, which imho are a must see, all of them. Including, of course When Marnie was There, a gem.

Many are of these are from Madhouse, a studio that has produced many fine films and may become the best studio if Ghibli ceases to produce films.

Classics

  • Akira (1988)
  • Blood The Last Vampire (2000)
  • Patlabor 2 (1993)

Keiichi Hara

Hiroyuki Okiura

Mamoru Hosoda

  • The Girl Who Leapt Through Time
  • Summer Wars
  • Wolf Children
  • Bakemono no Ko

Cowboy Bebop saga

  • Cowboy Bebop, TV series (1998)
  • Cowboy Bebop The Movie  — Knockin’ On Heaven’s Door
  • Samurai Champloo TV Series, also by Shinichirō Watanabe

NGE saga

  • Neon Genesis Evangelion. Original TV series.
  • Evangelion movies…

Ghost in the Shell saga

  • Ghost In The Shell (1995). Original TV series.
  • Ghost in the Shell Stand Alone Complex TV Series

Makoto Shinkai… sunsets galore

  • Hoshi No Koe (The Voices Of A Distant Star)
  • Kumo no Mukou, Yakusoku no Basho (The Place Promised in Our Early Days)
  • The Garden of Words (2013)
  • 5 Centimeters Per Second
  • Children Who Chase Lost Voices From Deep Below (2011)

Satoshi Kon

  • Paprika
  • Tokyo godfathers
  • Paranoia Agent, TV series
  • Millennium Actress

Others (unsorted yet)

  • Piano Forest – Piano no Mori (2007)
  • Tekkon Kinkreet (2006)
  • Time Of Eve
  • Persona 3 the Movie-1-Spring of Birth
  • Hotarubi no Mori e
  • The animatrix

A selection for smaller children:

  • Friends. Mononokeshima.no.Naki (2011)
  • Mai Mai Miracle (2009)
  • Patema Inverted
  • Welcome to the Space Show
  • Ronja (ok, this one’s Ghibli, but it’s not so well known)