Skip to content

Commit

Permalink
fixed hanging node and periodic constraints bug in meshMovement. Prev…
Browse files Browse the repository at this point in the history
…iously failing example provided by Krishnedu now passes. Did ctests
  • Loading branch information
dsambit committed Apr 12, 2018
1 parent 024f434 commit db3d33c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion include/meshMovement.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ namespace dftfe {
IndexSet d_locally_owned_dofs;
IndexSet d_locally_relevant_dofs;
ConstraintMatrix d_constraintsMoveMesh;
ConstraintMatrix d_constraintsHangingNodes;
std::vector<GridTools::PeriodicFacePair<typename DoFHandler<C_DIM>::cell_iterator> > d_periodicity_vector;
std::vector<std::vector<double> > d_domainBoundingVectors;

Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dealiiPetscComplexDir="/home/vikramg/DFT-FE-softwares/softwareCentos/dealiiDev/i
alglibDir="/nfs/mcfs_comp/home/rudraa/software/alglib/cpp/src"
libxcDir="/home/vikramg/DFT-FE-softwares/softwareCentos/libxcNew/install_intel18"
spglibDir="/home/vikramg/DFT-FE-softwares/softwareCentos/spglib"
optimizedMode=0
optimizedMode=1
#
#Usually, no changes are needed below this line
#
Expand Down
3 changes: 2 additions & 1 deletion src/dft/locatenodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ void dftClass<FEOrder>::locatePeriodicPinnedNodes()
{
if(locally_owned_dofs.is_element(iterMap->first))
{
if(!d_noConstraints.is_constrained(iterMap->first))
if(!(constraintsNone.is_constrained(iterMap->first)
&& !constraintsNone.is_identity_constrained(iterMap->first)))
{
double minDistance = 1e10;
minNode = -1;
Expand Down
7 changes: 2 additions & 5 deletions src/triangulation/meshMovement/meshMovement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ void meshMovementClass::init(const Triangulation<3,3> & triangulation, const std
d_locally_owned_dofs = d_dofHandlerMoveMesh.locally_owned_dofs();
DoFTools::extract_locally_relevant_dofs(d_dofHandlerMoveMesh, d_locally_relevant_dofs);

d_constraintsHangingNodes.clear(); d_constraintsHangingNodes.reinit(d_locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(d_dofHandlerMoveMesh, d_constraintsHangingNodes);
d_constraintsHangingNodes.close();

d_constraintsMoveMesh.clear(); d_constraintsMoveMesh.reinit(d_locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(d_dofHandlerMoveMesh, d_constraintsMoveMesh);
d_periodicity_vector.clear();
Expand Down Expand Up @@ -410,7 +406,8 @@ void meshMovementClass::findClosestVerticesToDestinationPoints(const std::vector
continue;
vertex_touched[global_vertex_no]=true;

if(d_constraintsHangingNodes.is_constrained(cell->vertex_dof_index(i,0))
if((d_constraintsMoveMesh.is_constrained(cell->vertex_dof_index(i,0))
&& !d_constraintsMoveMesh.is_identity_constrained(cell->vertex_dof_index(i,0)))
|| !d_locally_owned_dofs.is_element(cell->vertex_dof_index(i,0))){
continue;
}
Expand Down

0 comments on commit db3d33c

Please sign in to comment.