Comments (20)
I have no Windows box to check, may be @ovidiopr can comment on this.
from scattnlay.
from scattnlay.
Or you can check online Mie calculator based on Scattnlay (I have exposed only small part of API, however, it can be handy for simple computations) https://physics.ifmo.ru/mie/
from scattnlay.
Or you can also try MinGW http://www.mingw.org/ I have no experience with it, but I know that it is a popular alternative to Visual C++. You may also check https://kezunlin.me/post/8b9c051d/ (it is about building with pybind11 on windows, and we use pybind11 to interface C++ and Python code).
from scattnlay.
Thanks for the quick response.
Thanks for the valuable advices.
I did not write right away, but I am using MinGw and plan to compile it using the gcc or g++ built-in compiler.
I want to find electrical field in space with Scattnlay project and I understood that API https://physics.ifmo.ru/mie/ has not this such an opportunity or functionality. But this advice is very valuable for future tasks.
I understand that the Makefie in the project is not intended for assembly in Windows. Is it so?
I will try to read in more detail the links that you advised.
from scattnlay.
from scattnlay.
Hello.
I have not yet succeeded with the make ext command.
My latest achievement is the following:
- Run make ext command.
Output:
'/c/Users/konstantin/AppData/Local/Programs/Python/Python37-32/python.exe' setup.py build_ext --inplace
running build_ext
Traceback (most recent call last):
File "setup.py", line 81, in
extra_compile_args=['-std=c++11', '-DMULTI_PRECISION=100'])]
File "c:\Users\konstantin\AppData\Local\Programs\Python\Python37-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\Users\konstantin\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\Users\konstantin\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\Users\konstantin\AppData\Local\Programs\Python\Python37-32\lib\distutils\command\build_ext.py", line 309, in run
force=self.force)
File "c:\Users\konstantin\AppData\Local\Programs\Python\Python37-32\lib\distutils\ccompiler.py", line 1031, in new_compiler
return klass(None, dry_run, force)
File "c:\Users\konstantin\AppData\Local\Programs\Python\Python37-32\lib\distutils\cygwinccompiler.py", line 282, in init
CygwinCCompiler.init (self, verbose, dry_run, force)
File "c:\Users\konstantin\AppData\Local\Programs\Python\Python37-32\lib\distutils\cygwinccompiler.py", line 157, in init
self.dll_libraries = get_msvcr()
File "c:\Users\konstantin\AppData\Local\Programs\Python\Python37-32\lib\distutils\cygwinccompiler.py", line 86, in get_msvcr
raise ValueError("Unknown MS Compiler version %s " % msc_ver)
ValueError: Unknown MS Compiler version 1916
make: *** [ext] Error 1
I can't tell python distutils to use mingw.
I also wanted to inform you that I use code from master branch and I tried to compile project on my laptop with make standalone command and I found some problems:
- Makefile has line PYTHON='which python3'. In my case I have to use exact path to python.exe.
- I run make standalone command.
Output:
make: *** No rule to make target/c/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nmie-impl.hpp', needed by
scattnlay'. Stop.
There is no file (nmie-impl.hpp) in the project. - I deleted $(SRCDIR)/nmie-impl.hpp in Makefile and compiled with make standalone command.
Output:
g++ -DNDEBUG -O2 -Wall -std=c++11 /c/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nearfield.cc /c/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nmie.cc -lm -o fieldnlay
In file included from c:/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nearfield.cc:43:
c:/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nmie.hpp:40:10: fatal error: boost/math/constants/constants.hpp: No such file or directory
#include <boost/math/constants/constants.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from c:/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nmie.cc:48:
c:/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nmie.hpp:40:10: fatal error: boost/math/constants/constants.hpp: No such file or directory
#include <boost/math/constants/constants.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [fieldnlay] Error 1_ - I deleted scattnlay-mp fieldnlay-mp in Makefile and #include <boost/math/constants/constants.hpp> in nmie.hpp. At the moment I will deal with the project without a library if possible.
No errors occurred.
Output:
g++ -DNDEBUG -O2 -Wall -std=c++11 /c/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/farfield.cc /c/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nmie.cc -lm -o scattnlay
g++ -DNDEBUG -O2 -Wall -std=c++11 /c/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nearfield.cc /c/Users/konstantin/YandexDisk/Mie/scattnlay-master/scattnlay-master-original/src/nmie.cc -lm -o fieldnlay
In project folder I have fieldnlay.exe and scattnlay.exe.
Can I use this file to calculate the electrical field? In the examples I saw only scattnlay functions from python library.
I apologize for the long comment.
from scattnlay.
from scattnlay.
Yes, I have the same output:
Invalid argument: Insufficient parameters.
Usage: fieldnlay.exe -l Layers x1 m1.r m1.i [x2 m2.r m2.i ...] -p xi xf nx yi yf ny zi zf nz [-c comment].
For test I tried to run command fieldnlay.exe -l Layers 10 1.01 0 -p -5 5 1 -5 5 1 -5 5 1.
Error occurred in line L = std::stoi(arg); in nearfield.cc, arg was "Layers" and it threw an exception. I deleted this line and manually defined L = 1. It outputs field values to consol. Perfect! Thank you!
Logically, the variable L should store the number of layers, but I did not understand how this is implemented programmatically. Maybe I didn’t understand something. In my case, I need a homogeneous sphere without layers.
I just still did not catch how to do it:
I would propose to try to install python package (python-scattnlay), as
soon as it is much more convenient to calculate near-field using python
interface. At least calling scattnlay from python is a default way I use
it.
from scattnlay.
from scattnlay.
from scattnlay.
from scattnlay.
from scattnlay.
Thank you very much I will try to do what you advised.
from scattnlay.
from scattnlay.
I tried this:
fieldnlay.exe -l 10 1.01 0 -p -5 5 1 -5 5 1 -5 5 1
It doesn't work in my case. It returns:
Invalid argument: Unfinished layer!
Insufficient parameters.
from scattnlay.
from scattnlay.
I suspect that some parameters were missing. An example of the command line when everything is OK in the calculation fields:
fieldnlay.exe -l 1 10 1.01 0 -p -5 5 1 -5 5 1 -5 5 1
from scattnlay.
from scattnlay.
@ovidiopr May be we need provide a copy of needed boost files, as soon as we really need just a tiny part of boostlib...
from scattnlay.
Related Issues (20)
- pip version tests fail with buffer wrong dimensions HOT 3
- build errors, nscattlay_dp not found HOT 4
- possible numerical problems HOT 6
- Microsphere nanojet simulation HOT 6
- Improvements for webapp HOT 8
- Fused silicon dioxide HOT 1
- Update convergence preset?
- nan values in the central part of the sphere HOT 4
- memory required HOT 5
- Support of materials with negative refractive index
- Add support of azimutal and radial polarization of incident light.
- First point calculated by fieldnlay is always inf&nan HOT 12
- Jump of field value at z=0 HOT 2
- SetMaxTerms(-1) yields wrong results HOT 7
- Near-field verification for a 10mkm water droplet - create test case
- Try to use arblib
- Compilation issues for mac HOT 2
- Inconsistent results between PyPi package, python package installed from repository and web app HOT 4
- errors when trying to install scattnlay in Mac HOT 2
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 scattnlay.