Skip to content

Commit

Permalink
Refactoring ibm/sbm/unfitted methods (#905)
Browse files Browse the repository at this point in the history
* Yy/debug pseudopenalty 2p (#904)

* Cekees/cleanup ib (#906)

* cleaned up some tests and removed some old code

* moved notebooks to lfs

* fix bug in particle_velocity and particle_signed_distance_normal sizing

* added pressure integral to cut cell approach

* use eN_k_3d instead of eN_k_nSpace for 2d particles (#915)

* fix added mass global residual assembly; enable Pres.LevelModel

* updated added mass comparison values

* update some test files and turn off cut cell integration

* disable MeshAdapt

* turn off optimization for travis compile

* reduce size of some tests

* update optimization level to 1
  • Loading branch information
cekees committed Mar 28, 2019
1 parent 1e9b1d8 commit e0b3726
Show file tree
Hide file tree
Showing 62 changed files with 2,589 additions and 9,360 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Expand Up @@ -19,3 +19,8 @@ proteus/tests/HotStart_3P/comparison_files/T01P1_hotstart.h5 filter=lfs diff=lfs
proteus/tests/HotStart_3P/comparison_files/T01P2_hotstart.h5 filter=lfs diff=lfs merge=lfs -text
proteus/tests/cylinder2D/sbm_3Dmesh/comparison_files/T001_P1_sbm_3Dmesh.h5 filter=lfs diff=lfs merge=lfs -text
proteus/tests/cylinder2D/ibm_rans2p/comparison_files/T1_ibm_rans2p.h5 filter=lfs diff=lfs merge=lfs -text
proteus/tests/cylinder2D/conforming_rans2p/plot_lift_drag_from_pv_files.ipynb filter=lfs diff=lfs merge=lfs -text
proteus/tests/cylinder2D/conforming_rans3p/plot_lift_drag_from_pv_files.ipynb filter=lfs diff=lfs merge=lfs -text
proteus/tests/cylinder2D/ibm_method/plot_lift_drag_force_from_particle.ipynb filter=lfs diff=lfs merge=lfs -text
proteus/tests/cylinder2D/ibm_rans2p/plot_lift_drag_force_from_particle.ipynb filter=lfs diff=lfs merge=lfs -text
proteus/tests/cylinder2D/sbm_method/plot_lift_drag_force_from_particle.ipynb filter=lfs diff=lfs merge=lfs -text
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -42,7 +42,7 @@ install:
- export PATHSAVE=$PATH
- export PATH=$PWD/linux2/bin:$PATH
- export LD_LIBRARY_PATH=$PWD/linux2/lib:$LD_LIBRARY_PATH
- PROTEUS_OPT="-O2 -UNDEBUG -w" FC=gfortran CC=mpicc CXX=mpicxx make develop N=2
- PROTEUS_OPT="-w -O1 -UNDEBUG" FC=gfortran CC=mpicc CXX=mpicxx make develop N=2
- export SSL_CERT_DIR=/etc/ssl/certs
- pip install matplotlib

Expand Down
20 changes: 10 additions & 10 deletions proteus/mprans/AddedMass.h
Expand Up @@ -511,16 +511,16 @@ namespace proteus
Aij[36*eBMT+added_mass_i+6*4] += (rz*px-rx*pz)*dS;
Aij[36*eBMT+added_mass_i+6*5] += (rx*py-ry*px)*dS;
}
//
//update the element and global residual storage
//
for (int i=0;i<nDOF_test_element;i++)
{
int eN_i = eN*nDOF_test_element+i;
globalResidual[offset_u+stride_u*u_l2g[eN_i]] += elementResidual_u[i];
}//i
}//ebNE
}
}//kb
//
//update the element and global residual storage
//
for (int i=0;i<nDOF_test_element;i++)
{
int eN_i = eN*nDOF_test_element+i;
globalResidual[offset_u+stride_u*u_l2g[eN_i]] += elementResidual_u[i];
}//i
}//ebNE
}


Expand Down
2 changes: 2 additions & 0 deletions proteus/mprans/Pres.py
Expand Up @@ -171,6 +171,7 @@ def postStep(self, t, firstStep=False):
r = 1
else:
r = old_div(self.fluidModel.timeIntegration.dt, self.fluidModel.timeIntegration.dt_history[0])
self.model.p_sharp_dof[:] = self.model.u[0].dof + r * self.pressureIncrementModel.u[0].dof
self.model.q_p_sharp[:] = self.model.q[('u', 0)] + r * self.pressureIncrementModel.q[('u', 0)]
self.model.ebqe_p_sharp[:] = self.model.ebqe[('u', 0)] + r * self.pressureIncrementModel.ebqe[('u', 0)]
self.model.q_grad_p_sharp[:] = self.model.q[('grad(u)', 0)] + r * self.pressureIncrementModel.q[('grad(u)', 0)]
Expand Down Expand Up @@ -354,6 +355,7 @@ def __init__(self,
dc.nFreeDOF_global for dc in list(self.dirichletConditions.values())]
self.nVDOF_element = sum(self.nDOF_trial_element)
self.nFreeVDOF_global = sum(self.nFreeDOF_global)
self.p_sharp_dof=self.u[0].dof.copy()
#
NonlinearEquation.__init__(self, self.nFreeVDOF_global)
#
Expand Down
18 changes: 0 additions & 18 deletions proteus/mprans/PresInit.py
Expand Up @@ -394,24 +394,6 @@ def __init__(self,
self.mesh.nElements_global *
self.mesh.nElementBoundaries_element *
self.nElementBoundaryQuadraturePoints_elementBoundary)
if type(self.u[0].femSpace) == C0_AffineLinearOnSimplexWithNodalBasis:
# print self.nQuadraturePoints_element
if self.nSpace_global == 3:
assert(self.nQuadraturePoints_element == 5)
elif self.nSpace_global == 2:
assert(self.nQuadraturePoints_element == 6)
elif self.nSpace_global == 1:
assert(self.nQuadraturePoints_element == 3)

# print self.nElementBoundaryQuadraturePoints_elementBoundary
if self.nSpace_global == 3:
assert(self.nElementBoundaryQuadraturePoints_elementBoundary == 4)
elif self.nSpace_global == 2:
assert(self.nElementBoundaryQuadraturePoints_elementBoundary == 4)
elif self.nSpace_global == 1:
assert(self.nElementBoundaryQuadraturePoints_elementBoundary == 1)

# pdb.set_trace()
#
# simplified allocations for test==trial and also check if space is mixed or not
#
Expand Down

0 comments on commit e0b3726

Please sign in to comment.