Skip to content

Commit

Permalink
Move PostMesh to an external python package
Browse files Browse the repository at this point in the history
  • Loading branch information
romeric committed May 1, 2017
1 parent 3e59082 commit d36b724
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*.step

# object files
.o
*.o

# shared libraries
*.so
Expand All @@ -59,6 +59,7 @@ RunSession.sublime-project
RunSession.sublime-workspace
Florence.sublime-project
Florence.sublime-workspace
*.sublime-project
param_run_session.py
profile_imports_manual.py
nr.py
Expand Down
1 change: 0 additions & 1 deletion Florence/BoundaryCondition/CurvilinearMeshing/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion Florence/BoundaryCondition/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .BoundaryCondition import BoundaryCondition
from .CurvilinearMeshing import PostMeshCurvePy, PostMeshSurfacePy
from PostMeshPy import PostMeshCurvePy, PostMeshSurfacePy
1 change: 0 additions & 1 deletion Florence/ParallelProcessing/mpi4py_map
Submodule mpi4py_map deleted from 8b1582
1 change: 0 additions & 1 deletion Florence/ParallelProcessing/mpipool
Submodule mpipool deleted from 4d282d
16 changes: 4 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,9 @@ def CollectExtensionModulePaths(self):
gm_path = os.path.join(_pwd_,"VariationalPrinciple","_GeometricStiffness_")
cm_path = os.path.join(_pwd_,"VariationalPrinciple","_ConstitutiveStiffness_")
material_path = os.path.join(_pwd_,"MaterialLibrary","LLDispatch")
occ_path = os.path.join(_pwd_,"BoundaryCondition","CurvilinearMeshing","PostMesh")

self.extension_paths = [tensor_path,mesh_path,jacobi_path,bp_path,km_path,gm_path,cm_path,material_path,occ_path]

# self.extension_paths = [jacobi_path]
self.extension_paths = [tensor_path,mesh_path,jacobi_path,bp_path,km_path,gm_path,cm_path,material_path]
# self.extension_paths = [material_path]

def SourceClean(self):

Expand All @@ -219,9 +217,6 @@ def SourceClean(self):
execute('cd '+_path+' && '+source_clean_cmd)
elif "LLDispatch" in _path:
execute('cd '+_path+' && echo rm -rf *.cpp CythonSource/*.cpp && rm -rf *.cpp CythonSource/*.cpp')
elif "PostMesh" in _path:
execute('cd '+_path+' && echo rm -rf PostMeshPy.cpp build/ && rm -rf m PostMeshPy.cpp build')


def Clean(self):

Expand All @@ -231,7 +226,7 @@ def Clean(self):
# You need to run both make clean and rm -rf as some modules relocate the shared libraries
clean_cmd = 'make clean ' + self.compiler_args
for _path in self.extension_paths:
if "PostMesh" not in _path and "LLDispatch" not in _path:
if "LLDispatch" not in _path:
execute('cd '+_path+' && echo rm -rf *.so && '+clean_cmd+' && rm -rf *.so *.'+self.extension_postfix)
elif "LLDispatch" in _path:
execute('cd '+_path+
Expand Down Expand Up @@ -262,7 +257,6 @@ def Build(self):
"_IsotropicElectroMechanics_108_",
"_Piezoelectric_100_"
]

# low_level_material_list = ["_IsotropicElectroMechanics_101_"]

assert self.extension_paths != None
Expand All @@ -275,10 +269,8 @@ def Build(self):
for material in low_level_material_list:
material = material.lstrip('_').rstrip('_')
execute('cd '+_path+' && make ' + self.compiler_args + " MATERIAL=" + material)
elif "PostMesh" in _path:
execute('cd '+_path+' && python setup.py build_ext -ifq')

# Get rid off cython sources
# Get rid of cython sources
sys.stdout = open(os.devnull, 'w')
self.SourceClean()
sys.stdout = sys.__stdout__
Expand Down

0 comments on commit d36b724

Please sign in to comment.