Hi all
I am so sorry to disturb you so much, I am very young in python, in fipy,
sure I lent many thing from you since I decided to use fipy,
I was this example
**************************************************************************************************************
cellSize=0.05
radius=1.
lines= ['cellSize = '+str(cellSize) + ';\in',
'radius ='+str(radius) + ';\in',
'point(1)={0, 0, 0, cellSize};\n',
'point(2)={-radius, 0, 0, cellSize};\n',
'point(3)={0, radius, 0, cellSize};\n',
'point(4)={radius, 0, 0, cellSize};\n',
'point(5)={0, -radius, 0, cellSize};\n',
'point(6)={2, 1, 3};\n',
'point(7)={3, 1, 4};\n',
'point(8)={4, 1, 5};\n',
'circle(9)={5, 1, 2};\n',
'Line Loop(10)={6, 7, 8, 9};\n',
'Plane Surface(11)={10};\n',
import tempfile
(f,geomName)=tempfile.mkstemp('.geo')
file=open(geoName, 'w')
file.writelines(lines)
file.close()
import os
os.close(f)
import sys
if sys.platform=='win32':
meshName='tmp.msh'
else:
(f,mesfName)=tempfile.mkstemp('.msh')
os.system('gmsh'+geomName+'- -v 0 -format msh -o'+meshName)
if sys.platform!='win32':
os.close(f)
os.remove(geomName)
from fipy.meshes.gmshImport import GmshImporter2D
mesh=GmshImporter2D(meshName)
os.remove(meshName)
from fipy.variables.cellVariable import CellVariable
phi=CellVariable(name='solution variable', mesh=mesh, value=0)
viewer=none
if __name__=='__main__'
try:
from fipy.viewers.gistViewers.gist2DViewer import Gist2DViewer
viewer=Gist2DViewer(vars=phi,limits={'datamin':-1,
'datamax':1.})
viewer.plotMesh()
raw_input("Irregular circular mesh. Press <return> to
proceed...")
except:
print "Unable to create a Gist2DViewer"
D=1.
from fipy.terms.transientTerm import TransientTerm
from fipy.terms.implicitDiffusionTerm import ImplicitDiffusionTerm
eq=TransientTerm()==ImplicitDiffusionTerm(coeff=D)
from fipy.tools import numerix
exterirorXcoords=numerix.take(mesh.getFaceCenters()[...,0],mesh.getExteriorFaces())
from fipy.boundaryConditions.fixedValue import FixedValue
BCs=(FixedValue(faces=mesh.getExteriorFaces(), value=exteriorXcoords),)
timeStepDuration=10*0.9*cellSize**2/(2*D)
steps=10
for step in range(steps):
eq.solve(var=phi,boundaryConditionsStepDuration,dt=timeStepDuration)
if viewer is none:
viewer.plot()
****************************************************************************************
when running this programme I have the error message saying that
syntaxe error where it is in red in the above code, then i can not run the
code.
Thanks again for your help
Regards