*/
void initialize(const BlockInfo* block_info,
NamedData<VECTOR*>& residuals);
+ /**
+ * Initialize the constraints.
+ */
+ void initialize(const ConstraintMatrix& constraints);
/**
* Initialize the local data
* in the
* A pointer to the object containing the block structure.
*/
SmartPointer<const BlockInfo> block_info;
+ /**
+ * A pointer to the object containing constraints.
+ */
+ SmartPointer<const ConstraintMatrix, VECTOR> constraints;
};
residuals = m;
}
+ template <class VECTOR>
+ inline void
+ ResidualLocalBlocksToGlobalBlocks<VECTOR>::initialize(
+ const ConstraintMatrix& c)
+ {
+ constraints = &c;
+ }
+
template <class VECTOR>
template <int dim>
const BlockVector<double>& local,
const std::vector<unsigned int>& dof)
{
+ if(constraints == 0)
+ {
for (unsigned int b=0;b<local.n_blocks();++b)
for (unsigned int j=0;j<local.block(b).size();++j)
{
const unsigned int jcell = this->block_info->local().local_to_global(b, j);
global(dof[jcell]) += local.block(b)(j);
}
+ }
+ else
+ constraints->distribute_local_to_global(local, dof, global);
}