File: SaveHB_sample.edp

package info (click to toggle)
freefem%2B%2B 3.61.1%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,108 kB
  • sloc: cpp: 141,214; ansic: 28,664; sh: 4,925; makefile: 3,142; fortran: 1,171; perl: 844; awk: 290; php: 199; pascal: 41; f90: 32
file content (21 lines) | stat: -rw-r--r-- 456 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -*- FreeFem++ -*-
// Sample of SaveHB
// Author: fujiwara@acs.i.kyoto-u.ac.jp
mesh Th = square(3,3);
macro Grad(u) [dx(u),dy(u)] // EOM

fespace Vh(Th,P1);
varf vP(u,v) = int2d(Th)(Grad(u)'*Grad(v)) + int2d(Th)(v) + on(1,u=1);

matrix A = vP(Vh,Vh);
real[int] rhs = vP(0,Vh);

load "SaveHB" 
int ret = SaveHB("sample.hb", A, rhs, "sample of SaveHB");

cout << " A = " << A << endl;
cout << " rhs  = " << rhs << endl;

assert(ret == 0); 

// End of file