Hello all,
I am trying to apply multi point constraints to a 3D solid mechanics
problem.
My code used P4est, and PetSc.
Lets say I have a mesh with 10 X 10 X 3 elements.
I want to apply constraints such that all the dofs on the +z surface of the
middle element are constrained to be equal to the corresponding dofs on the
-z surface of the middle element.
That is Dof af (X,Y,-z surface) = Dof at (X,Y,+z surface).
Till now I have written this code but this does not seem to be working.
I am not clear with the concept of using Constraint Matrix with parallel
triangulation.
Can anyone help me to do this and pointout what is the error that I am
making ?
std::map<unsigned int, bool> vertex_touched;
typename DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (cell = dof_handler.begin_active(); cell != endc; ++cell)
if (cell->is_ghost() || cell->is_locally_owned())
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
vertex_touched[cell->vertex_index(v)] = false;
for (cell = dof_handler.begin_active(); cell != endc; ++cell)
if (cell->is_ghost() || cell->is_locally_owned())
{
bool cell_on_pm_z_face = false;
// donot take into account the cells which are at the top and bottom
boundary. We only need to impose constraints on the middle element.
const int face_mz = 4; const int face_pz = 5;
if (cell->face(face_mz)->boundary_id() == minus_z_boundary_id ||
cell->face(face_pz)->boundary_id() == plus_z_boundary_id)
{
cell_on_pm_z_face = true;
continue;
}
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
if(vertex_touched[cell->face(face_mz)->vertex_index(v)] == false)
{
vertex_touched[cell->face(face_mz)->vertex_index(v)] = true;
for (unsigned int d = 0; d < dofs_per_vertex; ++d)
{
types::global_dof_index dof1 = cell->face(face_mz)->vertex_dof_index(v, d);
types::global_dof_index dof2 = cell->face(face_pz)->vertex_dof_index(v, d);
{
constraints_mpcs.add_line(dof1);
constraints_mpcs.add_entry(dof1, dof2, 1.0);
}
}
}
}
Does constraint matrix need to know include the line when dofs1 and dofs2
i.e. both of them are not locally owned ?
or constraint matrix need to include the line when atleast of the dofs is
locally owned ?
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.