ff3d-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ff3d-users] questions... :)


From: Pascal Havé
Subject: Re: [ff3d-users] questions... :)
Date: Sat, 1 May 2004 17:15:38 +0200
User-agent: KMail/1.6.2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hello,

Le Friday 30 April 2004 16:22, address@hidden a écrit :
> I have a question and I hope somebody will help me, please. I would
> like to define a function, in a code of mine made in ff3d, which is not
> dependent on the spatial coordinates x,y and z but dependent on a
> general variable, say k. So if I define a function in C or C++ I have
> just to write something like
>
> double f(double k)
> {
> // this function returns the cube of k
>  return k*k*k;
> }
>
> Is it possible to do something similar in FreeFEM3D? Can somebody
> explain me how and, possibly, send me aone or more examples? Thanks
> very much to anybody will help me!!

As has said Stephane, this is not possible is the sense you expect. 
However, it is possible to use a "trick" which may be something like

function cube = x*x*x; // function independent of y and z
cout << cube(2,0,0) << "\n"; // fake arguments for y and z

By this way, you can define user functions with N real arguments (N<=3),
and (3-N) fake arguments. Each call of these functions requires 3 
arguments mapped in parameter names x,y,z in this order.

Pascal.
- -- 
| Pascal Havé
| Laboratoire Jacques-Louis Lions
| Université Pierre et Marie Curie
| Boite courrier 187, 75252  Paris cedex 05 FRANCE
| (express mail) 175 rue du Chevaleret, 75013 Paris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAk78bmhLInsKdD4IRAkM9AJ9mcCPt8vUshQT59AKJVjKXWfd+IwCg4b2W
a8fTxbrvsH3XEy8ChPYCML4=
=5Rc2
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]