~ubuntu-branches/ubuntu/feisty/libctl/feisty

« back to all changes in this revision

Viewing changes to examples/example.scm

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette
  • Date: 2002-04-17 10:36:45 UTC
  • Revision ID: james.westby@ubuntu.com-20020417103645-29vomjspk4yf4olw
Tags: upstream-2.1
ImportĀ upstreamĀ versionĀ 2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; Copyright (C) 1998, 1999, 2000, 2001, 2002, Steven G. Johnson
 
2
;
 
3
; This file may be used without restriction.  It is in the public
 
4
; domain, and is NOT restricted by the terms of any GNU license.
 
5
;
 
6
; This library is distributed in the hope that it will be useful,
 
7
; but WITHOUT ANY WARRANTY; without even the implied warranty of
 
8
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
9
; Lesser General Public License for more details. 
 
10
 
 
11
(define-class material-type no-parent
 
12
  (define-property epsilon no-default 'number positive?)
 
13
  (define-property conductivity 0.0 'number))
 
14
 
 
15
; use the solid geometry classes, variables, etcetera in libgeom:
 
16
; (one specifications file can include another specifications file)
 
17
(include "../utils/geom.scm")
 
18
 
 
19
; ****************************************************************
 
20
 
 
21
; Add some predefined variables, for convenience:
 
22
 
 
23
(define vacuum (make material-type (epsilon 1.0)))
 
24
(define air vacuum)
 
25
 
 
26
(define infinity 1.0e20) ; big number for infinite dimensions of objects
 
27
 
 
28
(set! default-material air)
 
29
 
 
30
; ****************************************************************
 
31
 
 
32
(define-input-var k-points '() (make-list-type 'vector3))
 
33
 
 
34
(define-input-output-var dummy (vector3 3.7+1.1i 2.3-0.1i 19) 'cvector3)
 
35
 
 
36
(define-output-var mean-dielectric 'number)
 
37
 
 
38
(define-output-var gaps (make-list-type 'number))
 
39
 
 
40
; ****************************************************************
 
41
 
 
42
(define-external-function run-program true true
 
43
  no-return-value)
 
44
 
 
45
(define (run)
 
46
  (set! interactive? #f)  ; don't be interactive if we call (run)
 
47
  (run-program))
 
48
 
 
49
(define-external-function energy-in-object false false
 
50
  'number 'geometric-object)
 
51
 
 
52
(define-external-function list-func-test false false
 
53
  (make-list-type 'vector3) 'number (make-list-type 'integer) 'vector3)
 
54
 
 
55
(define-external-function function-func false false 'number
 
56
  'function 'number)