add Cython version of orientation module to provide faster orientation calculation.
This commit is contained in:
parent
599bb768ef
commit
5f74f3e95e
6
Makefile
6
Makefile
|
@ -19,6 +19,12 @@ marc:
|
|||
|
||||
.PHONY: processing
|
||||
processing:
|
||||
@if hash cython 2>/dev/null; then \
|
||||
cd ./lib/damask; \
|
||||
python setup_corientation.py build_ext --inplace; \
|
||||
rm -rv build; \
|
||||
rm *.c; \
|
||||
fi
|
||||
@./installation/compile_CoreModule.py ${MAKEFLAGS}
|
||||
|
||||
.PHONY: tidy
|
||||
|
|
|
@ -7,6 +7,10 @@ from .environment import Environment # only one class
|
|||
from .asciitable import ASCIItable # only one class
|
||||
from .config import Material # will be extended to debug and numerics
|
||||
from .colormaps import Colormap, Color
|
||||
try:
|
||||
from .corientation import Quaternion, Rodrigues, Symmetry, Orientation
|
||||
print "Import Cython version of Orientation module"
|
||||
except:
|
||||
from .orientation import Quaternion, Rodrigues, Symmetry, Orientation
|
||||
#from .block import Block # only one class
|
||||
from .result import Result # only one class
|
||||
|
@ -31,6 +35,7 @@ try:
|
|||
core.debug.init = core.debug.debug_init
|
||||
core.math.init = core.math.math_init
|
||||
core.math.periodicNearestNeighbor = core.math.math_periodicNearestNeighbor
|
||||
core.math.barycentricInterpolate = core.math.math_barycentricInterpolate
|
||||
core.math.periodicNearestNeighborDistances = core.math.math_periodicNearestNeighborDistances
|
||||
core.math.tensorAvg = core.math.math_tensorAvg
|
||||
core.FEsolving.init = core.FEsolving.FE_init
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: UTF-8 no BOM -*-
|
||||
|
||||
from distutils.core import setup
|
||||
from distutils.extension import Extension
|
||||
from Cython.Distutils import build_ext
|
||||
import numpy as np
|
||||
|
||||
ext = [Extension("corientation", ["corientation.pyx"])]
|
||||
|
||||
setup(
|
||||
name="corientation",
|
||||
include_dirs=[np.get_include()],
|
||||
cmdclass = {'build_ext': build_ext},
|
||||
ext_modules=ext
|
||||
)
|
Loading…
Reference in New Issue