New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate kernel functions from tensor components to use for the magnetic field vector #105

Merged
merged 58 commits into from Jul 4, 2014

Conversation

Projects
None yet
3 participants
@leouieda
Member

leouieda commented Jun 3, 2014

Implements the gravity tensor components as kernel functions for prism, sphere and polygonal prism. These can be used to calculate the magnetic field vector and total field anomaly.

This PR integrates #97 and #99.

Checklist:

  • Cookbook recipes for new functions (if intended for user, not developer)
  • Docstrings
  • Make tests for new code
  • All tests pass
  • Can be merged
  • Changelog entry
  • Benchmark against old implementation and make at least as fast
    • prism
    • polyprism
    • sphere
  • Port the prism functions to Cython
  • Make Cython versions of the sphere functions

birocoles and others added some commits Apr 15, 2014

creates the kernelxx function
there is a docstring problem
prototype function for calculating gzz by using kernelzz
insert if sphere is None: continue in kernel functions
modify tensor functions for using kernel
include the r in docstring to dela with \
@leouieda

This comment has been minimized.

Member

leouieda commented Jun 3, 2014

Note: the numpy versions of the sphere code break multiprocessing code when using Anaconda Accelerate. This is related to #91

@leouieda

This comment has been minimized.

Member

leouieda commented Jun 4, 2014

@birocoles movi seus commits para cá para que eu possa continuar o trabalho. Vou fechar os outros dois pull requests em favor desse.

Estava dando uma olhada no código da esfera. Uma coisa me chamou atenção. As funções bx, by e bz não aceitam magnetização como um escalar. E isso faz todo o sentido. bx, by e bz não tem que saber do campo indutor mesmo. Isso me fez questionar se as outras funções deveriam aceitar esse tipo de coisa. Acaba ficando confuso quando uma propriedade vetorial pode ser usada como escalar em alguns casos e outros não.

Proposta: Abolir a magnetização como um escalar. Tudo no Fatiando lidaria com magnetização vetor. Magnetização é sempre um vetor e ponto final. Para isso teremos que modificar algumas coisas que utilizam magnetização escalar, mas isso é o de menos eu acho. Isso facilitaria muito as coisas pro futuro e elimina uma possível fonte de erros (por exemplo, "passei escalar quando não podia mas não deu erro").

Docstring editing in gravmag.sphere
Just removed some unnecessary parts from doctests in the new functions
and edited the docstrings a bit.
@coveralls

This comment has been minimized.

coveralls commented Jun 4, 2014

Coverage Status

Coverage increased (+1.95%) when pulling eb0f38a on kernel-functions into ffdac2d on master.

@coveralls

This comment has been minimized.

coveralls commented Jul 2, 2014

Coverage Status

Coverage increased (+4.61%) when pulling 595cb9b on kernel-functions into b57be02 on master.

@coveralls

This comment has been minimized.

coveralls commented Jul 2, 2014

Coverage Status

Coverage increased (+4.61%) when pulling 595cb9b on kernel-functions into b57be02 on master.

leouieda added some commits Jul 2, 2014

Strangely Cython polyprism is 2x slower than numpy
Had to replace 'f' dtypes in mesher for numpy.float.
Converted all polyprism to Cython
The speed is equivalent now to the original (a bit faster actually).
Merge branch 'kernel-functions' into kernel-polyprism-cython
Conflicts:
	benchmarks/gravmag_polyprism.ipynb
Merge branch 'kernel-functions' into kernel-openmp
Conflicts:
	setup.py

Changed the setup for building extension modules. Getting a list of
module names plus extra compile args.
@coveralls

This comment has been minimized.

coveralls commented Jul 3, 2014

Coverage Status

Coverage increased (+5.48%) when pulling 1f94881 on kernel-functions into b57be02 on master.

@leouieda leouieda added this to the 0.3 milestone Jul 3, 2014

leouieda added some commits Jul 3, 2014

Changelog entry for kernel functions and Cython
New separation of gravmag forward modeling into kernels and Cython
implementations of sphere and polyprism

@leouieda leouieda referenced this pull request Jul 3, 2014

Merged

Add OpenMP support to forward modeling modules in gravmag. #106

10 of 10 tasks complete
@coveralls

This comment has been minimized.

coveralls commented Jul 3, 2014

Coverage Status

Coverage increased (+5.48%) when pulling 9a736fd on kernel-functions into b57be02 on master.

leouieda added some commits Jul 3, 2014

OpenMP for gravmag.polyprism
Benchmarks are very good! Sometimes more than 2x speedup over numpy
version.
Moved the vertices loop out of kernels to avoid segfaults.
Had to change the way PolygonalPrism makes .x and .y attributes so that
they are C contiguous arrays.
Merge pull request #106 from leouieda/kernel-openmp
Add OpenMP support to forward modeling modules in gravmag.
@coveralls

This comment has been minimized.

coveralls commented Jul 3, 2014

Coverage Status

Coverage increased (+5.47%) when pulling 1cab148 on kernel-functions into b57be02 on master.

@leouieda

This comment has been minimized.

Member

leouieda commented Jul 3, 2014

@birocoles por mim parece que está fechado isso aqui. O que você acha? Algo mais que precisa ser colocado? (A parte de OpenMP já está aqui)

@birocoles

This comment has been minimized.

Member

birocoles commented Jul 4, 2014

@leouieda, eu acho que é só. Só pra confirmar, já tem os kernels pra todo mundo e as funçoes tf usam esses kernels, certo? O gz de todo mundo não usa os kernels, mas isso a gente pode pensar depois. Poderíamos fazer kernels pra calcular as componentes gx, gy e gz. A magnetização virou vetor pra todo mundo, certo?

@leouieda

This comment has been minimized.

Member

leouieda commented Jul 4, 2014

Tem kernels pra gz etc. Tf usa os kernels. Magnetização ainda não é só
vetor. Isso fica pra outro PR pois é bastante trabalho.
On Jul 4, 2014 10:41 AM, "Vanderlei C Oliveira Jr" notifications@github.com
wrote:

@leouieda https://github.com/leouieda, eu acho que é só. Só pra
confirmar, já tem os kernels pra todo mundo e as funçoes tf usam esses
kernels, certo? O gz de todo mundo não usa os kernels, mas isso a gente
pode pensar depois. Poderíamos fazer kernels pra calcular as componentes
gx, gy e gz. A magnetização virou vetor pra todo mundo, certo?


Reply to this email directly or view it on GitHub
#105 (comment).

@birocoles

This comment has been minimized.

Member

birocoles commented Jul 4, 2014

Então fechou @leouieda

@leouieda

This comment has been minimized.

Member

leouieda commented Jul 4, 2014

Partiu merge

On Fri, Jul 4, 2014 at 10:58 AM, Vanderlei C Oliveira Jr <
notifications@github.com> wrote:

Então fechou @leouieda https://github.com/leouieda


Reply to this email directly or view it on GitHub
#105 (comment).

leouieda added a commit that referenced this pull request Jul 4, 2014

Merge pull request #105 from leouieda/kernel-functions
Separate kernel functions from tensor components to use for the magnetic field vector

@leouieda leouieda merged commit a82780b into master Jul 4, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@leouieda leouieda deleted the kernel-functions branch Jul 4, 2014

@leouieda leouieda referenced this pull request Jul 4, 2014

Closed

Write support for Surfer ASCII grid files #110

0 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment