question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The parameter "name" of openpnm.geometry.genericgeometry

See original GitHub issue

Dear, when i use code geo = op.geometry.StickandBall(network=gn, project=proj, pores=gn.Ps, throats=Ts, name='model_1') to construct a geometry, i found the parameter “name”. But i do not know how to use it in operating the network.

Then i want change the network to geo = op.geometry.GenericGeometry(network=gn, project=proj, pores=gn.Ps, throats=Ts, name='model_1'), it tells me that name “model_1” has been used. Then i change the name to “mode1_2”, it tells me that the geometry has been used by “model_1” .

So i think if i can use del to delete the original ones and create a new one. I use del to delete op.geometry.GenericGeometry, still didnot work. Then i del op.geometry, it tells me that ‘AttributeError: module ‘openpnm’ has no attribute ‘geometry’’.

I just want to know how to use this “name” parameter. And i am confused by this parameter.

Thanks for all your guys.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jgostickcommented, Aug 27, 2019

Hi @xu-kai-xu: A1: name is not really necessary, one is generated for you automatically if you don’t provide one. It’s is mostly used internally by openpnm, but is also helpful for you to keep track of objects, for instance you may have a variable named geo but are not sure which object this is, so you can do print(geo.name) to see the unique name of the object.

A2: Once you assign pores and throats to a geometry, openpnm will raise an error if you assign those same locations to a new geometry. You can delete geometries using the following:

proj = geo.project  # This gives you a handle to the project which geo belongs
proj.purge_object(geo)  # This fully clears geo from the project
0reactions
xu-kai-xucommented, Sep 1, 2019

Jeff, @jgostick , I did some demo about the problem, which is based on one of openpnm examples. Please find the attached file. Thanks. The delayed reply is because I missed your message. check_gostick2007.txt

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial 1 of 3: Getting Started with OpenPNM
When storing arrays in an OpenPNM object, their name (or dictionary key) must be prefixed with 'pore.' or 'throat. ... GenericGeometry(network=pn, pores=pn.
Read more >
How to use the openpnm.models.misc function in ... - Snyk
To help you get started, we've selected a few openpnm.models.misc examples, ... network, geometry, phase np.random.seed(0) net = op.network.
Read more >
Basic Usage — OpenPNM 3.1.0 documentation
import openpnm as op # Define geometrical parameters Lc = 1e-4 Nx, Ny, Nz = (10, 10, 10) # Generate network, geometry, phase,...
Read more >
OpenPNM: A Pore Network Modeling Package - CORE
OpenPNM website (openpnm.org) has a continuously growing list of tutorials ... Several subclassed versions of GenericGeometry are included in the package ...
Read more >
OpenPNM: A Pore Network Modeling Package - ResearchGate
only) which offers a convenient way to retrieve a complete list of data that may be dispersed across several objects (Geometry 1 and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found