Skip to content

Commit

Permalink
changed 3dparty folder on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
teseoch committed Mar 14, 2019
1 parent 260ee3c commit b0c8179
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build/
build.nosync/
bin/
bin_rel/
3rdparty/
3rdparty*
*.sublime-workspace
copy_lib
*.sublime-project
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ cmake_minimum_required(VERSION 3.1)
project(polyfempy)
################################################################################

set(THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/)
if(INPUT_THIRD_PARTY_DIR)
set(THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${INPUT_THIRD_PARTY_DIR}/)
else()
set(THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/)
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# Color output
Expand Down
2 changes: 1 addition & 1 deletion cmake/PolyfemPythonDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Configuration
set(POLYFEM_PYTHON_ROOT "${CMAKE_CURRENT_LIST_DIR}/..")
set(POLYFEM_PYTHON_EXTERNAL "${POLYFEM_PYTHON_ROOT}/3rdparty")
set(POLYFEM_PYTHON_EXTERNAL ${THIRD_PARTY_DIR})

# Download and update 3rdparty libraries
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def build_extension(self, ext):
'-DPOLYFEM_WITH_APPS=OFF',
'-DPOLYFEM_WITH_MISC=OFF']

if platform.system() == 'Darwin':
cmake_args.append('-DINPUT_THIRD_PARTY_DIR=3rdparty.nosync')


cfg = 'Debug' if self.debug else 'Release'
build_args = ['--config', cfg]

Expand Down
8 changes: 6 additions & 2 deletions tests/bending.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import unittest

import platform
import polyfempy as pf
# from .utils import plot
import os


class BendingTest(unittest.TestCase):
def test_run(self):
root_folder = os.path.join("..", "3rdparty.nosync" if platform.system() == 'Darwin' else "3rdparty", "data")


dir_path = os.path.dirname(os.path.realpath(__file__))
mesh_path = os.path.join(dir_path, "../3rdparty/data/square_beam.mesh")
tag_path = os.path.join(dir_path, "../3rdparty/data/square_beam.txt")
mesh_path = os.path.join(dir_path, root_folder, "square_beam.mesh")
tag_path = os.path.join(dir_path, root_folder, "square_beam.txt")

settings = pf.Settings()
settings.discr_order = 1
Expand Down
5 changes: 4 additions & 1 deletion tests/inflation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import polyfempy as pf
import numpy as np
import platform

# from .utils import plot

Expand All @@ -10,11 +11,13 @@

class InflationTest(unittest.TestCase):
def test_run(self):
root_folder = os.path.join("..", "3rdparty.nosync" if platform.system() == 'Darwin' else "3rdparty", "data")

solver = pf.Solver()

#some setup
dir_path = os.path.dirname(os.path.realpath(__file__))
mesh_path = os.path.join(dir_path, "../3rdparty/data/circle2.msh")
mesh_path = os.path.join(dir_path, root_folder, "circle2.msh")
print(mesh_path)

settings = pf.Settings()
Expand Down
5 changes: 4 additions & 1 deletion tests/plane_hole.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
import polyfempy as pf
# from .utils import plot
import os
import platform


class BendingTest(unittest.TestCase):
def test_run(self):
root_folder = os.path.join("..", "3rdparty.nosync" if platform.system() == 'Darwin' else "3rdparty", "data")

dir_path = os.path.dirname(os.path.realpath(__file__))
mesh_path = os.path.join(dir_path, "../3rdparty/data/plane_hole.obj")
mesh_path = os.path.join(dir_path, root_folder, "plane_hole.obj")

settings = pf.Settings()
settings.discr_order = 1
Expand Down
5 changes: 3 additions & 2 deletions tests/torsion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
# from .utils import plot

import os

import platform

class TorsionTest(unittest.TestCase):
def test_run(self):
root_folder = os.path.join("..", "3rdparty.nosync" if platform.system() == 'Darwin' else "3rdparty", "data")
dir_path = os.path.dirname(os.path.realpath(__file__))
mesh_path = os.path.join(dir_path, "../3rdparty/data/square_beam_h.HYBRID")
mesh_path = os.path.join(dir_path, root_folder, "square_beam_h.HYBRID")

settings = pf.Settings()
settings.discr_order = 1
Expand Down

0 comments on commit b0c8179

Please sign in to comment.