for (const unsigned int vertex_no : GeometryInfo<2>::vertex_indices())
{
for (unsigned int i = 0; i < 2; ++i)
- m[i].add_line(cell->vertex_dof_index(vertex_no, 0));
+ if (m[i].is_constrained(cell->vertex_dof_index(vertex_no, 0)) ==
+ false)
+ m[i].constrain_dof_to_zero(cell->vertex_dof_index(vertex_no, 0));
}
if (cell->at_boundary())
if (std::fabs(face->vertex(1).norm() - r_i) < eps)
for (unsigned int i = 0; i < 2; ++i)
{
- m[i].add_line(face->dof_index(0));
+ m[i].constrain_dof_to_zero(face->dof_index(0));
m[i].set_inhomogeneity(face->dof_index(0),
(face->center() *
(r_i / face->center().norm() -
}
else if (std::fabs(face->vertex(1).norm() - r_a) < eps)
for (unsigned int i = 0; i < 2; ++i)
- m[i].add_line(face->dof_index(0));
+ m[i].constrain_dof_to_zero(face->dof_index(0));
else
Assert(false, ExcInternalError());
}
// if
// (fe_collection[1].face_system_to_component_index(i).first
// /*component*/ > 0)
- constraints.add_line(local_face_dof_indices[i]);
+ if (constraints.is_constrained(
+ local_face_dof_indices[i]) == false)
+ constraints.constrain_dof_to_zero(
+ local_face_dof_indices[i]);
}
}
}
if (std::sqrt(p.square()) < 1e-6)
{
- this->constraintsInhom.add_line(dof_index);
+ this->constraintsInhom.constrain_dof_to_zero(dof_index);
this->constraintsInhom.set_inhomogeneity(dof_index, 2);
}
}
local_active.add_range(myid * numproc, (myid + 1) * numproc);
AffineConstraints<double> cm;
- cm.add_line(1);
- cm.add_line(2);
+ cm.constrain_dof_to_zero(1);
+ cm.constrain_dof_to_zero(2);
cm.close();
deallog << "CM:" << std::endl;
// set up constraint
AffineConstraints<double> constraints;
- constraints.add_line(0);
+ constraints.constrain_dof_to_zero(0);
constraints.close();
// global matrix and vector
for (unsigned int i = 0; i < sizeof(inhoms) / sizeof(inhoms[0]); ++i)
{
deallog << inhoms[i] << std::endl;
- cm.add_line(inhoms[i]);
+ cm.constrain_dof_to_zero(inhoms[i]);
cm.set_inhomogeneity(inhoms[i], 1.0);
}
{
if (!correct_constraints.is_constrained(boundary_value->first))
{
- correct_constraints.add_line(boundary_value->first);
+ correct_constraints.constrain_dof_to_zero(boundary_value->first);
correct_constraints.set_inhomogeneity(boundary_value->first,
boundary_value->second);
}
{
cell->face(face)->get_dof_indices(dof_indices);
for (const auto i : dof_indices)
- constraints.add_line(i);
+ if (constraints.is_constrained(i) == false)
+ constraints.constrain_dof_to_zero(i);
}
const auto a = collect_lines(constraints, dof_handler.n_dofs());
AffineConstraints<double> c1(local_lines), c2(local_lines);
for (types::global_dof_index i = 99999800; i < local_lines.size(); ++i)
if (i % 2 == 1)
- c1.add_line(i);
+ c1.constrain_dof_to_zero(i);
- c2.add_line(99999800);
- c2.add_line(99999801);
- c2.add_line(99999802);
+ c2.constrain_dof_to_zero(99999800);
+ c2.constrain_dof_to_zero(99999801);
+ c2.constrain_dof_to_zero(99999802);
// now merge the two and print the results
c2.merge(c1, AffineConstraints<double>::right_object_wins);
double vals[] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
for (unsigned int i = 0; i < sizeof(IDs) / sizeof(IDs[0]); ++i)
{
- constraints.add_line(IDs[i]);
+ constraints.constrain_dof_to_zero(IDs[i]);
constraints.set_inhomogeneity(IDs[i], vals[i]);
}
AffineConstraints<double> cm;
for (unsigned int i = 0; i < 5; ++i)
- cm.add_line(i);
+ cm.constrain_dof_to_zero(i);
cm.close();
// completely fill a 5x5 matrix
{
if (!test_all_constraints.is_constrained(boundary_value->first))
{
- test_all_constraints.add_line(boundary_value->first);
+ test_all_constraints.constrain_dof_to_zero(boundary_value->first);
test_all_constraints.set_inhomogeneity(boundary_value->first,
boundary_value->second);
}
{
AffineConstraints<double> cm;
- cm.add_line(1);
+ cm.constrain_dof_to_zero(1);
cm.set_inhomogeneity(1, -5.0);
- cm.add_line(3);
+ cm.constrain_dof_to_zero(3);
cm.set_inhomogeneity(3, 2.0);
- cm.add_line(4);
+ cm.constrain_dof_to_zero(4);
cm.set_inhomogeneity(4, 0.0);
cm.close();
boundary_values.begin();
for (; boundary_value != boundary_values.end(); ++boundary_value)
{
- test_all_constraints.add_line(boundary_value->first);
+ test_all_constraints.constrain_dof_to_zero(boundary_value->first);
test_all_constraints.set_inhomogeneity(boundary_value->first,
boundary_value->second);
}
boundary_values.begin();
for (; boundary_value != boundary_values.end(); ++boundary_value)
{
- test_all_constraints.add_line(boundary_value->first);
+ test_all_constraints.constrain_dof_to_zero(boundary_value->first);
test_all_constraints.set_inhomogeneity(boundary_value->first,
boundary_value->second);
}
std::set<types::global_dof_index>::iterator bc_it =
boundary_indices[level].begin();
for (; bc_it != boundary_indices[level].end(); ++bc_it)
- mg_constraints[level].add_line(*bc_it);
+ mg_constraints[level].constrain_dof_to_zero(*bc_it);
mg_constraints[level].close();
typename MatrixFree<dim>::AdditionalData data;
data.mg_level = level;
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
std::set<types::global_dof_index>::iterator bc_it =
boundary_indices[level].begin();
for (; bc_it != boundary_indices[level].end(); ++bc_it)
- mg_constraints[level].add_line(*bc_it);
+ mg_constraints[level].constrain_dof_to_zero(*bc_it);
mg_constraints[level].close();
mg_matrices[level].reinit(dof_handler, mg_constraints[level], level);
local_active_together.add_range(numproc + myid * 2, numproc + myid * 2 + 2);
AffineConstraints<PetscScalar> cm(local_active_together);
- cm.add_line(numproc + myid * 2);
+ cm.constrain_dof_to_zero(numproc + myid * 2);
cm.close();
deallog << "vector before:" << std::endl;
local_active_together.add_range(numproc + myid * 2, numproc + myid * 2 + 2);
AffineConstraints<double> cm(local_active_together);
- cm.add_line(numproc + myid * 2);
+ cm.constrain_dof_to_zero(numproc + myid * 2);
cm.close();
deallog << "vector before:" << std::endl;
// local_active_together.compress();
AffineConstraints<double> cm(local_active_together);
- cm.add_line(1);
+ cm.constrain_dof_to_zero(1);
cm.close();
deallog << "OK" << std::endl;
}
AffineConstraints<double> cm(owned, relevant);
- cm.add_line(0);
+ cm.constrain_dof_to_zero(0);
cm.close();
AffineConstraints<double> cm2;
AffineConstraints<double> cm(owned, relevant);
- cm.add_line(0);
+ cm.constrain_dof_to_zero(0);
cm.close();
AffineConstraints<double> cm2(cm);
905: An error occurred in line <1898> of file
</scratch/deal-trunk/deal.II/include/deal.II/lac/affine_constraints.h> in
function 905: void
-dealii::AffineConstraints<double>::add_line(dealii::AffineConstraints<double>::size_type)
+dealii::AffineConstraints<double>::constrain_dof_to_zero(dealii::AffineConstraints<double>::size_type)
905: The violated condition was: 905: line != numbers::invalid_size_type
905: The name and call sequence of the exception was: 905: ExcInternalError()
905: Additional Information: 905: (none) 905:
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
face->get_mg_dof_indices(level, local_dofs);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- constraints.add_line(local_dofs[i]);
+ if (constraints.is_constrained(local_dofs[i]) == false)
+ constraints.constrain_dof_to_zero(local_dofs[i]);
}
}
}
{
if (level_constraints.can_store_line(face_dofs[i]))
{
- level_constraints.add_line(face_dofs[i]);
+ level_constraints.constrain_dof_to_zero(face_dofs[i]);
level_constraints.set_inhomogeneity(face_dofs[i], 5.0);
}
}
{
if (user_constraints.can_store_line(face_dofs[i]))
{
- user_constraints.add_line(face_dofs[i]);
+ user_constraints.constrain_dof_to_zero(face_dofs[i]);
user_constraints.set_inhomogeneity(face_dofs[i], 5.0);
}
}
{
if (user_constraints.can_store_line(face_dofs[i]))
{
- user_constraints.add_line(face_dofs[i]);
+ user_constraints.constrain_dof_to_zero(face_dofs[i]);
user_constraints.set_inhomogeneity(face_dofs[i], 5.0);
}
}
if (global_ids[i] == numbers::invalid_size_type)
continue;
- constraints.add_line(global_ids[i]);
- constraints.set_inhomogeneity(global_ids[i],
- evaluation_point_results[i]);
+ constraints.add_constraint(global_ids[i],
+ {},
+ evaluation_point_results[i]);
}
}
constraints.close();