Skip to content
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

Address several old issus higher-order FEM, poisson tests, and testing problems #1206

Merged
merged 12 commits into from
Jun 8, 2020
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- PROTEUS_OPT="-w -g0 -O2 -UNDEBUG" FC=gfortran CC=mpicc CXX=mpicxx make develop N=2
- export SSL_CERT_DIR=/etc/ssl/certs
script:
- PATH=./linux/bin:$PATH MPLBACKEND=Agg py.test -n 1 --dist=loadfile --forked -v proteus/tests --ignore proteus/tests/POD --cov=proteus
- PATH=./linux/bin:$PATH MPLBACKEND=Agg py.test -n 1 --dist=loadfile --forked -v proteus/tests --ignore proteus/tests/POD --ignore proteus/tests/solver_tests/test_nse_RANS2P_step.py --cov=proteus
- PATH=./linux/bin:$PATH MPLBACKEND=Agg py.test -n 1 --dist=loadfile --forked -v air-water-vv/Tests/1st_set --cov=proteus
- PATH=./linux/bin:$PATH MPLBACKEND=Agg py.test -n 1 --dist=loadfile --forked -v air-water-vv/Tests/2nd_set --cov=proteus
- stage: test
Expand All @@ -79,7 +79,7 @@ jobs:
- make develop-conda N=1
script:
- export MPLBACKEND="AGG"
- py.test -n 1 --dist=loadfile --forked -v proteus/tests --ignore proteus/tests/POD --cov=proteus
- py.test -n 1 --dist=loadfile --forked -v proteus/tests --ignore proteus/tests/POD --ignore proteus/tests/solver_tests/test_nse_RANS2P_step.py --cov=proteus
- MPLBACKEND=Agg py.test -n 1 --dist=loadfile --forked -v air-water-vv/Tests/1st_set
- MPLBACKEND=Agg py.test -n 1 --dist=loadfile --forked -v air-water-vv/Tests/2nd_set
deploy:
Expand Down Expand Up @@ -108,4 +108,4 @@ jobs:
- export MPLBACKEND="AGG"
- git lfs install
- git lfs pull
- py.test -n 1 --dist=loadfile --forked -v proteus/tests --ignore proteus/tests/solver_tests --ignore proteus/tests/POD --ignore proteus/tests/MeshAdaptPUMI --ignore=proteus/tests/matrix_constructor --ignore=proteus/tests/MoveMeshMonitor --ignore-glob='proteus/tests/periodic/*test_periodic.py' --cov=proteus
- py.test -n 1 --dist=loadfile --forked -v proteus/tests --ignore proteus/tests/solver_tests --ignore proteus/tests/POD --ignore proteus/tests/MeshAdaptPUMI --ignore=proteus/tests/matrix_constructor --ignore=proteus/tests/MoveMeshMonitor --ignore-glob='proteus/tests/periodic/*test_periodic.py' --ignore proteus/tests/solver_tests/test_nse_RANS2P_step.py --ignore proteus/tests/poisson_2d --cov=proteus
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ docs:
@echo "make install"
@echo "************************************"

-${PROTEUS_ENV} pip install sphinx sphinx_rtd_theme breathe exhale
-${PROTEUS_ENV} pip3 install sphinx sphinx_rtd_theme breathe exhale
cd docs && ${PROTEUS_ENV} PROTEUS=${PWD} make html

@echo "**********************************"
Expand All @@ -290,11 +290,11 @@ test: air-water-vv check
@echo "**************************************************************************"
@echo "Running basic test suite"
ifeq (${PROTEUS_ARCH},darwin)
-MPLBACKEND=Agg py.test -n ${N} --dist=loadfile --forked -v proteus/tests -m ${TEST_MARKER} --ignore proteus/tests/solver_tests --ignore proteus/tests/POD --ignore proteus/tests/MeshAdaptPUMI --ignore=proteus/tests/matrix_constructor --ignore=proteus/tests/MoveMeshMonitor --ignore-glob='proteus/tests/periodic/*test_periodic.py' --cov=proteus
-MPLBACKEND=Agg py.test -n ${N} --dist=loadfile --forked -v proteus/tests -m ${TEST_MARKER} --ignore proteus/tests/solver_tests --ignore proteus/tests/POD --ignore proteus/tests/MeshAdaptPUMI --ignore=proteus/tests/matrix_constructor --ignore=proteus/tests/MoveMeshMonitor --ignore-glob='proteus/tests/periodic/*test_periodic.py' --ignore=proteus/tests/solver_tests/test_nse_RANS2P_step.py --cov=proteus
@echo "Basic tests complete "
@echo "************************************"
else
-source ${PROTEUS_PREFIX}/bin/proteus_env.sh; MPLBACKEND=Agg py.test -n ${N} --dist=loadfile --forked -v proteus/tests -m ${TEST_MARKER} --ignore proteus/tests/POD --ignore proteus/tests/MeshAdaptPUMI --cov=proteus
-source ${PROTEUS_PREFIX}/bin/proteus_env.sh; MPLBACKEND=Agg py.test -n ${N} --dist=loadfile --forked -v proteus/tests -m ${TEST_MARKER} --ignore proteus/tests/POD --ignore proteus/tests/MeshAdaptPUMI --ignore=proteus/tests/solver_tests/test_nse_RANS2P_step.py --cov=proteus
@echo "Basic tests complete "
@echo "************************************"
@echo "Running air-water-vv test set 1"
Expand Down
238 changes: 117 additions & 121 deletions proteus/Archiver.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions proteus/NumericalFlux.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ def __init__(self,vt,getPointwiseBoundaryConditions,
Advection_DiagonalUpwind_Diffusion_IIPG.__init__(self,vt,getPointwiseBoundaryConditions,
getAdvectiveFluxBoundaryConditions,
getDiffusiveFluxBoundaryConditions)
self.penalty_constant = 10.0
self.penalty_constant = 100.0
cekees marked this conversation as resolved.
Show resolved Hide resolved
self.includeBoundaryAdjoint=True
self.boundaryAdjoint_sigma=1.0

Expand Down Expand Up @@ -1237,7 +1237,7 @@ def __init__(self,
getPointwiseBoundaryConditions,
getAdvectiveFluxBoundaryConditions,
getDiffusiveFluxBoundaryConditions)
self.penalty_constant = 10.0
self.penalty_constant = 100.0
self.includeBoundaryAdjoint=True
self.boundaryAdjoint_sigma=1.0

Expand Down
2 changes: 1 addition & 1 deletion proteus/TwoPhaseFlow/utils/Parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def __init__(self,
# self.n.linearSmoother = None
# NUMERICAL FLUX
# self.n.massLumping = False
# self.n.conservativeFlux = None
self.n.conservativeFlux = None
cekees marked this conversation as resolved.
Show resolved Hide resolved
# TOLERANCES
self.n.nl_atol_res = None
self.n.l_atol_res = None
Expand Down
5 changes: 0 additions & 5 deletions proteus/mprans/AddedMass.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,6 @@ def __init__(self,
self.mesh.elementBoundaryDiametersArray[ebN]**self.numericalFlux.penalty_power)
logEvent(memory("numericalFlux", "OneLevelTransport"), level=4)
self.elementEffectiveDiametersArray = self.mesh.elementInnerDiametersArray
# use post processing tools to get conservative fluxes, None by default
from proteus import PostProcessingTools
self.velocityPostProcessor = PostProcessingTools.VelocityPostProcessingChooser(
self)
logEvent(memory("velocity postprocessor", "OneLevelTransport"), level=4)
# helper for writing out data storage
from proteus import Archiver
self.elementQuadratureDictionaryWriter = Archiver.XdmfWriter()
Expand Down
8 changes: 6 additions & 2 deletions proteus/tests/AddedMass/test_addedmass2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import unittest
import numpy as np
import numpy.testing as npt
from importlib import import_module
from importlib import import_module, reload
from petsc4py import PETSc

reload(PETSc)
modulepath = os.path.dirname(os.path.abspath(__file__))

class TestAddedMass2D(unittest.TestCase):
Expand Down Expand Up @@ -40,6 +40,9 @@ def teardown_method(self, method):

def test_AddedMass_2D(self):
from proteus import defaults
defaults.reset_default_p()
defaults.reset_default_n()
defaults.reset_default_so()
from . import addedmass2D as am2D
am2D.myTpFlowProblem.initializeAll()
so = am2D.myTpFlowProblem.so
Expand All @@ -57,6 +60,7 @@ def test_AddedMass_2D(self):
Profiling.verbose = True
# PETSc solver configuration
OptDB = PETSc.Options()
OptDB.clear()
dirloc = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(dirloc, "petsc.options.superlu_dist")) as f:
all = f.read().split()
Expand Down
7 changes: 6 additions & 1 deletion proteus/tests/AddedMass/test_addedmass3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import unittest
import numpy as np
import numpy.testing as npt
from importlib import import_module
from importlib import import_module, reload
from petsc4py import PETSc
reload(PETSc)
import pytest

modulepath = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -42,6 +43,9 @@ def teardown_method(self, method):
@pytest.mark.skipif(sys.platform == "darwin", reason="does not run on macOS")
def test_AddedMass_3D(self):
from proteus import defaults
defaults.reset_default_p()
defaults.reset_default_n()
defaults.reset_default_so()
from . import addedmass3D as am3D
am3D.myTpFlowProblem.initializeAll()
so = am3D.myTpFlowProblem.so
Expand All @@ -59,6 +63,7 @@ def test_AddedMass_3D(self):
Profiling.verbose = True
# PETSc solver configuration
OptDB = PETSc.Options()
OptDB.clear()
dirloc = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(dirloc, "petsc.options.superlu_dist")) as f:
all = f.read().split()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_2D_hex(self):
poisson_n.nnx=poisson_p.nn
poisson_n.nny=poisson_p.nn
poisson_n.nnz=1
poisson_n.conservativeFlux=None
# Update name
self.so.name = "2D_"+self.pList[0].name+"_hex_degree2"
# NUMERICAL SOLUTION #
Expand Down Expand Up @@ -121,6 +122,7 @@ def test_3D_hex(self):
poisson_n.nnx=poisson_p.nn
poisson_n.nny=poisson_p.nn
poisson_n.nnz=poisson_p.nn
poisson_n.conservativeFlux=None
# Update name
self.so.name = "3D_"+self.pList[0].name+"_hex_degree2"
# NUMERICAL SOLUTION #
Expand Down
1 change: 1 addition & 0 deletions proteus/tests/CLSVOF/disc_ICs/test_CLSVOF_discICs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class TestCLSVOF(object):

