Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_quantity() #208

Open
Dongxueyang opened this issue Aug 29, 2019 · 3 comments
Open

set_quantity() #208

Dongxueyang opened this issue Aug 29, 2019 · 3 comments

Comments

@Dongxueyang
Copy link

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

@stoiver
Copy link
Member

stoiver commented Aug 29, 2019

@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

@Dongxueyang
Copy link
Author

@stoiver Thanks a lot. Your adivece is helpful and my porblem has been solved. Best regards.

@Dongxueyang
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants