~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to sandbox/bdm/main.cpp

  • Committer: Johannes Ring
  • Date: 2008-03-05 22:43:06 UTC
  • Revision ID: johannr@simula.no-20080305224306-2npsdyhfdpl2esji
The BIG commit!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2007 Anders Logg and Marie Rognes
 
2
// Licensed under the GNU LGPL Version 2.1.
 
3
//
 
4
// First added:  2007-04-20
 
5
// Last changed: 2007-04-20
 
6
//
 
7
// This demo program solves the mixed formulation of
 
8
// Poisson's equation:
 
9
//
 
10
//     q + grad(u) = 0
 
11
//          div(q) = f
 
12
//
 
13
// The corresponding weak (variational problem)
 
14
//
 
15
//     <v, q> - <div(v), u> = 0       for all v
 
16
//               <w, div q> = <w, f>  for all w
 
17
//
 
18
// is solved using BDM (Brezzi-Douglas-Marini) elements
 
19
// of degree 1 (v, q) and DG (discontinuous Galerkin)
 
20
// elements of degree 0 for (w, u).
 
21
 
 
22
#include <dolfin.h>
 
23
#include "MixedPoisson.h"
 
24
 
 
25
using namespace dolfin;
 
26
 
 
27
int main()
 
28
{
 
29
  UnitSquare mesh(1, 1);
 
30
  Matrix A;
 
31
  MixedPoissonBilinearForm a;
 
32
 
 
33
  // Assemble matrix
 
34
  assemble(A, a, mesh);
 
35
  
 
36
  // Display matrix values
 
37
  A.disp();
 
38
 
 
39
  return 0;
 
40
}