@classmethod
def setup_class(cls):
default_n.conservativeFlux=None
pass

@classmethod
Expand Down
1 change: 1 addition & 0 deletions proteus/tests/CLSVOF/pure_level_set/test_clsvof.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class TestCLSVOF(object):

@classmethod
def setup_class(cls):
default_n.conservativeFlux=None
pass

@classmethod
Expand Down
2 changes: 2 additions & 0 deletions proteus/tests/CLSVOF/with_RANS3PF/test_clsvof_with_rans3pf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def teardown_class(cls):
pass

def reload_modules(self):
reload(default_n)
reload(default_p)
reload(default_so)
reload(multiphase)
reload(multiphase_so)
Expand Down
1 change: 1 addition & 0 deletions proteus/tests/LS_with_edgeBased_EV/MCorr/test_mcorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def test_supg(self):
thelper_cons_ls.ct.STABILIZATION_TYPE_ncls=0
thelper_cons_ls.ct.DO_REDISTANCING=False
thelper_cons_ls.ct.STABILIZATION_TYPE_vof=0
reload(default_n)
reload(thelper_cons_ls_so)
reload(thelper_ncls_p)
reload(thelper_ncls_n)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
multilevelLinearSolver = LU
levelLinearSolver = LU

conservativeFlux = {}
conservativeFlux = None
if checkMass:
auxiliaryVariables = [AuxiliaryVariables.ConservationHistoryMC("vortex2d"+repr(lRefinement)+"p"+repr(pDegree_ls))]
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
multilevelLinearSolver = LU
levelLinearSolver = LU

