<ol>
<li> %Functions which return the number of something (number of cells,
degrees of freedom, etc) should start with <code>n_*</code>. Example:
- SparsityPattern::n_nonzero_entries().</li>
+ SparsityPatternBase::n_nonzero_elements().</li>
<li> %Functions which set a bit or flag should start with <code>set_*</code>;
functions which clear bits or flags should be named <code>clear_*</code>.
- Example: CellIterator::set_refine_flag().</li>
+ Example: CellAccessor::set_refine_flag().</li>
<li> Traditional logical operators should be used instead of their English
equivalents (i.e., use <code>&&</code>, <code>||</code>, and <code>!</code>
expand_instantiations (built from
<code>cmake/scripts/expand_instantiations.cc</code>) and the parameters are
defined dynamically through cmake depending on your configuration (see
-<code>share/deal.II/template-arguments</code> in your build directory).
+<code>cmake/config/template-arguments.in</code> in your build directory).
It is those <code>.inst</code> files that are eventually included from the
corresponding <code>.cc</code> files. </p>
consider a trivial implementation of vector addition:
@code
Vector &
- operator += (Vector &lhs,
- const Vector &rhs)
+ operator+=(Vector &lhs,
+ const Vector &rhs)
{
for (unsigned int i=0; i<lhs.size(); ++i)
lhs(i) += rhs(i);
implementation will do exactly this:
@code
Vector &
- operator += (Vector &lhs,
- const Vector &rhs)
+ operator+=(Vector &lhs,
+ const Vector &rhs)
{
Assert (lhs.size() == rhs.size(),
- ExcDimensionMismatch (lhs.size(), rhs.size());
+ ExcDimensionMismatch(lhs.size(), rhs.size());
for (unsigned int i=0; i<lhs.size(); ++i)
lhs(i) += rhs(i);
return lhs;
a vector would expect the norm to be positive. You can write this as
follows:
@code
- double norm (const Vector &v)
+ double norm(const Vector &v)
{
double s = 0;
for (unsigned int i=0; i<v.size(); ++i)
{ ... }
else
{
- // we have a cell whose neighbor must
- // be at the boundary if we got here
+ // we have a cell whose neighbor must
+ // be at the boundary if we got here
}
}
@endcode
... // something lengthy and complicated
for (const auto &cell = dof_handler.active_cell_iterators())
{
- <b>const</b> Point<dim> cell_center = (cell->vertex(0) +
- cell->vertex(1)) / 2;
+ const Point<dim> cell_center = (cell->vertex(0) +
+ cell->vertex(1)) / 2;
...
}
...
@code
template <int dim>
typename Triangulation<dim>::cell_iterator
- CellAccessor<dim>::child (const unsigned int child_no)
+ CellAccessor<dim>::child(const unsigned int child_no)
{
...
return something;