• Skip navigation
  • Skip to navigation
  • Skip to the bottom
Simulate organization breadcrumb open Simulate organization breadcrumb close
Friedrich-Alexander-Universität Professur für Numerische Simulation und Hochleistungsrechnen NSHPC
  • FAUTo the central FAU website
  1. Friedrich-Alexander University
  2. Faculty of Engineering
  3. Department of Computer Science
Suche öffnen
  • Campo
  • StudOn
  • FAUdir
  • Jobs
  • Map
  • Help
  1. Friedrich-Alexander University
  2. Faculty of Engineering
  3. Department of Computer Science
Friedrich-Alexander-Universität Professur für Numerische Simulation und Hochleistungsrechnen NSHPC
Navigation Navigation close
  • Group
    • Travel and venue information
    • Staff
    • Templates
    Portal Contact
  • Research
    • Conferences
    • Publications
    • Research projects
    • Software
    Portal Research
  • Teaching
  1. Home
  2. Research
  3. Software
  4. ExPDE
  5. Staggered grids

Staggered grids

In page navigation: Research
  • Conferences
  • Publications
  • Research projects
  • Scientific Computing
  • Software
    • ExPDE
      • Colsamm
      • EasyExtemps
      • ExPDE library
      • Staggered grids
      • Unstructured block grids
  • Student Theses

Staggered grids

  • Example
  • Download
  • Handbook
Staggered_grid grid( N_, N_, N_ , {0., 0., 0.}, {1., 1., 1.}, periodic, periodic, periodic );

Variable<double, not_staggered, not_staggered, not_staggered> u( grid );
Variable<double, not_staggered, not_staggered, not_staggered> u_ex( grid );
Variable<double, not_staggered, not_staggered, not_staggered> err( grid );

Coordinate<_X_> X( grid );
Coordinate<_Y_> Y( grid );
Coordinate<_Z_> Z( grid );

Function<double, double> Sin( std::sin );
Function<double, double> Sinh( std::sinh );

u_ex = Sin( X * M_PI ) * Sinh( Y * M_PI ); // exact solution
u = u_ex;

for ( size_t i = 0; i < iterations; ++i )
{
u = ( E( E( u ) ) + W( W( u ) ) + N( N( u ) ) + S( S( u ) ) + T( T( u ) ) + D( D( u ) ) ) / 6.0;

err = u - u_ex;

std::cout << "Error: " << Math::L_infty( err ) << std::endl;
;}
Professur für Numerische Simulation und Hochleistungsrechnen
System simulation

Cauerstraße 11
91058 Erlangen
Germany
  • Imprint
  • Privacy
  • Accessibility
  • Facebook
  • RSS Feed
  • Twitter
  • Xing
Up