Comments (4)
Partly because we prefer to keep these operations at a high level through the FE variable interface. It's not obvious how to map the pressure to the v mesh unless you have access to the interpolation functions
Sent from my iPhone
On 30 Sep 2015, at 4:35 PM, Luke Mondy <[email protected]mailto:[email protected]> wrote:
Sorry for the spamming!
Here's what I do:
dim = 2
ires = 96
jres = 48
xmin, xmax = -200e3, 200e3
ymin, ymax = -160e3, 15e3
elementMesh = uw.mesh.FeMesh_Cartesian(elementType = 'Q1/dQ0',
elementRes = (ires, jres),
minCoord = (xmin, ymin),
maxCoord = (xmax, ymax))
linearMesh = elementMesh
constantMesh = elementMesh.subMesh
print linearMesh.specialSets.keys()
print constantMesh.specialSets.keys()
Output:
['MaxI_VertexSet', 'MinI_VertexSet', 'AllWalls', 'MinJ_VertexSet', 'MaxJ_VertexSet', 'Empty']
{}
I know it's more of cell than a vertex for dQ0, but it would be useful to have. For example, I'm trying to get the average pressure along a wall:
np.average(pressureField[constantMesh.specialSets["MaxJ_VertexSet"]])
and it fails on a KeyError.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/7.
from underworld2.
Right, I see, something more like this?
np.average(pressureField.data.reshape((jres, ires))[-1,:]) # get the average pressure at the top of the domain.
Just a note - the above is slightly confusing, as numpy uses matrix row col ordering, where as the elements are x y, so some backwards indexing is required.
Cheers!
from underworld2.
Luke you can also do a volume integral, but only over the required element. Something like this perhaps
pressure_element_integral = uw.utils.Integral( feMesh=linearMesh, fn=pressureField*fn.branch.conditional({ fn.input[1] < (minY + elementHeight) : 1.,
True: 0. } ) )
result = pressure_element_integral.evaluate() / elementHeight
This will also work in parallel. We will have surface integrals up and running shortly.
from underworld2.
One real disadvantage of the numpy interface is having to handle communication explicitly (closely followed by loss of information about the context of the array data).
The surface integral approach is the obvious way to go. The trickiness of the implementation is a warning to me that if we don’t do it in the C code, then it will be badly butchered in a thousand different python codes !
L
On 30 September 2015 at 5:38:13 pm, jmansour ([email protected]:[email protected]) wrote:
This will also work in parallel. We will have surface integrals up and running shortly.
Professor Louis Moresi
[email protected]://mailto:[email protected]/
(w) +61 3 8344 1217tel://8344%201217
(m) +61 4 0333 1413tel://0333%201413
(us) +1 505 349 4425tel://349%204425
www.moresi.infohttp://www.moresi.info/
www.facebook.com/underworldcodehttp://www.facebook.com/underworldcode
from underworld2.
Related Issues (20)
- Trouble porting model from 1 to multiple mpi ranks HOT 3
- Weird question when loading variable HOT 2
- Increase resolution in a specific area HOT 2
- The influence of mesh resolution HOT 7
- HDF5: infinite loop error on Setonix (using singularity/3.8.6-mpi) HOT 5
- Melt in UWGeodyanmics Heat Eq. HOT 1
- About Material participation movement problem HOT 3
- How to set an elevation with a height variation in coupling model of uwGeodynamics and badlands HOT 2
- RuntimeError: There were left over keyword arguments. kwargs = [{'_fn_fssa': None}]
- communication between the UW2 model and the Badlands surface processes model
- UWGeodynamics velocitySurface_2D Bug HOT 1
- Coupled Evolution of Deformation, Pore Fluid Pressure, and Fluid Flow in the thrust-fold mountain belt ? HOT 4
- Uncoupled temperature and compositional field in UW Geodynamics HOT 2
- Adding two plasticities to one material HOT 3
- SystemError: <built-in function SystemLinearEquations_UpdateSolutionOntoNodes> returned a result with an exception set HOT 1
- Parallel computing and An installation problem (MpiRun) HOT 4
- 'surface' integration HOT 2
- Model.mesh.deform_mesh() error with mpirun. Possibly two nodes are in an identical location.
- Installation error HOT 11
- Compressible mantle convection with tala approximation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from underworld2.