/[ff3d]/ff3d/testsuite/check.ph
ViewVC logotype

Diff of /ff3d/testsuite/check.ph

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by ArceneL, Fri Jul 25 14:08:04 2003 UTC revision 1.4 by ArceneL, Mon Aug 4 09:26:42 2003 UTC
# Line 1  Line 1 
1  #  This file is part of ff3d - http://www.freefem.org/ff3d  #  This file is part of ff3d - http://www.freefem.org/ff3d
2    #  Copyright (C) 2003  Laboratoire J.-L. Lions UPMC Paris
3    
4  #  This program is free software; you can redistribute it and/or modify  #  This program is free software; you can redistribute it and/or modify
5  #  it under the terms of the GNU General Public License as published by  #  it under the terms of the GNU General Public License as published by
# Line 46  sub Run{ Line 47  sub Run{
47    
48      # Runs ff3d and stores its output into $output      # Runs ff3d and stores its output into $output
49      $output = `../ff3d test.ff`;      $output = `../ff3d test.ff`;
50      die "*** ff3d could not be run" if $?;      if($?){
51            print $output;
52            die "*** ff3d crashed";
53        }
54  }  }
55    
56  # Checks that one expected result (expressed as a regexp) is present  # Checks that one expected result (expressed as a regexp) is present
# Line 56  sub Run{ Line 60  sub Run{
60  sub LineCheck{  sub LineCheck{
61      my ($expect) = @_;      my ($expect) = @_;
62      if($output !~ /$expect/m){      if($output !~ /$expect/m){
63          print "*** Error: \"$expect\" not found\n";          print "*** Error: Checking regexp \"$expect\" failed\n";
64          $errors += 1;          $errors += 1;
65      }      }
66  }  }
# Line 77  sub NumCheck{ Line 81  sub NumCheck{
81      $prec = 0 unless defined $prec;      $prec = 0 unless defined $prec;
82      die "Precision should be positive" unless $prec >= 0;      die "Precision should be positive" unless $prec >= 0;
83    
84      if($output =~ /$title\s*([0-9\.eE+-]+)/){      if($output =~ /$title\s*([0-9\.eE+-]+)/m){
85          my $value = $1;          my $value = $1;
86    
87          # Is this really a number?          # Is this really a number?
# Line 93  sub NumCheck{ Line 97  sub NumCheck{
97             || ($ref < 0             || ($ref < 0
98                 && ($value < (1+$prec)*$ref || $value > (1-$prec)*$ref))                 && ($value < (1+$prec)*$ref || $value > (1-$prec)*$ref))
99             ){             ){
100              print "*** $title $value should be $ref\n";              print "*** $title$value (it should be $ref +/- $prec)\n";
101              $errors += 1;              $errors += 1;
102          }          }
103      }      }
# Line 157  sphere{ Line 161  sphere{
161  }  }
162    
163  /* One smaller sphere, centered on a test point and intersecting the  /* One smaller sphere, centered on a test point and intersecting the
164  first sphere. A test point is contained in the intersection*/  first sphere. A test point is contained in the intersection */
165    
166  sphere{  sphere{
167          <1,0,0>,0.5          <1,0,0>,0.5
# Line 211  sub DomainCheck{ Line 215  sub DomainCheck{
215  }  }
216    
217  # Builds a domain, then runs a simple differential equation resolution  # Builds a domain, then runs a simple differential equation resolution
218  # to differentiate inside points and outside points.  # to give different values to inside and outside points.
219    
220  sub DomainMeshCheck{  sub DomainMeshCheck{
221    
# Line 242  solve (u) in O by M{ Line 246  solve (u) in O by M{
246      pde(u)      pde(u)
247          -div(grad(u)) = 0;          -div(grad(u)) = 0;
248    
249      // Defines a Dirichlet boundary condition on the domain frontier.      // Defines a Dirichlet boundary condition on the frontier. Its
250        // value is 0 on the outside cube, and 1 on the embedded object.
251        // Therefore, the correct solution for the above problem is one
252        // on all points inside the object, and a value between 0 and 1
253        // at all other points.
254    
255      u = 1 on <1,0,0>;      u = 1 on <1,0,0>;
256      u = 1 on <0,1,0>;      u = 1 on <0,1,0>;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26