set_quantity()
Dongxueyang opened this issue · 3 comments
Hi all:
@stoiver
I want to use a polygon to set stage and I write like this in model file:
polygon = anuga.read_polygon('extent.csv')
domain.set_quantity('stage',polygon)
I know it was wrong. But I do not know which parameters should I prepare to input this function.
So is it possible to set const stage inside a polygon. (I see polygon in file quantity.py about the function set_quantity())
And what is the format of polygon file. which information should be included in polygon file.
Best regards
dong
@Dongxueyang the following should work to set the stage within the polygon to a value.
polygon = anuga.read_polygon('extent.csv')
domain.set_quantity('stage',numeric = value, polygon=polygon)
There is another procedure Set_stage which actually creates an object which will set teh stage when required.
stage_setter = Set_stage(domain, stage=value, polygon=polygon)
then later do this
stage_setter()
to actually set the centroids within the polygon to the given value (which can be a function of x,y
@stoiver Thanks a lot. Your adivece is helpful and my porblem has been solved. Best regards.
@stoiver
I have a question about the boundary types.
I find about 10 boundary types in file anuga/shallow_water/boundaries.py.
I can get several examples about some types of them. But not all.
And now I am interested in Inflow_boundary(Boundary). I want to set a inlet boundary in a polylines or a polygonal region and controlled by flow(m3/s)(function with time) based on this boundary type. It is better If I can read flow-time information from file.csv.
So is it possible to achieve what I want? Is there some example about the Inflow_boundary() can be referred?
Thanks your help so long time.
Best regards
dong