OpenFOAM is high quality, but as you’ve seen complex to use. There is a web-based GUI that can lighten the burden to get started somewhat: https://www.simscale.com/ I think they give you ~3000 simulation hours for a trial.
74 karma · joined October 25, 2009
OpenFOAM is high quality, but as you’ve seen complex to use. There is a web-based GUI that can lighten the burden to get started somewhat: https://www.simscale.com/ I think they give you ~3000 simulation hours for a trial.
real, dimension(30000000) :: a
call random_number(a)
print *, sum(a)
That's 30 million doubles, takes 0.04s on my machine. real, dimension(30000000) :: a
call random_number(a)
print *, sum(a)
That's 30 million doubles, takes 0.04s on my machine.All models are wrong. Some are useful.
This means that amateur photographers in many cases can do just as good a job as a professional. It's pretty much the same reason why magazines and newspapers are declining, the internet and social networks have lead to a democratization of news.
To be successful as a professional photographer, you have to offer more than what amateurs are capable of, and in addition be able to educate your customer why you're worth the extra cash. As always, it's about staying competitive, instead of weeping over the past.
Have you seen the FiPy project? It's a full-featured finite volume code in Python, which is very easy to extend (they did struggle with performance in early releases, not sure how the current status is).
I guess that's the area where dynamic or functional languages can be useful, in that they are easier to build generic libraries for, and can give rise to codes with easier extensibility.
I kinda understand what do you mean by whole-program scale, but in fact, most of our programs aren't much bigger than this! Typically, the number of lines of code doesn't exceed 50k.
I agree about functional programming being fun, but unfortunately I don't think my coworkers would agree, and especially not the companies funding our research!
!acc region
!acc end region
with the PGI Accelerator. It would have to be a pretty big loop for it to pay off, though, since transfer to/from the GPU is very expensive.If you're dealing with fluids with low diffusion compared to advection, some higher order Runge-Kutta scheme is typically used. For fluids with high diffusion, however, this will give you very high restrictions on the time step. For this cases, a hybrid scheme is often used, where the advection term is integrated explicitly using an Adam-Basforth scheme and the diffusion term is treated semi-implicitly with a Crank-Nicholson scheme. This means you have to solve additional linear equation systems for the velocities for each time step (Helmholtz type equations), but this is still faster since you can use longer time steps.
All of this may sound very complicated, but it all follows the same patterns, so it's really fairly straight forward.
pure function diffusion(x0) result(x)
real, intent(in), dimension(:,:) :: x0
real, intent(out),dimension(:,:) :: x
x = x0(2:n+1,1:n ) &
+ x0(0:n-1,1:n ) &
+ x0(1:n ,2:n+1) &
+ x0(1:n ,0:n-1) &
-a*x0(1:n ,1:n )
end function
Some things to note:- The "pure" keyword guarantees that this function has no side effects.
- No do loops are needed! Fortran array slicing is very handy.
- The compiler will convert this to use SIMD instructions
- Adding some OpenMP hints to make it run on all cores is also very easy.
So this type of code in Fortran is short, very easy to understand and you are guaranteed extreme performance. Maybe functional programming has some benefits when you're dealing with more complex datastructures (for instance I'm working on a code right now which uses parallel octrees, kind off a pain in Fortran), but for simple things like this, I fail to see the point.
I want to believe, so perhaps someone here can enlighten me?
The power of a good model lies not in how good it predicts what you know, but how it can be used to model unknown/new phenomena.
The first is that success is measured by the amount of money you earn. For me it is much more rewarding to work on interesting and inspiring problems than having a huge income.
The second is that people that are good at hard science problems are good at solving the "stupid" problems. You need a different set of skills to solve the latter.
This is somewhat true of engineers as well, but you can certainly get an engineering job where you don't need to exercise your creativity.
Of course it's hard to build a team as a PhD, at best you can get some reasonably competent master students to do some work for you.
Also, the freedom of doing a PhD is great. Want to take two weeks to learn a new programming language? Sure! Want to take two weeks off and go surfing? No problem! In fact, some of my most important work on my PhD was done during one of these "diversions".
Finally, some jobs require a PhD. You may want to consider if that's the kind of job you want. Hard to answer that before you finish, though. For me the answer was a resounding YES!
In all seriousness, though, a lot of labs view their in-house codes as a competitive advantage. You may not like it, but science has become commercialized, the labs/unis are all competing about the same grants, which creates a competitive enviroment.
I think the opportunities lie more in creating niche tools. Just look at all the tools created the last few years for photographers, the top one perhaps being Adobe Lightroom. It contains most of the image editing tools from PS that a photographer needs, but is built more around the photographer's workflow.
But yeah, a comparison with a pure Java or C++ implementation would have been great, both in terms of speed and LOC. However, in the "real world", there usually isn't time for such silly things.