I am trying to apply boundary conditions on a Sparsematrix with two Dof_handlers in a parallel::distributed::trinagulation setting for the Step-35 tutorial.( Same context as in this thread https://groups.google.com/forum/#!topic/dealii/9ibgrQ0mFBs).At initializing the gradient_operator, I have an object with two Dof_Handlers, which I use for a sparsity pattern.DoFTools::make_sparsity_pattern (dof_handler_velocity,dof_handler_pressure,dsp);But when I apply boundary values to a PETSCWrapper::SparseMatrix using this sparsity pattern I get the following errorat the function MatrixTools::apply_boundary_values"The violated condition was: !has_ghost_elements()
I tried another way to apply the boundary conditions with the use of a COnstraintMatrix as in the Step-40 tutorial. But in that case themake_sparsity_pattern function doesn't work, when I use the commandd:DoFTools::make_sparsity_pattern (dof_handler_velocity,dof_handler_pressure,dsp,constraints_velocity,false);(There I get the error "candidate expects 3 arguments, 5 provided).
Hey, I just worked through the make_sparsity_pattern code.I think I know how to fix the mentioned problem. But I dont understand thehow to use the "bool_dof_mask" in the correct way. It is used in he constraints.add_entries_local_to_global(...)function.In the make_sparsity_pattern function with a single dof_handler and a constraintmatrix, it is constructed by a fe_collection.But I don't see how to construct the bool_dof_mask with 2 dof_handlers and respectively 2 fe_collections.Do you have a clue?
At first I extended the make_sparsity_pattern function tovoid DoFTools::make_sparsity_pattern ( const DoFHandlerType & dof_row,const DoFHandlerType & dof_col,
SparsityPatternType & sparsity,const ConstraintMatrix &constraints,
const bool keep_constrained_dofs)and also changed the dof_tools.h file in deal.II\source\dofs and changed the adding function;but when I compiled this I got lots of errors of this kind:error: template-id ‘make_sparsity_pattern<dealii::hp::DoFHandler<1, 3>, dealii::BlockDynamicSparsityPattern>’ for ‘void dealii::DoFTools::make_sparsity_pattern(const dealii::hp::DoFHandler<1, 3>&, const dealii::hp::DoFHandler<1, 3>&, dealii::BlockDynamicSparsityPattern&)’ does not match any template declaration
My second attempt was to make a new function, with a different name, which takes the same arguments as above and does exactly was the classical make_sp_pt(row_id,col_id,sparsity) function does, up to the constraints.add... function.I also added the header of these function to the dof_tools.h file.This compiled fine, but when I used this function in my program I got the error:undefined reference to: (function parameters).
Best,Daniel
Hey I just added my changes to a github branch ( https://github.com/gabpeters/dealii/tree/sparsity )I changed the make_sparsity_pattern(dof_row,dor_col,sparsity) function and also changed the header in thedof_tools.h file and the signature in the dof_tools_sparsity.inst.in file.But still I get the following error, when I compile my code:undefined reference to `void dealii::DoFTools::make_sparsity_pattern<dealii::DoFHandler<3, 3>,dealii::DynamicSparsityPattern>(dealii::DoFHandler<3, 3> const&, dealii::DoFHandler<3, 3>const&, dealii::DynamicSparsityPattern&, dealii::ConstraintMatrix const&, bool)'Did I still forget to change any reference?
Now I cloned a more recent version, and added the Constraintsmatrix and changed the instantiations.
But somehow it still doesn't work. I still get the error "undefined reference..."
I hope I dont bother you too much with all these questions.
But I think I did a mistake somewhere in the function. Using the definiion of the function from your pull requestI callDoFTools::make_sparsity_pattern (dof_handler_velocity,dof_handler_pressure,dsp,
constraints_vel,false);and afterwards I callSparsityTools::distribute_sparsity_pattern (dsp, dof_handler_velocity.n_locally_owned_dofs_per_processor(),mpi_communicator,locally_relevant_dofs_vel);When I run the program on more than 2 processors I get the following error during the distribute_sparsity... function:The violated condition was: local_lines.is_element(line_n)Additional information:
The index set given to this constraints object indicates constraints for degree of freedom 16 should not be stored by this object, but a constraint is being added.Do you have an idea how I can fix this?