conservativeFlux = {}
conservativeFlux = None
4 changes: 4 additions & 0 deletions proteus/tests/LS_with_edgeBased_EV/NCLS/test_ncls.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def test_pure_advection_supg(self):
ncls.ct.STABILIZATION_TYPE = 0 # SUPG
ncls.ct.COUPEZ = False
ncls.ct.DO_REDISTANCING = False
reload(default_n)
reload(ncls_n)
reload(ncls_p)
self.so.name = self.pList[0].name+"_pureAdvection_SUPG"
Expand All @@ -74,6 +75,7 @@ def test_pure_advection_ev1(self):
ncls.ct.ENTROPY_TYPE = 1 # quadratic entropy
ncls.ct.COUPEZ = False
ncls.ct.DO_REDISTANCING = False
reload(default_n)
reload(ncls_n)
reload(ncls_p)
self.so.name = self.pList[0].name+"_pureAdvection_EV1"
Expand All @@ -100,6 +102,7 @@ def test_coupez_with_redistancing_non_saturated(self):
ncls.ct.ENTROPY_TYPE = 1
ncls.ct.COUPEZ = True
ncls.ct.DO_REDISTANCING = True
reload(default_n)
reload(ncls_n)
reload(ncls_p)
self.so.name = self.pList[0].name+"_non_saturated_ls"
Expand Down Expand Up @@ -127,6 +130,7 @@ def test_coupez_with_redistancing_saturated(self):
ncls.ct.ENTROPY_TYPE = 2
ncls.ct.COUPEZ = True
ncls.ct.DO_REDISTANCING = True
reload(default_n)
reload(ncls_n)
reload(ncls_p)
self.so.name = self.pList[0].name+"_saturated_ls"
Expand Down
7 changes: 7 additions & 0 deletions proteus/tests/LS_with_edgeBased_EV/VOF/test_vof.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def teardown_class(cls):

def setup_method(self,method):
"""Initialize the test problem. """
reload(default_n)
reload(thelper_vof)
self.pList = [thelper_vof_p]
self.nList = [thelper_vof_n]
Expand All @@ -47,6 +48,7 @@ def test_supg(self):
########
thelper_vof.ct.STABILIZATION_TYPE = 0 # SUPG
thelper_vof.ct.FCT = False
reload(default_n)
reload(thelper_vof_p)
reload(thelper_vof_n)
self.so.name = self.pList[0].name+"_SUPG"
Expand All @@ -73,6 +75,7 @@ def test_TaylorGalerkin(self):
##################
thelper_vof.ct.STABILIZATION_TYPE = 1 # Taylor Galerkin
thelper_vof.ct.FCT = False
reload(default_n)
reload(thelper_vof_p)
reload(thelper_vof_n)
self.so.name = self.pList[0].name+"_TaylorGalerkin"
Expand Down Expand Up @@ -103,6 +106,7 @@ def test_EV1(self):
thelper_vof.ct.ENTROPY_TYPE = 1 #polynomial
thelper_vof.ct.cE = 1.0
thelper_vof.ct.FCT = True
reload(default_n)
reload(thelper_vof_p)
reload(thelper_vof_n)
self.so.name = self.pList[0].name+"_EV1"
Expand All @@ -128,6 +132,7 @@ def test_EV2(self):
thelper_vof.ct.ENTROPY_TYPE = 1 #logarithmic
thelper_vof.ct.cE = 0.1
thelper_vof.ct.FCT = True
reload(default_n)
reload(thelper_vof_p)
reload(thelper_vof_n)
self.so.name = self.pList[0].name+"_EV2"
Expand All @@ -151,6 +156,7 @@ def test_EV2(self):
def test_SmoothnessBased(self):
thelper_vof.ct.STABILIZATION_TYPE = 3 # Smoothness based
thelper_vof.ct.FCT = True
reload(default_n)
reload(thelper_vof_p)
reload(thelper_vof_n)
self.so.name = self.pList[0].name+"_SmoothnessBased"
Expand All @@ -176,6 +182,7 @@ def test_SmoothnessBased(self):
def test_stab4(self):
thelper_vof.ct.STABILIZATION_TYPE = 4 # Proposed by D.Kuzmin
thelper_vof.ct.FCT = True
reload(default_n)
reload(thelper_vof_p)
reload(thelper_vof_n)
self.so.name = self.pList[0].name+"_stab4"
Expand Down
2 changes: 0 additions & 2 deletions proteus/tests/poisson_2d/petsc.options

This file was deleted.

2 changes: 0 additions & 2 deletions proteus/tests/poisson_2d/petsc.options_superlu_dist

This file was deleted.

Loading