[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff3d-users] Code to solve Fixk's law, what's wrong??!!
From: |
Arun Viswanathan |
Subject: |
[ff3d-users] Code to solve Fixk's law, what's wrong??!! |
Date: |
Sat, 8 May 2004 16:54:25 -0700 (PDT) |
Hi all, I wanted to write a code to solve Fick's law
(J=-D dC/dx) in Fem3D. I saw the examples, used the
documentation and came up with this code (below). It
runs, but:
1. I don't know if it is correct, how to check it?
2. I need to enter values for Diffusivity (D) and Flux
(J) for different chemicals, to solve for
Concentration (C), how do I do that?
3. How to use OpenDX to visualize my "p1.dat" file?
Please please help me out with suggestions and
feedback, thanks -- Arun.
**************HERE'S THE CODE**************
// #define D 10
// #define J 20
double D;
double J;
vector n = (10,10,10);
vector a = (0,0,0);
vector b = (4,4,4);
mesh M = structured(n,a,b);
scene S =
pov("/store/localhome/Software/freefem3d-1.0pre4/p1.pov");
domain O = domain(S);
solve(C) in O by M
{
pde(C)
-D * dx(C) = J;
};
save(opendx, "p1.dat", M);
**************HERE'S THE OUTPUT*************
Parsing the file
...........................................................................................................
done
Treating data
Building Mesh ... done
Building Scene ... done
.Parsing
/store/localhome/Software/freefem3d-1.0pre4/p1.pov
done
Scene is composed of 1 objects:
Building Domain ...
Done
Solving Problem:
unknowns: List of unknowns
Problem:
pde(C):
(-0*1)*dx(C) = 0
Problem:
PDE
Using fictitious domain discretization:
Method: Elimination
Solving ...
Adding Characteristic function of the domain to PDEs
... done
Using 1000 vertices over 1000 available!
Discretizing the PDE Problem ... Assembling matrix
done
Assembling cost: Time: 0s CPU Time: 0.11s
Assembling Second Member
done
Discretizing Boundary Conditions
Second Member Modification
Matrix Modification
done
Matrix copy: Time: 0s CPU Time: 0.03s
Solving
Solving the linear system
pcg: iteration 1 gcg= 0
Krylov solver:
Time: 0s CPU Time: 0s
solver finished
Structured3DMesh.cpp:33: Not implemented
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover
- [ff3d-users] Code to solve Fixk's law, what's wrong??!!,
Arun Viswanathan <=