Skip to content

Commit

Permalink
Cekees/pstab (#598)
Browse files Browse the repository at this point in the history
* SDF function now takes the particle index as the first argument rather than time

* Fixed extra parentheses error.

* MBD: added separated mesh motion function (translation/rotation)

* reintroduced MeshAdaptPUMI in setup.py

* Setting particle velocity.

* Adding angular velocities.

* Added angular velocity to particle acceleration. Added viscous stress term to force calcualtion.

* debugging particle forces in RANS3PF2D

* Add 1D Riemann problem

* SWEs: copy SSP33 method from mwf implementation

* SWEs: checkoyt SW2DCV.py from mquezada/second_order_SWEs

* SWEs: checkout SW2DCV.h from mquezada/second_order_SWEs

* SWEs: checkout cSW2DCV.pyx from mquezada/second_order_SWEs

* SWEs: add SSP33 class within TimeIntegration

* SWEs: Add explicit solvers for SWEs

* Cekees/mbd/chrono (#570)

* re-enabled Nitsche adjoint for pinc

* updated optimized pressure calculation for projection scheme

* enabled optimized pressure solve for rans3p

* enabled optimized pressure solve for rans3p

* fixed mass flux for rotational form of pressure calc

* worked on isotropic interface size field

* fix 2D Darcy term and isotropic adaptive scheme

* update stack with fixed zoltan build

* SWEs: Change initial conditions for 1D Riemann problem

* SWEs: update to latest version of SWEs code from branch mquezada/second_order_SWEs

* updated hashstack (chrono)

* enabling using Z value of mesh input for bathy

* works with malpasset

* removed irrlicht dependency

* added velocity error estimate

* Fixx problem with FCT

* Add problem: dam over bumps

* Add Malpasset test

* Fix issue (for reading bathymetry) when merging some changes

* Minor change in FCT step

* added unstructured test to sw_hump case

* use Context in test files and archive bathy as mesh

* added user defined size_field ("isotropicProteus" option)

* Adds a viscosity scaled pressure mass matrix solver.

* Adds a viscosity scaled pressure mass matrix solver.

* Adds a Chebyshev semi-iteration solver.
     - Add a new class to create and apply a Chebyshev semi-iteration
     - Introduces several tests to verify resonable output
     - Adds a new function for turning dense numpy arrays
       into petsc4py matrices (really only useful for testing)

* Modifications made for parallel implementation.

* Fixed typo in setup.py.

* Creates a selfp class in Proteus.

* Removed unnecessary MPI_barriers.

* Refactors matrix construction to reduce parallel overhead.

* Adds RANS2P2D functions for building operators.

* PCD RANS2P with parallel support.

* Updates NumericalAnalytics for multiphyics problems.
	- Adds a csv file exporter.

* Updated TestTools utilities.

* Changes Chebyshev Semi-Iteration to be consistent with IFISS

* Adds a parallel info tracker for multilevel meshes.
     - Fixes a broken test.

* Latest edits for RANS2P dambreak problem

* fixed typo Dit->Dict

* fix strong bc's in RANS3PF.py; working on pressure/foce issues

* - Added the support for imposing the velocity BC for particles; particle_velocityList must be supported just like particle_sdfList.
- Added the support for simulating granular material; In this case granular_vel_Calc, and granular_sdf_Calc must be supported which calculate the velocity and sd field for any particle i.
- Bug fix in defining the surface penalty constant.
- Added the suport to export a single sd field for granular material simulations.

* Applied the fixes from
f8fdac4 [f8fdac4]
origin/rans3p_bc

* Testing Proteus integration.

* Archive bathymetry and water elevation

* added surface area check

* Debugging force calculations.

* Compute normalx and normaly vectors

* sdf debugging.

* add necessary variables in SW2DCV.py for reflecting boundary conditions

* change dam over bumps to use new reflecting BCs

* change default mesh to unstructured

* Added the surface area check and viscous forces from rans3p_bc
80601e0

* test reflecting BCs over dam break over bumps with non rectangular domain

* fixed parallel force calc for ibm in 2D

* fixed parallel force calc for ibm in 2D

* Changes to work with multiple particles.

* Add test for gauges

* fixed merge

* deep copy into dof[:] instead change dof reference to new array

* Changes to get 3D IB case working.

* Several changes to SW2DCV.h, SW2DCV.py and cSW2DCP.pyx. Mainly to change regularization and improve robustness

* ENH: Expose anisotropic interface with simple hardcoded size_scale and size_frame

* Revert "ENH: Expose anisotropic interface with simple hardcoded size_scale and size_frame"

This reverts commit b6ea6dd.

* Debugging IB particle forces.

* stabilization stuff

* 3D Mesh Reconstruction (#589)

Add 3D capability for SCOREC mesh-reconstruction from Proteus mesh data structures.

* ENH: Added serial 3D mesh reconstruction capability. Littered with debug statements

* MAINT: Removed debug statements and added doc strings for some conditionals. Parallel seems to work so long as partitioning is set correctly

* FIX: prevent boundary elements from collapsing by classifying exterior edge entities as model edges

* FIX: resolve assert if multiregion domain and add logic to inherit node materials from boundary materials in 3D

* fixed typo Dit->Dict (#578)

* FIX: only have owning edges send model info

* Revert "Revert "ENH: Expose anisotropic interface with simple hardcoded size_scale and size_frame"" (#588)

This turns on the hard-coded `size_scale` and `size_frame` fields for the `anisotropicProteus` option.
This reverts commit 31f5dfa.

* Added python script that creates symbolic links needed for proteus build

* Change the place where the low order dissipative matrix is computed

* Add function in c++ to compute the LO dissipative matrix, the edge_based_cfl and others (smoothness indicator and EV residual)

* Compute desired dt to fulfill positivity constraints from within choose_dt in RKEV

* Remove some computations on function that computes the edge_based_cfl

* Change again place where dLow is being computed

* Avoid computing dLow twice if we are in the first stage of the SSP method

* Add minor bug in SW2DCV.py

* Fixes the issue for running the ib cases in parallel, for 2D and 3D

* Archive quantDOFs (if the model has it)

* Adjust dt before calculateResidual based on 2nd order solution

* Change flags in solvers for SWEs to turn off part of the code in the 2nd call of calculateResidual

* This is a branch to test the different methods to apply no slip boundary conditions on IBs,
- The important part of this commit is applying the one-sided penalty terms only inside the IB, not outside; this is important to make sure that the boundary layer around the bodies are not modified; This finally makes sure that drag calculation is not affected by the source terms introduced at the fluid-solid interface.
- Another thing that is tested in this commit is adding dV*(1.0 - H_s)*C_vol*(u-u_s)*rho term to the force terms; this is to make sure that the momentum loss inside the IBs are taken into account as well. However, this requiers that u=us is satisfied inside the IB up to a fairly tight tolerance, otherwise large alpha and beta constants will results in a non-zero contribution in this exrpression.

* Add 2D paraboloid test

* Add 1D paraboloid test

* comment out pessure stabilization terms in RANS3PF2D

* This commit contains two different taks:
1- Fixing the issue with imposing the u=u_s at the inner nodes of the IB; most importantly the last five (except the third from last) chunk of the changes in RANS3PF2D.h are for this purpose. The pressure gradient term effect was also ignorded in the evaluateCoefficient method
2- WIP backend for the adaptive mesh refinment at the fluid-solid interface was added, but this is not working at this point

* Applying the changes form RANS3PF2D.h to RANS3PF.h

* Clang formated

* bug fix for particle simulation

* Adjoint stabilization.

* merge in orgin/master

* version of rans2p2d with no stabilization in momentum equation

* Bug fix in the RANS3PF for the cases where multiple particles are simulated.
The penalty terms should have been applied to all particles

* re-enabled shock capturing

* Fixed the bug for simulating multiple particles in 3D.

* Compute entropy residual based on flat bottom (b(x)=0)

* Add more than one gauge to test gauges with SWEs

* Add gauges and correct location of dam in Malpasset test

* Updated the mesh adaptivity for solid level set.
This needs to be modified for moving objects, since there is a lag between adapted mesh and the zero level set

* added hard-coded signed distance function

* corrected sdf for cavity test

* added compressible (non-conservative) form of momentum

To run as it has been in prior releases
COMPRESSIBLE_FORM=0.0
MOMENTUM_SGE=1.0 (turns off all subgrid error in momentum)
VELOCITY_SGE=1.0 (turns off velocity subgrid error in momentum)
PRESSURE_SGE=1.0 (turns off pressure subgrid error in momentum)

* fixed non-conservative time derivative and weak BC's in nc form

* re-enable density scalings

* switched to HamiltonianJacobian term

* cleaned up non-conservative form

* turn off density scaling in rho-scaled mass and advection

* switch to scalar diffusion in PCD laplace operator

* added mass lumping for pcd mass operators

* Adds a linearSmootherOptions tuple.
     - In our work, we've found that preconditioner settings can
       affect performance.  To make it easy to switch between these
       settings I've added a tuple that allows users to specify
       different preconditioner settings in the numericals and
       physics files.

* Adds a numerical viscosity option for the two-phase PCD operator.

* Changes the COMPRESSIBLE tag to NONCONSERVATIVE.

* Setup incompressible form for 3D case.

* Adds a lumped solver option for PCD mass matrices.

* Gauge compatibility fix with adaptivity (#592)

* FIX: ignore boundary flux contributions at interpart boundaries for element partitioning. Added a warning statement in NumericalSolution to describe limitation.

* MAINT: Removed some std::cout statements from grading algorithm

* MAINT: warning string should apply for any type of partitioning

* DOC/TST: Moved warning to RANS2P to fix Stokes Test that depends on log comparisons

* Use FE for malpasset test

* Cleans up merge with master branch.
       - Removes some leftover merge conflicts.
       - Corrects failing tests after merge.
       - Modifies operator constructor.

* Adds null-space documentation to Sp operator.
     - Adds a constant null space flag to Sp operator
     - Adds more documentation to Sp operator
     - Changes some print statements to logEvent
     - Deletes some code duplication.

* Adds boundary null space flag to OneLevelTransport class.
     - Adds a boundaryCreatesNullSpace attribute to the physics file
     - Adds a bdyNullSpace attribute to OneLevelTransport
     - Fixes hack so global nullspace is now set based on model specs

* Small documentation and code clean up.

* Update asserts in parallel setup.

* Adds phase_function option to RANS2P coefficients class.
     - Allows the user to specify a signed distance and
       vof function for the two-phase NS RANS2P coefficients.
     - Adds and exception handle for two-phase PCD preconditioner
       options.

* cleaned up RANS2P

* replaced Sequential_FixedStep_Simple with Sequential_tnList

* updated Sequential_FixedStep_Simple, part 2

* fix strong bc's in RANS3PF.py; working on pressure/foce issues

* added surface area check

* fixed parallel force calc for ibm in 2D

* fixed merge

* Add function calculateRedistancingResidual within NCLS model

* Add calculateRhsSmoothing within NCLS

* Add function calculateResidual_edge_based_EV within NCLS

* Add RKEV to NCLS.py

* Add SSP33 into TimeIntegration.py

* Add PeriodicBoundaryConditions argument into numerical flux: Advection_DiagonalUpwind_IIPG_exterior

* Add 1D test to NCLS model

* Add calculateResidual_entropy_viscosity and calculateJacobian_entropy_viscosity functions to RANS3PF models in 2 and 3D

* Compute CFL not within functions from subgrid errors

* Add convergence test on projection scheme

* Add cMax and cE (for entropy viscosity) parameters to RANS3PF.

* Add option to switch between calculateResidual and calculateResidual_entropy_viscosity based on use_entropy_viscosity in the _n.py model file

* Hard code the option to stop considering pressure gradients. This is for debugging and to study convergence of momentum equations.

* Add changes for entropy viscosity stabilization from 3D to 2D RANS3PF

* Select appropiate Jacobian depending on the type of stabilization (SUPG vs EV)

* Compute forces at quad points (during preStep) if the _p.py file has dictionary forceTerms

* Pass force terms at quad points to RANS3PF model

* Some changes to test for convergence on Proj Scheme

* Add KILL_PRESSURE_TERM to RANS3PF models. This is for debugging and to check convergence of momentum eqns

* Allow Pres.py model to exist without pressure increment model. This is useful to test convergence of the momentum equation

* Pass force terms to evaluate coefficients. Note: this is relevant just for the residual in the interior of the domain

* compute abs(det(J)) inside RANS3PF.py

* debugging prob with self.q[(m,0)]

* fix bug when setting self.q[(m,0)]

* add dV_u to RANS3PF.py model

* Pass q_grad_u, ..., ebqe_grad_u, ... to calculateResidual to save grads for computation of H1 error

* pass grad(u) at quad points in the interior of the elements and the boundaries to calculateResidual

* Add convergence test on NS momentum equations

* set pressure change to zero in postStep if pressureIncrementModel is None

* Let dV_u be the same (by reference) as dV

* Add and pass velocityStar at quad points. This is to fix order of accuracy (from 1st to 2nd) on RANS3PF

* Add u_dof_old, ..., dt and quantDOFs vectors to RANS3PF model. This is to comptue entropy residual

* Correct entropy residual

* Archive quantDOFs

* Compute smoothness indicator per cell for every component

* change test on pure momentum eqns for proj scheme to make it more conveniet for changing viscosity

* Testing an artificial viscosity for NS

* Add files for convergence test on proj scheme

* add density and viscosity as functions at quad points. To test convergence

* change from passing kinematic viscosity to dynamic viscosity

* add structures for density and dynamic viscosity at quad point given by user function

* change formulation to not divide by rho and modify weak entropy residual

* Forgot to add this file

* Add computation of L2 error on pressure if p is in the batch and if the analytical function is given

* Add femSpace to constructor of writeFunctionXdmf to make it work with P2 spaces

* Fix pressure update considering variable time steps and zero out q_massFlux if useRotationalForm=False

* Pass divU to PresInc.h, allow (via a flag) the rhs to not be integrated by parts and modify the rhs via a compatibility condition

* Fix Null Space of PresInc model, add flags for int by parts, kill pressure and correct the velocity

* Pass to PresInc flag for integrating by parts and divergence at quad points

* changes to RANS3PF: change computation of entropy residual, compute div(U) at quad points and add some flags

* change some parameters and force terms to convergence test on pure momentum equations for RANS3PF

* add a 2nd manufactures solution, parameters, flags and others to the conv test for the proj scheme

* add EV to 3D RANS3PF

* fix bug in SUPG stab

* scale entropy residual by rho to make it have units of dynamic viscosity

* Add self.order to C0_AffineLinear and C0_AffineQuadratic on simplexes

* scale hK by 1./order_of_polynomial

* change entropy residual to average instead of max

* add assert about integration by parts of div(U) in PresInc

* turn off modulation on EV coefficient

* turn off modulation also in 3D code

* Change test for convergence

* checkout NCLS model from master

* Fix ratio of time steps to consider first order time integration

* re-indented RANS2P

* untabified

* untabified RANS2P

* added boundaryFlags > 0 check to Jacobian flux terms too

* re-indented RANS3PF

* re-indented RANS3PF

* updated RANS3P with bdyNullSpace arg

* updated coding guidelines

* switched to sudo=false; removed apt packages

* Updates Chebyshev semi-iteration to inherit from LinearSolver class.
	- Removes IterativeSolver class
	- Documentation edits
	- Moves class from LinearAlgebra module to LinearSolver

* update chrono build

* fix chrono-dependent packages

* re-enabled apt-get packages since they are on the whitelist

* fixed assert(phis)

* slight update to makefile
  • Loading branch information
alistairbntl authored and cekees committed Sep 21, 2017
1 parent 1398047 commit db109b8
Show file tree
Hide file tree
Showing 111 changed files with 168,992 additions and 26,746 deletions.
2 changes: 1 addition & 1 deletion .hashstack_default
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9cc3f24fadb8be291e60766c43206b6333a63501
0f1c970ef4e1092c3944a6d61220bc65139ba322
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all check clean distclean doc install profile proteus update FORCE

all: install
all: develop

#We use environment variables from the invoking process if they have been set,
#otherwise we try our best to determine them automatically.
Expand All @@ -12,7 +12,12 @@ VER_CMD = git log -1 --pretty="%H"
PROTEUS_INSTALL_CMD = python setup.py install -O2
PROTEUS_DEVELOP_CMD = pip --disable-pip-version-check install -v -e .
# shell hack for now to automatically detect Garnet front-end nodes
PROTEUS_ARCH ?= $(shell [[ $$(hostname) = garnet* ]] && echo "garnet.gnu" || python -c "import sys; print sys.platform")
PROTEUS_ARCH ?= $(shell [[ $$(hostname) = topaz* ]] && echo "topaz" || python -c "import sys; print sys.platform")
PROTEUS_ARCH ?= $(shell [[ $$(hostname) = onyx* ]] && echo "onyx" || python -c "import sys; print sys.platform")
PROTEUS_ARCH ?= $(shell [[ $$(hostname) = copper* ]] && echo "copper" || python -c "import sys; print sys.platform")
PROTEUS_ARCH ?= $(shell [[ $$(hostname) = excalibur* ]] && echo "excalibur" || python -c "import sys; print sys.platform")
PROTEUS_ARCH ?= $(shell [[ $$(hostname) = lightning* ]] && echo "lightning" || python -c "import sys; print sys.platform")
PROTEUS_ARCH ?= $(shell [[ $$(hostname) = spirit* ]] && echo "spirit" || python -c "import sys; print sys.platform")
PROTEUS_PREFIX ?= ${PROTEUS}/${PROTEUS_ARCH}
PROTEUS_PYTHON ?= ${PROTEUS_PREFIX}/bin/python
PROTEUS_VERSION := $(shell ${VER_CMD})
Expand Down Expand Up @@ -153,11 +158,10 @@ matlab_setup.done: stack stack/default.yaml hashdist

profile: ${PROTEUS_PREFIX}/artifact.json

stack/default.yaml: stack stack/examples/proteus.${PROTEUS_ARCH}.yaml
# workaround since mac doesn't support '-b' and '-i' breaks travis
-cp ${PWD}/stack/default.yaml ${PWD}/stack/default.yaml.bak
ln -sf ${PWD}/stack/examples/proteus.${PROTEUS_ARCH}.yaml ${PWD}/stack/default.yaml
stack/default.yaml: ${PWD}/stack/default.yaml

${PWD}/stack/default.yaml:
-ln -s ${PWD}/stack/examples/proteus.${PROTEUS_ARCH}.yaml ${PWD}/stack/default.yaml

# A hashstack profile will be rebuilt if Make detects any files in the stack
# directory newer than the profile artifact file.
Expand Down Expand Up @@ -205,7 +209,7 @@ ${PROTEUS_PREFIX}/bin/proteus ${PROTEUS_PREFIX}/bin/proteus_env.sh: profile
@echo "************************"

# Proteus install should be triggered by an out-of-date hashstack profile, source tree, or modified setup files.
install: profile $(shell find proteus -type f) $(wildcard *.py) proteus
install: profile $(wildcard *.py) proteus
@echo "************************"
@echo "Installing..."
@echo "************************"
Expand Down
2 changes: 2 additions & 0 deletions proteus/FemTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3527,6 +3527,7 @@ class C0_AffineLinearOnSimplexWithNodalBasis(ParametricFiniteElementSpace):
a linear affine mapping. The nodal basis is used on the reference simplex.
"""
def __init__(self,mesh,nd=3):
self.order = 1
localFunctionSpace = LinearOnSimplexWithNodalBasis(nd)
interpolationConditions = NodalInterpolationConditions(localFunctionSpace.referenceElement)
ParametricFiniteElementSpace.__init__(self,
Expand Down Expand Up @@ -4597,6 +4598,7 @@ class C0_AffineQuadraticOnSimplexWithNodalBasis(ParametricFiniteElementSpace):
The nodal basis is used on the reference simplex.
"""
def __init__(self,mesh,nd=3):
self.order = 2
localFunctionSpace = QuadraticOnSimplexWithNodalBasis(nd)
localGeometricSpace= LinearOnSimplexWithNodalBasis(nd)
interpolationConditions = QuadraticLagrangeNodalInterpolationConditions(localFunctionSpace.referenceElement)
Expand Down
19 changes: 13 additions & 6 deletions proteus/Gauges.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def __init__(self, fields, activeTime=None, sampleRate=0, fileName='gauges.csv',
self.dofsVecs = []
self.pointGaugeVecs = []
self.segments = []
self.adapted = False

self.isPointGauge = bool(points)
self.isLineGauge = bool(lines) and not integrate
Expand Down Expand Up @@ -310,13 +311,17 @@ def initOutputWriter(self):

numLocalQuantities = sum([len(self.measuredQuantities[field]) for field in self.fields])
self.localQuantitiesBuf = np.zeros(numLocalQuantities)

if self.gaugeComm.rank != 0:
self.globalQuantitiesBuf = None
self.globalQuantitiesCounts = None
else:
self.fileName = os.path.join(Profiling.logDir, self.fileName)
self.file = open(self.fileName, 'w')
if self.adapted:
if(Profiling.logDir not in self.fileName):
self.fileName = os.path.join(Profiling.logDir, self.fileName)
self.file = open(self.fileName, 'a')
else:
self.fileName = os.path.join(Profiling.logDir, self.fileName)
self.file = open(self.fileName, 'w')

if self.isLineIntegralGauge:
#Only need to set up mapping for point gauges
Expand Down Expand Up @@ -662,7 +667,7 @@ def attachModel(self, model, ar):
lineSegments = self.getMeshIntersections(line)
self.addLineGaugePoints(line, lineSegments)
linesSegments.append(lineSegments)

self.identifyMeasuredQuantities()

self.buildGaugeComm()
Expand All @@ -671,7 +676,10 @@ def attachModel(self, model, ar):
self.initOutputWriter()
self.buildPointGaugeOperators()
self.buildLineIntegralGaugeOperators(self.lines, linesSegments)
self.outputHeader()
if self.adapted:
pass
else:
self.outputHeader()
return self

def get_time(self):
Expand All @@ -683,7 +691,6 @@ def outputHeader(self):
""" Outputs a single header for a CSV style file to self.file"""

assert self.isGaugeOwner

if self.gaugeComm.rank == 0:
self.file.write("%10s" % ('time',))
if self.isPointGauge or self.isLineGauge:
Expand Down
Loading

0 comments on commit db109b8

Please sign in to comment.