Today I found out that I’m gonna be a dad!
via https://dayone.me/29GTzL
Misplaced Lens Cap

Origami Around
Jules of Nature

roma★
he wasn't even looking at me and he found me
PUT YOUR BEARD IN MY MOUTH
Peter Solarz

Andulka
Xuebing Du
art blog(derogatory)
No title available
Sweet Seals For You, Always

ellievsbear

Discoholic 🪩

No title available

No title available
will byers stan first human second
"I'm Dorothy Gale from Kansas"

if i look back, i am lost
Monterey Bay Aquarium

seen from Canada
seen from Türkiye
seen from United States
seen from France
seen from Brazil

seen from Germany

seen from United Kingdom
seen from Spain

seen from United States

seen from Malaysia
seen from United Kingdom

seen from Germany
seen from United Kingdom
seen from Malaysia
seen from India
seen from Türkiye
seen from Netherlands

seen from France

seen from Türkiye

seen from Türkiye
@twilsonco
Today I found out that I’m gonna be a dad!
via https://dayone.me/29GTzL
Interpolation between points on a 3d grid
I have an idea for improving the #interpolation in #Bondalyzer and other add ons.
Basically, the idea is to combine linear and logarithmic interpolation. Rho and its derivatives change logarithmically in the direction radial to an atom, and linearly (mostly) normal to the radial direction. So, use a linear combination of logarithmic and linear interpolation for the point, using the dot product of gradient with the interpolation direction as the weights. The vectors being dotted with gradient are the eight vectors originating at the point and terminating at the eight vertices of the cell within which the point lies. I’ll think more about it later.
#BAND data loader
Today I got the ADF to Dat converter (now known as the Tape41_Maker) mostly updated to work for generating t41 files from BAND runkf and run files. Hopefully by Monday I’ll have this and the data loader to load the t41 into Tec360 finished.
via https://dayone.me/29GSzuM
#Bondalyzer refresh
Today I got as far as the beginning of critical point searching. This includes redoing the setting of AuxData stuff using wrapper functions for convenience, and the calculation of DGradMag.
Tomorrow I’ll make a critpoints class and get at least as far as the beginning of gradient path use, starting with bond-atom lines.
via https://dayone.me/29GRzkW
Better gradient calculation
I implemented a better gradient calculator that uses higher-accuracy derivative approximations that use information from the second derivative and have half to one fourth the error of the normal central/forward/backward divided difference methods.
Bondalyzer 2.0
I’ll now (finally) begin the process of redoing Bondalyzer using my own data structures with parallelism in mind. Here we go…
via https://dayone.me/29GQz80
Integration in
GradientBundleAnalysis
Point-wise integration
We finished and implemented the point-wise integration. It works as described below:
Volume zones to be integrated must exist as closed, finite element surfaces
Simply loop over every cell (cubic cell composed of 8 nodes) in the full volume, determining if the cell is
contained entirely outside the FE volume, which is performed with an additional time-saving step of disqualifying cells that are outside of the bounding cube of the FE volume;
contained entirely within the FE volume; or
partially contained within the FE volume
If cell is entirely within, add the variable value (i.e. rho) for the center of the cell to the integral
if cell is partially contained in FE volume, subsample the cell according to a specified resolution, each time adding the variable value for the centers of the subcells if they are interior to the FE volume
This method works, but it takes a very high subsampling resolution to get decent accuracy, resulting is very, very long run-times.
FE volume integration
I have another idea for a much faster integration scheme that has the additional benefit of lacking any kind of user-specified resolution.
The method is pretty simple: Take the closed, FE surfaces and turn them into FE volumes composed of polyhedra. Once the volumes are created, Tecplot 360’s built-in integration can be used, although I would prefer to also implement my own integrator to prevent reliance on the Tecplot 360 Integration add-on.
My basic idea for the algorithm to make a FE volume out of the closed FE surface is as follows:
Get a complete list (IsInterior) of all Full Volume Zone nodes that are interior to the FE surface. The list will be in the form of a vector<bool> of length iMax • jMax • kMax so that lookup time is constant.
Make another list (ElemDirCreated) of vector<vector<bool> >, also of length iMax • jMax • kMax, but only the elements i for which IsInterior[i] is true will have their inner vector<bool> resized to length 8. These 8 bools will be used to keep track of whether FE volume elements have been created for the 8 directions from each interior node.
With each interior node, check it’s 8 values in ElemDirCreated.
If the element has been created, move on
If the element hasn’t been created, then check the interior-ness of the node’s 26 neighbors.
If a neighbor is interior, then simply use that node for a node of the new element.
If a neighbor is not interior, then use the intersection point of the line connecting the node and its neighbor as a node in the new element.
Need to think about this part of the algorithm carefully such that cases where only one corner of a cell is cutoff by a surface result in three nodes on the surface corresponding to the intersections between the surface and the lines between the one exterior node and its three neighbors in the cell.
Since node and element numbers serve no purpose other than to provide information about the connectivity of the FE volume, these can simply be generated as the elements are built.
Need to look into the possibility of using a set number of sides for the FE volume, as this will allow the structure of the connectivity list to be predicted.
Fully interior cells will be hexahedral, but…
I just realized this won’t work…
This method, and the current point-wise integration method, won’t work because of the assumption that, if all 8 nodes of a cell are not contained within a volume of interest, then the cell does not contribute to the volume’s density. This assumes that there will never be a skinny volume shooting through the center of the cell, which is a bad assumption.
I need to use a method of creating FE volumes that starts by using the existing information known about the volume. It will likely be impossibly non-trivial to utilize the discreet data in the system. Instead, I’ll probably devise a method that uses nothing but interpolated data, which isn’t that bad anyways.
Side note: Max and min number of sides for a hexahedron coincident with N planes is 6 + N and 6 - N respectively1
via https://dayone.me/29GPzC6
Thanks to Michael for figuring this out. ↩︎
Eclipse + Photran + gfortran 4.9.2 + gdb 7.6
Well that was fun. So, so get a Fortran project building and debugging (with breakpoints!):
manually set the compiler/linker/assembler locations to those in /opt/local/bin/, since apparently having Eclipse use the PATH that Terminal sees is impossible?
in the debug configuration
set the debugger to gdb/mi
check the Stop on startup at: box
set the GDB debugger to the one in /opt/local/bin manually
leave .gdbinit alone for the GDB command file
use Standard GDB command set, not Standard (Mac OS)
use mi for protocol
This can be mostly avoided by soft-linking gfortran and gdb to /usr/bin/ (sudo ln -s /opt/local/bin/gfortran /usr/bin/gfortran), which is OK in this case since, as of OS X 10.9 Mavericks, there is no gdb in /usr/bin/ so you’re not overwriting anything.
This only keeps you from needing to prepend gdb and gfortran with /opt/local/bin/. You still need to prepend gcc and as in the build settings, otherwise they’ll default to the built-in versions, which could lead to undefined behavior since the /usr/bin/ GNU compiler and assembler are much, much older than the gfortran you’ll get from Macports.
It’s worth mentioning that I installed fortran and gdb through macports (gfortran comes with gcc)
via https://dayone.me/29GOzbW
Overdue entry
Turns out it’s pretty easy to go several days without an entry. I’ve been using Day One mostly as a detailed version of commit comments for coding projects, but the idea was to also include some personal stuff and whatever else I might want to write about.
#kanji
I’m now ≈370 kanji into RTK1. It’s much easier this time than before, although I’m still less than 25% through, so we’ll see if it stays easy. For the most part I’m able to simply look over the character once in RTK, and then I have no problems when doing reviews in Anki. I can also blast through many lessons in a day (3 in a day is the current max, but I hope to have some even more productive days).
I’ve added all new kanji with a notebook in Notability, and I’ve been pretty good about doing reviews in the notebook too. I like doing that because it fortifies the correct stroke order, keeps the characters looking decent compared to when I air-write them when reviewing on the road, and makes for a fun notebook to look at once I have a few full pages of reviews (hopefully without any red marks).
MBPr
I took my Macbook Pro into Apple again, and they replaced everything except the keyboard and screen, so it’s a brand new computer basically. This was the second time they replaced the logic board, and I’m 50/50 hoping that there are no more problems so I can use the thing without worrying about losing data or productivity having to troubleshoot stuff and also hoping that it breaks again, because the next time they try to replace the logic board I’ll pull the same card I did with the last Macbook Pro and try to get my money back to upgrade to a newer model. If I can swing that deal and get my money back I’m tempted to get an iMac ($2600+ for one with 32GB) and a Macbook Air ($1200+ for one with 8GB) instead of a newer Macbook Pro ($2700 for 16GB + upgraded CPU), although it would be more expensive than I originally thought.
#DOE #CSGF
While Apple had my Macbook Pro for 4 days I worked mainly on the personal and research statements for the computational science graduate fellowship. I’m on the 4th draft now for each, and they’re looking pretty good. They both started in a good place though; the research statement basically a combination of the two statements from last year’s application, which got about 8 drafts with collaboration with Travis; and the personal is a shortened (from 3 pages to 2250 characters!) version of the personal statement from the NSF fellowship application that I’m waiting to hear back about, which got about 5 revisions with collaboration with Dr. Eberhart.
Aside from the two statements there’s also the program of study. I’ll just update that based on the courses that I’ve already taken and see if Dr. Eberhart still likes the selection. There’s a new section this year; a list of programming language and models the applicant is familiar with. This’ll be a strong point for me since I’ve got the major languages, several scripting languages and good experience with parallel programming. I also have experience with finite element and other numerical methods, so they’ll know that scientific computing is nothing new for me.
Parallels
Parallels + Time Machine
I was bluntly reminded after restoring my Macbook Pro from a TM backup that I didn’t have my virtual machines backing up. This isn’t the first time I’ve had the added headache of restoring VMs separately from TM.
I found out shortly after that Parallels has good support for TM, and so I’ve decided to do away with the extra partition on my backup drives (and my beloved/hated applescript backup/restore utility) in the interest of expanding the TM backup partitions to 1.5TB and using TM to backup the VMs. From what I read, not only will a restore now include all my VMs, but this method will also allow me to have many versions of the VMs available for restore, since the meat of the VM is backed up only once, and then snapshots maintain a timeline of the changes to the VM.
Yes, VMware Fusion promised the same thing: “Just turn on snapshots and then backup with TM as usual.” However, the outcome was that if I was using a VM constantly, the entire VM would get backed up with every TM backup! This resulted in a very full TM backup drive with not much else besides copy upon copy of whatever VM I was working on. The real clincher was that, because the backups were taken when the VM was in use, they didn’t even work if restored! Hopefully Parallels has a better version of “TM compatibility”. It wouldn’t surprise me, since Parallels is much more polished, fast, and less buggy compared to Fusion.
Parallels + Boot Camp
So Parallels 10 has a feature that lets it run your Boot Camp partition within Parallels, so you get the convenience of being able to run Windows side-by-side OS X, and the ability to boot into Windows natively and enjoy the speed from giving Windows 100% of your machine’s resources, all with a single Windows footprint in your storage.
Unfortunately, Windows 7 (and 8 and 10, and maybe Vista and XP) are wise to hardware changes. I suspected a problem here, and slightly confirmed it according to one other user’s experience on the Parallels forum. Each time you switch from Parallels to Boot Camp or vise-versa, Windows sees the different hardware, and there’s a lot of different hardware, since the drivers for everything change, the amount of memory changes, and the number of processors change (if you’re giving less than all your cores to the VM when in parallels). Windows then tells you to reactivate it through Microsoft’s activation service, which is a pain unless the activation is approved via the automated internet method, otherwise you’ll have to call in and deal with the automated phone system (takes about 10 minutes) or even maybe speak with a human and explain the situation if you’ve been flagged for reactivating too many times. And this will happen every time you switch between Boot Camp and Parallels.
Not to mention that, for me, I’d have to reinstall Windows and all the programs I use, from installation media, since there’s apparently no way to simply move a Parallels VM to a Boot Camp partition (although the opposite is painfully simple).
There are some other setbacks to using the Boot Camp partition in Parallels, like not being able to pause or suspend the VM, so you lose some time booting each time you want to use it. Also, you can’t backup a Boot Camp partition using Time Machine, and that’s a big problem, since imaging the entire partition is somewhat a pain.
via https://dayone.me/29GNzmY
Everything’s always my fault.
That’s the best thing for me to remember when coding. I found the problem with the compiler optimizations: I turned them on in addition to making changes to the code that killed the performance. I neglected to test the new code before messing with the optimization settings, and, like a moron, I thought the compiler was to blame…
I had setup some bad logic for a counter that was supposed to make gradient paths finish after stalling for 10 iterations, but instead the counter was never allowed to actually iterate. It would iterate and then get reset to 0 because the gradient path hadn’t failed yet. I fixed that and now the code is lightning fast again, and with all the optimizations enabled I get a smaller file; just over 400KB for #GradientBundleAnalysis. Pretty cool, minus my juvenile rage.
via https://dayone.me/29GMzNB
Link time code generation
I read about this, and apparently it gives the linker uncompiled(ish) code in the .obj files, and the linker then invoked the compiler back end so that the back end has full access to the information of how functions are calling each other etc.. This lets the compiler be more aggressive with optimizations, so I hope I get a speed boost out of it.
I turned it on for #GSL, #Meshgen and all the #Bondalyzer add-ons, and they built successfully. I’ve yet to test them all to make sure they still work, but I have a good feeling.
via https://dayone.me/29GLzpe
#GradientBundleAnalysis
Parallel version is finished and seems to work great. With compiler optimizations enabled, the speedup vs the serial version for mesh levels 3 and 4 are 22 and 26 respectively. That’s right, speedup of 26! The parallel version does much less work, uses my cheaper gradient paths, and get’s direct access to dataset values, in addition to running the bulk of the code in parallel.
There was a funny bug in some systems, where the gradient path will stall for a few iterations, so I made it so the path has to stall more than some number of iterations before it assumes that it’s fallen into a cage. When run on N2, the bug resulted in a sweet-looking effect that looked like a mushroom cloud. I fixed it though so there’s no more mushroom clouds (yay!).
via https://dayone.me/29GKzdT
#GradientBundleAnalysis bugs
Here’s a quick shot showing the problems with 3- and 4-sided FV volumes (that’s right, they’re both screwed up…)
via https://dayone.me/29GJzWD
#GradientBundleAnalysis
Making great progress. Almost finished with the parallel version, which is way faster than the serial version for several reasons. Right now I’m just ironing out some bugs (mmm, burnt bugs…) related to FE volume creation. Granted, they’re annoying bugs whose cause I have no clue, but at least I know where this is all happening.
#Mathematica
I took some code that Amanda had made for comparing stream traces and turned it into an easy-to-use module so she can work faster (see pic). I’ll make another version of the tool that works for arbitrary stream traces too so that Erica can perform the same type of analysis.
For the arbitrary case, you’ll lose information about the stream traces in order to plot 3-d stuff in a 1-d plot. I’m thinking of replacing the x-axis with distance from a plane normal to the inter-CP axis, and the y-axis with distance from the inter-CP axis.
via https://dayone.me/29GIzPs
#GradientBundleAnalysis
Grad path
I’ve now finished all the necessary methods for grad paths in GBA. Now I need to make a real default constructor (that takes no arguments) and a SetAll method that uses the current default constructor to set everything.
After that the only code remaining is for making FE volume zones from sets of grad paths. Here I’m not sure if I should make a FE zone class, but I think I won’t right now. A FE zone class in GBA would likely only be useful in GBA, and would become a two-face class once I tried to use it in Bondalyzer. Maybe not though. It’d be nice to be able to just pass a vector of grad paths to a FE zone class and have it put them together into a nice surface. Then pass a bunch of FE zone objects to another FE zone and have it make a nice volume out of it. I’ll mull it over, but for now I’ll just do that FE zone creation part in the main function.
via https://dayone.me/29GGzLv
#GradientBundleAnalysis
Grad paths
Got the GSL ODE solver-based grad path working ok. Added more functionality than will be necessary with GBA, but I'm planning on replacing Bondalyzer's grad paths with this eventually, so the functionality will be used.
Next step is to add methods for resampling and resample/concatenation with other grad paths. For concatenation, need to add another constructor that simply takes pointers to a Bondalyzer grad path zone and makes a CSM_GradPath_c out of it, then concatenation can just be between CSM_GradPath_c’s.
Parallel
Something I hadn’t explicitly though about: When you fetch a raw pointer, Tec360 must read in ALL the data to memory. In some cases this can flood the memory and then you’re stuck waiting on your OS to write it all out to virtual memory. Need to keep this in mind when Bondalyzer goes parallel.
For GBA this will be an issue with larger systems, since 7 pointers (3 for XYZ, 3 for Gradient, and 1 for Rho) are necessary in order to do a grad path. Additionally, there’ll be NumGradPaths X PointsPerGradPath floats necessary. Still think it’ll be way faster than the serial version, and have a smaller memory footprint than my first idea at parallel with stream traces.
via https://dayone.me/29GFziP
#GradientBundleAnalysis
Making progress. Today I wrote the function that the GSL ODE solver will use to make the gradient path. It needs to interpolate between grid points so that the solver can query arbitrary locations. So the function takes the location, figures out the indices of the corners of the cell that contains it, and interpolates from those corners to get a value for gradient at the location.
Tomorrow I’ll write the actual grad path function that uses the ODE solver. Right now It’ll be a simple version just to see if everything’s working right. Later I’ll add more robustness like the different use cases (terminating at a CP, an arbitrary point, a value of Rho, or at the system boundary).
I’m hoping I can use the ODE driver object that does all the ODE solver stuff for me. I should just be able to take small enough time steps so that I can see if I’m approaching the end of the system (or other termination criteria) and handle everything myself.
I’m a little concerned that, in the even of a collision with the system boundaries, that I won’t be able to have the ODE solver tell be the new position, should that position be out of bounds. I need the new position so that the last step still reflects the behavior of the system. On the other hand, the behavior at the boundary is usually boring anyways, and it’ll probably be just as well to go in the same direction as the previous step and interpolate that direction until the boundary collision.
Another thing I’d like to keep in mind is how to use the GSL ODE solver with periodic conditions such that the gradient path can pac-man from one side of the system to the other. Again, shouldn’t be such a big deal, but it’ll freak out the solver since the coordinates will be changing drastically. Another option is to let the solver continue moving in the same direction, with locations that are farther and farther “outside” the boundaries. Then the function I provide the solver can just deal with those crazy locations, and I’ll use the periodicity of the system to take the resulting locations and put them in the correct place in the actual system. So the solver gets to continue in the same direction at all times, and I do the work of putting the results in the actual system outside of the solver.
via https://dayone.me/29GEzI
I started relearning the #kanji two days ago. I'm about 55 kanji into the process, and I'll try to do around 50 per day until I'm done with the normal set. Let's see how it goes…
via https://dayone.me/29GDzex
#GradientBundleAnalysis
Didn't get a whole lot done today. New Year's and all…
I started making a gradient path class, but I realized that I still need to provide the ability to see if you are still inside the system or not, and I need to use the GSL differential equation solver in a flexible way so that I can still control what happens when I reach the boundary or critical point collision that ends the gradient path. It shouldn't be too hard to get to the point where I can run a basic test case and see if this is a viable way of creating gradient paths. If so, maybe the performance is worth implementing this in #Bondalyzer as well, but I doubt it.
via https://dayone.me/29GBz2L