Comments (4)
The question is whether Quantity
class should be separate class, or it can simply be a Field
class to which unit is assigned. It is maybe not a smart solution to have a constant scalar field object just to represent A=8.87e-12
for example, but we should somehow take into account spatially varying parameters, which can be easily represented with scalar fields.
from ubermag.
The Field
class could have a units
attribute which is the Quantity
object. We could then assume that the values in the field class need to be multiplied by the quantity object to get the actual field values. (It is not clear whether we want to allow the number in the Quantitity
to be different from one - if we do, then lots of code will have to multiply the number with the actual Field (numpy array or scalar, say), which is both a repeated extra operation (performance) and might be forgotten (correctness). So in practice, we could use the units
attributed just to store the physical dimensions, such as A/m
.
For the latex representation, we can get the units from units
, and we can get the number from the Field
. If the Field
is spatially varying, we could compute the average value, or some other statistical measure for the latex representation.
from ubermag.
A related question is whether we should use the Field
class to represent objects that are often just a scalar, but could vary, such as the exchange constant A. I suppose we could do that; either by just accepting that we waste some memory if a scalar A is stored once for every cell. Or by having specialist Field classes for constants (which store the constants only once but provide the same interface). There may be a performance penalty though; this needs a little bit more thought / experimentation.
from ubermag.
This idea has been abandoned for simplicity. We assume everything is in SI units.
from ubermag.
Related Issues (20)
- Hysteresis Loop for [110] Direction: Asking for Advice HOT 2
- Update JOOMMF documentation HOT 1
- DMI D2d Specification
- Ubermag 0.6 todo list HOT 1
- Move logging control to `ubermagutil` HOT 1
- Import oommfc error HOT 1
- Time-Dependent Anisotropy and Magnetization term in the UBERMAG simulation HOT 3
- Failed to install Ubermag using conda on Ubuntu 22.02 HOT 2
- Wrong relativistic wavelength expression found HOT 1
- Remove duplicated tests
- Update hdf5 notebook on day of release
- Remove stable branch in all repositories
- Switch from flake8 and isort to ruff HOT 1
- Codecov
- Make test function more flexible
- Review LICENCE files (@marijanbeg, @fangohr ) HOT 1
- Split tests
- Add test for jupyterlab
- Problems about Slonczewski STT HOT 1
- Ubermag release 2024.06
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 ubermag.