Git Product home page Git Product logo

Comments (4)

lmoresi avatar lmoresi commented on September 4, 2024

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.

OlympusMonds avatar OlympusMonds commented on September 4, 2024

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.

jmansour avatar jmansour commented on September 4, 2024

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.

lmoresi avatar lmoresi commented on September 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.