/usr/include/deal.II/multigrid/mg_transfer_block.templates.h is in libdeal.ii-dev 6.3.1-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | //---------------------------------------------------------------------------
// mg_transfer.templates.h,v 1.22 2006/01/29 15:03:55 guido Exp
// Version:
//
// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// to the file deal.II/doc/license.html for the text and
// further information on this license.
//
//---------------------------------------------------------------------------
#ifndef __deal2__mg_transfer_block_templates_h
#define __deal2__mg_transfer_block_templates_h
#include <lac/sparse_matrix.h>
#include <lac/constraint_matrix.h>
#include <grid/tria_iterator.h>
#include <fe/fe.h>
#include <multigrid/mg_base.h>
#include <multigrid/mg_dof_accessor.h>
#include <multigrid/mg_tools.h>
#include <multigrid/mg_transfer_block.h>
#include <algorithm>
DEAL_II_NAMESPACE_OPEN
/* --------------------- MGTransferBlockSelect -------------- */
// Simplify some things below
typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
template <typename number>
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_from_mg (
const MGDoFHandler<dim,spacedim>& mg_dof_handler,
BlockVector<number2>& dst,
const MGLevelObject<Vector<number> >& src) const
{
for (unsigned int level=0;level<mg_dof_handler.get_tria().n_levels();++level)
for (IT i= copy_indices[selected_block][level].begin();
i != copy_indices[selected_block][level].end();++i)
dst.block(selected_block)(i->first) = src[level](i->second);
}
template <typename number>
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_from_mg (
const MGDoFHandler<dim,spacedim>& mg_dof_handler,
Vector<number2>& dst,
const MGLevelObject<Vector<number> >& src) const
{
for (unsigned int level=0;level<mg_dof_handler.get_tria().n_levels();++level)
for (IT i= copy_indices[selected_block][level].begin();
i != copy_indices[selected_block][level].end();++i)
dst(i->first) = src[level](i->second);
}
template <typename number>
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_from_mg_add (
const MGDoFHandler<dim,spacedim>& mg_dof_handler,
BlockVector<number2>& dst,
const MGLevelObject<Vector<number> >& src) const
{
for (unsigned int level=0;level<mg_dof_handler.get_tria().n_levels();++level)
for (IT i= copy_indices[selected_block][level].begin();
i != copy_indices[selected_block][level].end();++i)
dst.block(selected_block)(i->first) += src[level](i->second);
}
template <typename number>
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_from_mg_add (
const MGDoFHandler<dim,spacedim>& mg_dof_handler,
Vector<number2>& dst,
const MGLevelObject<Vector<number> >& src) const
{
for (unsigned int level=0;level<mg_dof_handler.get_tria().n_levels();++level)
for (IT i= copy_indices[selected_block][level].begin();
i != copy_indices[selected_block][level].end();++i)
dst(i->first) += src[level](i->second);
}
template <typename number>
unsigned int
MGTransferBlockSelect<number>::memory_consumption () const
{
return sizeof(int) + MGTransferBlockBase::memory_consumption();
}
/* --------------------- MGTransferBlock -------------- */
template <typename number>
template <int dim, typename number2, int spacedim>
void
MGTransferBlock<number>::copy_from_mg (
const MGDoFHandler<dim,spacedim>& mg_dof_handler,
BlockVector<number2>& dst,
const MGLevelObject<BlockVector<number> >& src) const
{
for (unsigned int block=0;block<selected.size();++block)
if (selected[block])
for (unsigned int level=0;level<mg_dof_handler.get_tria().n_levels();++level)
for (IT i= copy_indices[block][level].begin();
i != copy_indices[block][level].end();++i)
dst.block(block)(i->first) = src[level].block(mg_block[block])(i->second);
}
template <typename number>
template <int dim, typename number2, int spacedim>
void
MGTransferBlock<number>::copy_from_mg_add (
const MGDoFHandler<dim,spacedim>& mg_dof_handler,
BlockVector<number2>& dst,
const MGLevelObject<BlockVector<number> >& src) const
{
for (unsigned int block=0;block<selected.size();++block)
if (selected[block])
for (unsigned int level=0;level<mg_dof_handler.get_tria().n_levels();++level)
for (IT i= copy_indices[block][level].begin();
i != copy_indices[block][level].end();++i)
dst.block(block)(i->first) += src[level].block(mg_block[block])(i->second);
}
DEAL_II_NAMESPACE_CLOSE
#endif
|