Git Product home page Git Product logo

Comments (7)

gonuke avatar gonuke commented on September 16, 2024

See MOAB/iTaps methods for this: I think they are called ''measure"

from r2s-act.

erelson avatar erelson commented on September 16, 2024

Looks like the relevant code is measure_volume() in MOAB/src/trunk/tools/dagmc/DagMC.cpp. This function supports only triangular-faceted polyhedra.

For now, I will use the code I have working within Fortran (a local branch), which makes testing and inclusions simpler to deal with.

from r2s-act.

gonuke avatar gonuke commented on September 16, 2024

I'm not sure why it lives in MOAB/src/trunk/tools/ but measure.[hc]pp does it all (I think).

from r2s-act.

erelson avatar erelson commented on September 16, 2024

Ahh, I see that now. I was tracing from what DAG-MCNP calls, and so did not stumble upon measure().

The challenge in my case is that measure() is not part of the iTaps API, and is thus trickier to call from Fortran.

from r2s-act.

erelson avatar erelson commented on September 16, 2024

Current implementation for hexahedra duplicates the approach in measure() - calculate volumes of 5 tetrahedra within the hex. Since the hexahedra are limited to being parallelepipeds (#46), there may be a slightly more efficient volume method to be found, since parallelepipeds are a specific subset of quad-faceted hexahedra.

from r2s-act.

erelson avatar erelson commented on September 16, 2024

Determined today that the tetrahedral volume formula from Wikipedia, V=abs( (a-d) . ((b-d) x (c-d)) ) / 6 seems to work except when it gives a volume of zero (namely a=1,0,0; b=0,1,0; c=0,0,1; d=1,1,1;). I will look more closely at the method used in measure.cpp. I got Mathematica's cross product operator confused, and so was incorrectly calculating the volume.

from r2s-act.

erelson avatar erelson commented on September 16, 2024

In Python, the PyTaps example gives us the necessary code:
http://pythonhosted.org/PyTAPS/tutorial/example.html?highlight=volume

The three relevant functions have been added to write_alara_geom.py.

from r2s-act.

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.