[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ff3d-users] Question on the solver 'solve'
From: |
Arun Viswanathan |
Subject: |
Re: [ff3d-users] Question on the solver 'solve' |
Date: |
Thu, 12 Aug 2004 16:28:35 -0700 (PDT) |
Hey Stephane, thanks for your reply. I am now able to
print-out the concentration values for specific
vertices. My attempt now is to use an 'if' condition
based on the concentration at a vertex, so that part
of the code is run only if the concentration exceeds a
certain value. This works if I use concentration in
the second if-loop, but doesn't work when I use it in
the first if-loop?! Why??
My solver is broken up to 2 parts and I am currently
controling which part runs based on the iterations
(please refer to code snippet attached below). I am
trying to use concentration values instead of
iteration number here. I tried it but I get syntax
errors. Could you please take a look at my code and
give me any further suggestions?
Thanks, best regards,
Arun.
----------------Solver part below------------------
for (i=0; i<20; i++)
{
cout << "\nIteration no. " << i+1 << "\n";
/*if (C(0.902,1.26,0.819) <= 0.38)*/ /* Syntax error:
"C" unexpected */
if (i <= 10)
{
solve(C) in O2 by M
{
pde(C)
C - div(D*dt*grad(C)) = C0; /* Equation: dC/dt
= D
* d/dx(dC/dx) */
dnu(C) = 0 on M;
al*C + dnu(C) = 0.5 on Sphere;
};
cout << C(0.902,1.26,0.819);
cout << C(0.984,1.26,0.819);
}
if (C(0.902,1.26,0.819) > 0.38) /* Works fine here */
// if (i > 10)
{
solve(C) in O2 by M
{
pde(C)
C - div(D*dt*grad(C)) = C0; /* Equation: dC/dt
=
D * d/dx(dC/dx) */
dnu(C) = 0 on M;
};
}
C0 = C;
}
---------------------------------------------------
--- Stephane Del Pino <address@hidden> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Le Wednesday 11 August 2004 01:47, Arun Viswanathan
> a écrit :
> > Hi!! I am solving for a variable in the solver and
> I
> > want to monitor the value of that variable at the
> end
> > of each solver iteration. My solver is set up as:
> >
> > solve(C) in <domain> by <mesh>
> >
> > I tried using "cout << C;" at the end of the
> solver,
> > but get an error that says " ';' unexpected".
> Could
> > anybody please tell me if it is possible to
> monitor
> > the value of the variable being solved for, and if
> so,
> > how?? I would also like to know if it is possible
> to
> > use this variable ("C" in this case) in a for-loop
> > condition??
> >
> > Would appreciate any suggestions and ideas.
> Dear Arun.
> writing function is not implemented since what
> should be done is not clear.
> Ploting "standard" functions and fem functions can
> be very different: In the
> first case we can just plot the function definition,
> in the second, should we
> plot the functions values on its mesh definition?
> This could be a strategy, but what should we do if
> someone does this for
> instance:
> function sum = f+g;
> cout << sum;
> where f and g are 2 FEM functions defined on
> different meshes...
>
> Maybe I should replace this syntax error by
> something nicer, but no more.
>
> By the way, if you are interested by the values of
> the function, you can
> proceed as follows:
>
> for (i=0 ; i<nx ; i++) {
> x0=a0+i*hx;
> for (j=0 ; j<nx ; j++) {
> x1=a1+j*hy;
> for (k=0 ; k<nx ; k++) {
> x2=a2+k*hz;
> cout << C(x0,x1,x2) << "\n";
> }
> }
> }
>
> where you have to define a0,...,hz to fit your
> needs. The trick is that we ask
> explicitly to plot the values...
>
> Best regards,
> Stephane.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.5 (GNU/Linux)
>
>
iD8DBQFBGeREbZyhKhZwdc0RAjtYAKCKS7+FABBHuJLgcQjlgr69iwpVyACeJYZM
> fIcUX55GdYYyHRTcaEXVGL4=
> =EgHr
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> ff3d-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/ff3d-users
>
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail