// Create a solver object of the kind indicated by the argument to this
// function. If the name is not recognized, throw an exception!
- LaplaceSolver::Base<dim> *solver = 0;
+ LaplaceSolver::Base<dim> *solver = nullptr;
if (solver_name == "global")
solver = new LaplaceSolver::RefinementGlobal<dim> (triangulation, fe,
quadrature,
localized_solution,
local_error_per_cell,
ComponentMask(),
- 0,
+ nullptr,
MultithreadInfo::n_threads(),
this_mpi_process);
incremental_displacement,
error_per_cell,
ComponentMask(),
- 0,
+ nullptr,
MultithreadInfo::n_threads(),
this_mpi_process);
temperature_solution,
estimated_error_per_cell,
ComponentMask(),
- 0,
+ nullptr,
0,
triangulation.locally_owned_subdomain());
Assert(index < fe.dofs_per_cell,
ExcIndexRange(0, fe.dofs_per_cell, index));
- static Quadrature<1> *q_pointer = NULL;
+ static Quadrature<1> *q_pointer = nullptr;
if (q_pointer) delete q_pointer;
q_pointer = new QGaussLogR<1>(singular_quadrature_order,
{
AssertIndexRange(i, size());
type *p = boost::any_cast<type>(&data[i]);
- Assert(p != 0,
+ Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(),data[i].type().name()));
return *p;
}
{
AssertIndexRange(i, size());
const type *p = boost::any_cast<type>(&data[i]);
- if (p==0 )
+ if (p==nullptr )
p = boost::any_cast<const type>(&data[i]);
- Assert(p != 0,
+ Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(),data[i].type().name()));
return *p;
}
{
AssertIndexRange(i, size());
const type *p = boost::any_cast<type>(&data[i]);
- if (p==0)
+ if (p==nullptr)
p = boost::any_cast<const type>(&data[i]);
- Assert(p != 0,
+ Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(),data[i].type().name()));
return *p;
}
{
AssertIndexRange(i, size());
const type *const *p = boost::any_cast<type *>(&data[i]);
- if (p==0)
+ if (p==nullptr)
p = boost::any_cast<const type *>(&data[i]);
- Assert(p != 0,
+ Assert(p != nullptr,
ExcTypeMismatch(typeid(type *).name(),data[i].type().name()));
return *p;
}
{
AssertIndexRange(i, size());
const type *const *p = boost::any_cast<type *>(&data[i]);
- if (p==0)
+ if (p==nullptr)
p = boost::any_cast<const type *>(&data[i]);
- if (p==0)
- return 0;
+ if (p==nullptr)
+ return nullptr;
return *p;
}
{
const unsigned int i = find(n);
const type *p = boost::any_cast<type>(&data[i]);
- Assert(p != 0,
+ Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(),data[i].type().name()));
return *p;
}
{
const unsigned int i = find(n);
const type *const *p = boost::any_cast<type *>(&data[i]);
- if (p==0)
+ if (p==nullptr)
p = boost::any_cast<const type *>(&data[i]);
- Assert(p != 0,
+ Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(),data[i].type().name()));
return *p;
}
std::find(names.begin(), names.end(), n);
// Return null pointer if not found
if (it == names.end())
- return 0;
+ return nullptr;
// Compute index and return casted pointer
unsigned int i=it-names.begin();
OutputOperator<VectorType>::OutputOperator()
:
step (numbers::invalid_unsigned_int),
- os(0)
+ os(nullptr)
{}
template <typename VectorType>
OutputOperator<VectorType> &
OutputOperator<VectorType>::operator<< (const AnyData &vectors)
{
- if (os == 0)
+ if (os == nullptr)
{
deallog << "Step " << step << std::endl;
for (unsigned int i=0; i<vectors.size(); ++i)
{
const VectorType *v = vectors.try_read_ptr<VectorType>(i);
- if (v == 0) continue;
+ if (v == nullptr) continue;
deallog << vectors.name(i);
for (unsigned int j=0; j<v->size(); ++j)
deallog << ' ' << (*v)(j);
for (unsigned int i=0; i<vectors.size(); ++i)
{
const VectorType *v = vectors.try_read_ptr<VectorType>(i);
- if (v == 0) continue;
+ if (v == nullptr) continue;
for (unsigned int j=0; j<v->size(); ++j)
(*os) << ' ' << (*v)(j);
}
src2.add<const double *>(&vtheta, "Theta");
src2.merge(in);
- if (output != 0)
+ if (output != nullptr)
(*output) << 0U << out;
for (unsigned int count = 1; d_explicit.time < control.final(); ++count)
(*op_explicit)(out1, src1);
(*op_implicit)(out, src2);
- if (output != 0 && control.print())
+ if (output != nullptr && control.print())
(*output) << count << out;
d_explicit.time = control.now();
inline
AlignedVector<T>::AlignedVector ()
:
- _data (0),
- _end_data (0),
- _end_allocated (0)
+ _data (nullptr),
+ _end_data (nullptr),
+ _end_allocated (nullptr)
{}
AlignedVector<T>::AlignedVector (const size_type size,
const T &init)
:
- _data (0),
- _end_data (0),
- _end_allocated (0)
+ _data (nullptr),
+ _end_data (nullptr),
+ _end_allocated (nullptr)
{
if (size > 0)
resize (size, init);
inline
AlignedVector<T>::AlignedVector (const AlignedVector<T> &vec)
:
- _data (0),
- _end_data (0),
- _end_allocated (0)
+ _data (nullptr),
+ _end_data (nullptr),
+ _end_allocated (nullptr)
{
// copy the data from vec
reserve (vec._end_data - vec._data);
free(new_data);
}
else
- Assert(new_data == 0, ExcInternalError());
+ Assert(new_data == nullptr, ExcInternalError());
}
else if (size_alloc == 0)
clear();
void
AlignedVector<T>::clear ()
{
- if (_data != 0)
+ if (_data != nullptr)
{
if (std::is_trivial<T>::value == false)
while (_end_data != _data)
free(_data);
}
- _data = 0;
- _end_data = 0;
- _end_allocated = 0;
+ _data = nullptr;
+ _end_data = nullptr;
+ _end_allocated = nullptr;
}
inline
ArrayView<ElementType>::ArrayView()
:
- starting_element (NULL),
+ starting_element ((nullptr)),
n_elements(0)
{}
/**
* Constructor.
*/
- TecplotFlags (const char *tecplot_binary_file_name = NULL,
- const char *zone_name = NULL,
+ TecplotFlags (const char *tecplot_binary_file_name = nullptr,
+ const char *zone_name = nullptr,
const double solution_time = -1.0);
/**
ZeroFunction<dim, Number> (n_components),
function_value_vector (n_components)
{
- Assert (begin_ptr != 0, ExcMessage ("Null pointer encountered!"));
+ Assert (begin_ptr != nullptr, ExcMessage ("Null pointer encountered!"));
std::copy (begin_ptr, begin_ptr+n_components, function_value_vector.begin());
}
inline
bool IndexSet::IntervalAccessor::is_valid() const
{
- return index_set != NULL && range_idx < index_set->n_intervals();
+ return index_set !=nullptr&& range_idx < index_set->n_intervals();
}
inline
inline
IndexSet::IntervalIterator::IntervalIterator()
- : accessor(NULL)
+ : accessor((nullptr))
{}
inline
// note that in all of this we need not worry about thread-safety
// because we operate on a thread-local object and by definition
// there can only be one access at a time
- if (outstreams.get().get() == 0)
+ if (outstreams.get().get() == nullptr)
{
outstreams.get().reset (new std::ostringstream);
outstreams.get()->setf(std::ios::showpoint | std::ios::left);
inline
std::size_t memory_consumption (const char *string)
{
- if (string == NULL)
+ if (string == (nullptr))
{
return 0;
}
/**
* Creates a new object on the heap using @p new if the given
* @p description is a valid format (for example created by calling
- * description() on an existing object), or NULL otherwise. Ownership of
- * the returned object is transferred to the caller of this function,
+ * description() on an existing object), or nullptr otherwise. Ownership
+ * of the returned object is transferred to the caller of this function,
* which should be freed using @p delete.
*/
static Double *create (const std::string &description);
inline
SmartPointer<T,P>::SmartPointer ()
:
- t (0), id(typeid(P).name())
+ t (nullptr), id(typeid(P).name())
{}
:
t (t), id(typeid(P).name())
{
- if (t != 0)
+ if (t != nullptr)
t->subscribe(id);
}
:
t (t), id(id)
{
- if (t != 0)
+ if (t != nullptr)
t->subscribe(id);
}
:
t (tt.t), id(tt.id)
{
- if (t != 0)
+ if (t != nullptr)
t->subscribe(id);
}
inline
SmartPointer<T,P>::~SmartPointer ()
{
- if (t != 0)
+ if (t != nullptr)
t->unsubscribe(id);
}
if (t == tt)
return *this;
- if (t != 0)
+ if (t != nullptr)
t->unsubscribe(id);
t = tt;
- if (tt != 0)
+ if (tt != nullptr)
tt->subscribe(id);
return *this;
}
if (&tt == this)
return *this;
- if (t != 0)
+ if (t != nullptr)
t->unsubscribe(id);
t = static_cast<T *>(tt);
- if (tt != 0)
+ if (tt != nullptr)
tt->subscribe(id);
return *this;
}
inline
T &SmartPointer<T,P>::operator * () const
{
- Assert(t != 0, ExcNotInitialized());
+ Assert(t != nullptr, ExcNotInitialized());
return *t;
}
inline
T *SmartPointer<T,P>::operator -> () const
{
- Assert(t != 0, ExcNotInitialized());
+ Assert(t != nullptr, ExcNotInitialized());
return t;
}
* Subscribes a user of the object. The subscriber may be identified by text
* supplied as <tt>identifier</tt>.
*/
- void subscribe (const char *identifier = 0) const;
+ void subscribe (const char *identifier = nullptr) const;
/**
* Unsubscribes a user from the object.
* @note The <tt>identifier</tt> must be the <b>same pointer</b> as the one
* supplied to subscribe(), not just the same text.
*/
- void unsubscribe (const char *identifier = 0) const;
+ void unsubscribe (const char *identifier = nullptr) const;
/**
* Return the present number of subscriptions to this object. This allows to
* raises an exception if the <code>count</code> argument is one.
*/
DummyBarrier (const unsigned int count,
- const char *name = 0,
- void *arg = 0);
+ const char *name = nullptr,
+ void *arg = nullptr);
/**
* Wait for all threads to reach this point. Since there may only be one
* Constructor. Initialize the underlying POSIX barrier data structure.
*/
PosixThreadBarrier (const unsigned int count,
- const char *name = 0,
- void *arg = 0);
+ const char *name = nullptr,
+ void *arg = nullptr);
/**
* Destructor. Release all resources.
private:
RT *value;
public:
- inline return_value () : value(0) {}
+ inline return_value () : value(nullptr) {}
inline RT &get () const
{
{
internal::handle_unknown_exception ();
}
- return 0;
+ return nullptr;
}
/**
TaskDescriptor<RT>::TaskDescriptor (const std::function<RT ()> &function)
:
function (function),
- task(NULL),
+ task((nullptr)),
task_is_done (false)
{}
// of the arena". rather, let's explicitly destroy the empty
// task object. before that, make sure that the task has been
// shut down, expressed by a zero reference count
- AssertNothrow (task != 0, ExcInternalError());
+ AssertNothrow (task != nullptr, ExcInternalError());
AssertNothrow (task->ref_count()==0, ExcInternalError());
task->destroy (*task);
}
refine_tol(refine_tol),
coarsen_tol(coarsen_tol),
last_same_as_first(false),
- last_stage(NULL)
+ last_stage((nullptr))
{
initialize(method);
}
template <typename VectorType>
void EmbeddedExplicitRungeKutta<VectorType>::free_memory()
{
- if (last_stage!=NULL)
+ if (last_stage!=(nullptr))
delete last_stage;
- last_stage = NULL;
+ last_stage = (nullptr);
}
// Save the last stage if necessary
if (last_same_as_first==true)
{
- if (last_stage==NULL)
+ if (last_stage==(nullptr))
last_stage = new VectorType(f_stages.back());
else
*last_stage = f_stages.back();
// of the first stage.
if (last_same_as_first==true)
{
- if (last_stage!=NULL)
+ if (last_stage!=(nullptr))
{
f_stages[0] = *last_stage;
i = 1;
ItemType ()
:
n_items (0),
- scratch_data (0),
- sample_scratch_data (0),
+ scratch_data (nullptr),
+ sample_scratch_data (nullptr),
currently_in_use (false)
{}
};
// another thread where we release items and set 'false'
// flags to 'true', but that too does not produce any
// problems)
- ItemType *current_item = 0;
+ ItemType *current_item = nullptr;
for (unsigned int i=0; i<item_buffer.size(); ++i)
if (item_buffer[i].currently_in_use == false)
{
current_item = &item_buffer[i];
break;
}
- Assert (current_item != 0, ExcMessage ("This can't be. There must be a free item!"));
+ Assert (current_item != nullptr, ExcMessage ("This can't be. There must be a free item!"));
// initialize the next item. it may
// consist of at most chunk_size
if (current_item->n_items == 0)
// there were no items
// left. terminate the pipeline
- return 0;
+ return nullptr;
else
return current_item;
}
// we can't take an iterator into the list now and expect it to
// still be valid after calling the worker, but we at least do
// not have to lock the following section
- ScratchData *scratch_data = 0;
+ ScratchData *scratch_data = nullptr;
{
typename ItemType::ScratchDataList &
scratch_data_list = current_item->scratch_data->get();
}
// if no object was found, create one and mark it as used
- if (scratch_data == 0)
+ if (scratch_data == nullptr)
{
scratch_data = new ScratchData(*current_item->sample_scratch_data);
// return an invalid item since we are at the end of the
// pipeline
- return 0;
+ return nullptr;
}
// This means that we can't take an iterator into the list
// now and expect it to still be valid after calling the worker,
// but we at least do not have to lock the following section.
- ScratchData *scratch_data = 0;
- CopyData *copy_data = 0;
+ ScratchData *scratch_data = nullptr;
+ CopyData *copy_data = nullptr;
{
ScratchAndCopyDataList &scratch_and_copy_data_list = data.get();
}
// if no element in the list was found, create one and mark it as used
- if (scratch_data == 0)
+ if (scratch_data == nullptr)
{
- Assert (copy_data==0, ExcInternalError());
+ Assert (copy_data==nullptr, ExcInternalError());
scratch_data = new ScratchData(sample_scratch_data);
copy_data = new CopyData(sample_copy_data);
index),
dof_handler(const_cast<DoFHandlerType *>(dof_handler))
{
- Assert (tria == NULL || &dof_handler->get_triangulation() == tria,
+ Assert (tria ==nullptr|| &dof_handler->get_triangulation() == tria,
ExcMessage ("You can't create a DoF accessor in which the DoFHandler object "
"uses a different triangulation than the one you pass as argument."));
}
DoFAccessor<structdim,DoFHandlerType,level_dof_access>::DoFAccessor
(const DoFAccessor<dim2, DoFHandlerType2, level_dof_access2> &other)
: BaseClass(other),
- dof_handler(0)
+ dof_handler(nullptr)
{
Assert (false, ExcMessage("You are trying to assign iterators that are incompatible. "
"Reasons for incompatibility are that they point to different "
void
DoFAccessor<structdim,DoFHandlerType,level_dof_access>::set_dof_handler (DoFHandlerType *dh)
{
- Assert (dh != 0, ExcInvalidObject());
+ Assert (dh != nullptr, ExcInvalidObject());
this->dof_handler = dh;
}
DoFAccessor<structdim,DoFHandlerType,level_dof_access>::copy_from
(const TriaAccessorBase<structdim, DoFHandlerType::dimension, DoFHandlerType::space_dimension> &da)
{
- Assert (this->dof_handler != 0, ExcInvalidObject());
+ Assert (this->dof_handler != nullptr, ExcInvalidObject());
BaseClass::copy_from(da);
}
(void)fe_index;
Assert ((fe_index == dealii::DoFHandler<dim,spacedim>::default_fe_index),
ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
- Assert (dof_handler.selected_fe != 0,
+ Assert (dof_handler.selected_fe != nullptr,
ExcMessage ("No finite element collection is associated with "
"this DoFHandler"));
Assert (local_index < dof_handler.selected_fe->dofs_per_vertex,
Assert ( (fe_index != dealii::hp::DoFHandler<dim,spacedim>::default_fe_index),
ExcMessage ("You need to specify a FE index when working "
"with hp DoFHandlers"));
- Assert (dof_handler.finite_elements != 0,
+ Assert (dof_handler.finite_elements != nullptr,
ExcMessage ("No finite element collection is associated with "
"this DoFHandler"));
Assert (local_index < (*dof_handler.finite_elements)[fe_index].dofs_per_vertex,
(void)fe_index;
Assert ((fe_index == dealii::DoFHandler<dim,spacedim>::default_fe_index),
ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
- Assert (dof_handler.selected_fe != 0,
+ Assert (dof_handler.selected_fe != nullptr,
ExcMessage ("No finite element collection is associated with "
"this DoFHandler"));
Assert (local_index < dof_handler.selected_fe->dofs_per_vertex,
Assert ( (fe_index != dealii::hp::DoFHandler<dim,spacedim>::default_fe_index),
ExcMessage ("You need to specify a FE index when working "
"with hp DoFHandlers"));
- Assert (dof_handler.finite_elements != 0,
+ Assert (dof_handler.finite_elements != nullptr,
ExcMessage ("No finite element collection is associated with "
"this DoFHandler"));
Assert (local_index < (*dof_handler.finite_elements)[fe_index].dofs_per_vertex,
n_active_vertex_fe_indices (const dealii::hp::DoFHandler<dim,spacedim> &dof_handler,
const unsigned int vertex_index)
{
- Assert (dof_handler.finite_elements != 0,
+ Assert (dof_handler.finite_elements != nullptr,
ExcMessage ("No finite element collection is associated with "
"this DoFHandler"));
const unsigned int vertex_index,
const unsigned int n)
{
- Assert (dof_handler.finite_elements != 0,
+ Assert (dof_handler.finite_elements != nullptr,
ExcMessage ("No finite element collection is associated with "
"this DoFHandler"));
Assert (n < n_active_vertex_fe_indices(dof_handler, vertex_index),
const unsigned int fe_index) const
{
(void)fe_index;
- Assert (this->dof_handler != 0, ExcInvalidObject ());
+ Assert (this->dof_handler != nullptr, ExcInvalidObject ());
Assert (vertex < GeometryInfo<structdim>::vertices_per_cell, ExcIndexRange (vertex, 0, GeometryInfo<structdim>::vertices_per_cell));
Assert (i < this->dof_handler->get_fe ()[fe_index].dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe ()[fe_index].dofs_per_vertex));
return this->dof_handler->mg_vertex_dofs[this->vertex_index (vertex)].get_index (level, i);
const unsigned int fe_index) const
{
(void)fe_index;
- Assert (this->dof_handler != 0, ExcInvalidObject ());
+ Assert (this->dof_handler != nullptr, ExcInvalidObject ());
Assert (vertex < GeometryInfo<structdim>::vertices_per_cell, ExcIndexRange (vertex, 0, GeometryInfo<structdim>::vertices_per_cell));
Assert (i < this->dof_handler->get_fe ()[fe_index].dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe ()[fe_index].dofs_per_vertex));
this->dof_handler->mg_vertex_dofs[this->vertex_index (vertex)].set_index (level, i, index);
(std::vector<types::global_dof_index> &dof_indices,
const unsigned int fe_index) const
{
- Assert (this->dof_handler != 0, ExcNotInitialized());
+ Assert (this->dof_handler != nullptr, ExcNotInitialized());
Assert (static_cast<unsigned int>(this->level()) < this->dof_handler->levels.size(),
ExcMessage ("DoFHandler not initialized"));
std::vector<types::global_dof_index> &dof_indices,
const unsigned int fe_index) const
{
- Assert (this->dof_handler != 0, ExcInvalidObject ());
+ Assert (this->dof_handler != nullptr, ExcInvalidObject ());
switch (structdim)
{
const std::vector<types::global_dof_index> &dof_indices,
const unsigned int fe_index)
{
- Assert (this->dof_handler != 0, ExcInvalidObject ());
+ Assert (this->dof_handler != nullptr, ExcInvalidObject ());
switch (structdim)
{
const int ,
const DoFHandlerType<1,spacedim> *)
:
- dof_handler(0)
+ dof_handler(nullptr)
{
Assert (false,
ExcMessage ("This constructor can not be called for face iterators in 1d."));
DoFAccessor<0,DoFHandlerType<1,spacedim>, level_dof_access>::set_dof_handler
(DoFHandlerType<1,spacedim> *dh)
{
- Assert (dh != 0, ExcInvalidObject());
+ Assert (dh != nullptr, ExcInvalidObject());
this->dof_handler = dh;
}
{
(void) dof_indices;
(void) fe_index;
- Assert (this->dof_handler != 0, ExcInvalidObject ());
+ Assert (this->dof_handler != nullptr, ExcInvalidObject ());
Assert (dof_indices.size () ==
this->dof_handler->get_fe ()[fe_index].dofs_per_vertex,
ExcVectorDoesNotMatch ());
DoFAccessor<0,DoFHandlerType<1,spacedim>, level_dof_access>::
get_fe (const unsigned int fe_index) const
{
- Assert (this->dof_handler != 0, ExcInvalidObject());
+ Assert (this->dof_handler != nullptr, ExcInvalidObject());
return dof_handler->get_fe()[fe_index];
}
const unsigned int i)
{
typedef dealii::DoFAccessor<dim,DoFHandler<dim,spacedim>, level_dof_access> BaseClass;
- Assert (accessor.dof_handler != 0,
+ Assert (accessor.dof_handler != nullptr,
typename BaseClass::ExcInvalidObject());
Assert (static_cast<unsigned int>(accessor.level()) <
accessor.dof_handler->levels.size(),
OutputVector &global_destination)
{
typedef dealii::DoFAccessor<dim,DoFHandler<dim,spacedim>, level_dof_access> BaseClass;
- Assert (accessor.dof_handler != 0,
+ Assert (accessor.dof_handler != nullptr,
typename BaseClass::ExcInvalidObject());
Assert (static_cast<unsigned int>(local_source_end-local_source_begin)
==
OutputMatrix &global_destination)
{
typedef dealii::DoFAccessor<dim,DoFHandler<dim,spacedim>, level_dof_access> BaseClass;
- Assert (accessor.dof_handler != 0,
+ Assert (accessor.dof_handler != nullptr,
typename BaseClass::ExcInvalidObject());
Assert (local_source.m() == accessor.get_fe().dofs_per_cell,
typename BaseClass::ExcMatrixDoesNotMatch());
DoFCellAccessor<DoFHandlerType,level_dof_access>::get_fe () const
{
Assert ((dynamic_cast<const dealii::DoFHandler<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
- (this->dof_handler) != 0)
+ (this->dof_handler) != nullptr)
||
(this->has_children() == false),
ExcMessage ("In hp::DoFHandler objects, finite elements are only associated "
DoFCellAccessor<DoFHandlerType,level_dof_access>::active_fe_index () const
{
Assert ((dynamic_cast<const dealii::DoFHandler<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
- (this->dof_handler) != 0)
+ (this->dof_handler) != nullptr)
||
(this->has_children() == false),
ExcMessage ("You can not ask for the active_fe_index on a cell that has "
DoFCellAccessor<DoFHandlerType,level_dof_access>::set_active_fe_index (const unsigned int i)
{
Assert ((dynamic_cast<const dealii::DoFHandler<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
- (this->dof_handler) != 0)
+ (this->dof_handler) != nullptr)
||
(this->has_children() == false),
ExcMessage ("You can not set the active_fe_index on a cell that has "
const FiniteElement<dim,spacedim> &
DoFHandler<dim,spacedim>::get_fe () const
{
- Assert(selected_fe!=0, ExcMessage("You are trying to access the DoFHandler's FiniteElement object before it has been initialized."));
+ Assert(selected_fe!=nullptr, ExcMessage("You are trying to access the DoFHandler's FiniteElement object before it has been initialized."));
return *selected_fe;
}
const Triangulation<dim,spacedim> &
DoFHandler<dim,spacedim>::get_tria () const
{
- Assert(tria != 0, ExcNotInitialized());
+ Assert(tria != nullptr, ExcNotInitialized());
return *tria;
}
const Triangulation<dim,spacedim> &
DoFHandler<dim,spacedim>::get_triangulation () const
{
- Assert(tria != 0, ExcNotInitialized());
+ Assert(tria != nullptr, ExcNotInitialized());
return *tria;
}
delete levels[i];
levels.resize (0);
delete faces;
- faces = 0;
+ faces = nullptr;
ar &levels;
ar &faces;
* @code
* FE_Enriched<dim> fe_non_enriched(FE_Q<dim>(1),
* FE_Nothing<dim>(1,true),
- * NULL);
+ * (nullptr));
* @endcode
* and will result in the correct constraints for enriched DoFs attributed to
* support points on the interface between the two regions.
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
const UpdateFlags flags(fe_data.update_each);
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
// offset determines which data set
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
// offset determines which data set
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
if (fe_data.update_each & update_values)
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
const unsigned int foffset = fe_data.shape_values.size() * face_no;
FiniteElementData<dim>
multiply_dof_numbers (const FiniteElement<dim,spacedim> *fe1,
const unsigned int N1,
- const FiniteElement<dim,spacedim> *fe2=NULL,
+ const FiniteElement<dim,spacedim> *fe2=nullptr,
const unsigned int N2=0,
- const FiniteElement<dim,spacedim> *fe3=NULL,
+ const FiniteElement<dim,spacedim> *fe3=nullptr,
const unsigned int N3=0,
- const FiniteElement<dim,spacedim> *fe4=NULL,
+ const FiniteElement<dim,spacedim> *fe4=nullptr,
const unsigned int N4=0,
- const FiniteElement<dim,spacedim> *fe5=NULL,
+ const FiniteElement<dim,spacedim> *fe5=nullptr,
const unsigned int N5=0);
/**
std::vector<bool>
compute_restriction_is_additive_flags (const FiniteElement<dim,spacedim> *fe1,
const unsigned int N1,
- const FiniteElement<dim,spacedim> *fe2=NULL,
+ const FiniteElement<dim,spacedim> *fe2=nullptr,
const unsigned int N2=0,
- const FiniteElement<dim,spacedim> *fe3=NULL,
+ const FiniteElement<dim,spacedim> *fe3=nullptr,
const unsigned int N3=0,
- const FiniteElement<dim,spacedim> *fe4=NULL,
+ const FiniteElement<dim,spacedim> *fe4=nullptr,
const unsigned int N4=0,
- const FiniteElement<dim,spacedim> *fe5=NULL,
+ const FiniteElement<dim,spacedim> *fe5=nullptr,
const unsigned int N5=0);
/**
std::vector<ComponentMask>
compute_nonzero_components (const FiniteElement<dim,spacedim> *fe1,
const unsigned int N1,
- const FiniteElement<dim,spacedim> *fe2=NULL,
+ const FiniteElement<dim,spacedim> *fe2=nullptr,
const unsigned int N2=0,
- const FiniteElement<dim,spacedim> *fe3=NULL,
+ const FiniteElement<dim,spacedim> *fe3=nullptr,
const unsigned int N3=0,
- const FiniteElement<dim,spacedim> *fe4=NULL,
+ const FiniteElement<dim,spacedim> *fe4=nullptr,
const unsigned int N4=0,
- const FiniteElement<dim,spacedim> *fe5=NULL,
+ const FiniteElement<dim,spacedim> *fe5=nullptr,
const unsigned int N5=0,
const bool do_tensor_product = true);
~FilteredIterator ()
{
delete predicate;
- predicate = 0;
+ predicate = nullptr;
}
template <int dim, int spacedim>
void write_gnuplot (const Triangulation<dim,spacedim> &tria,
std::ostream &out,
- const Mapping<dim,spacedim> *mapping=0) const;
+ const Mapping<dim,spacedim> *mapping=nullptr) const;
/**
* Write the triangulation in the msh format.
template <int dim, int spacedim>
void write_eps (const Triangulation<dim, spacedim> &tria,
std::ostream &out,
- const Mapping<dim, spacedim> *mapping=0) const;
+ const Mapping<dim, spacedim> *mapping=nullptr) const;
/**
* Write two-dimensional XFig-file.
template <int dim, int spacedim>
void write_xfig (const Triangulation<dim, spacedim> &tria,
std::ostream &out,
- const Mapping<dim, spacedim> *mapping=0) const;
+ const Mapping<dim, spacedim> *mapping=nullptr) const;
/**
* Write the triangulation in the SVG format.
void write (const Triangulation<dim,spacedim> &tria,
std::ostream &out,
const OutputFormat output_format,
- const Mapping<dim,spacedim> *mapping=0) const;
+ const Mapping<dim,spacedim> *mapping=nullptr) const;
/**
* Write mesh in default format set by ParameterHandler.
template <int dim, int spacedim>
void write (const Triangulation<dim,spacedim> &tria,
std::ostream &out,
- const Mapping<dim,spacedim> *mapping=0) const;
+ const Mapping<dim,spacedim> *mapping=nullptr) const;
/**
* Set flags for DX output
template <int dim>
void laplace_transform (const std::map<unsigned int,Point<dim> > &new_points,
Triangulation<dim> &tria,
- const Function<dim,double> *coefficient = 0,
+ const Function<dim,double> *coefficient = nullptr,
const bool solve_for_absolute_positions = false);
/**
* classes. Again, see
* @ref GlossUserData "the glossary for more information".
*
- * The value of these user indices or pointers is @p NULL by default. Note
+ * The value of these user indices or pointers is @pnullptrby default. Note
* that the pointers are not inherited to children upon refinement. Still,
* after a remeshing they are available on all cells, where they were set on
* the previous mesh.
/**
* Constructor. Protected, thus only callable from friend classes.
*/
- TriaAccessorBase (const Triangulation<dim,spacedim> *parent = 0,
+ TriaAccessorBase (const Triangulation<dim,spacedim> *parent = nullptr,
const int level = -1,
const int index = -1,
- const AccessorData * = 0);
+ const AccessorData * = nullptr);
/**
* Copy constructor. Creates an object with exactly the same data.
/**
* Constructor.
*/
- TriaAccessor (const Triangulation<dim,spacedim> *parent = 0,
+ TriaAccessor (const Triangulation<dim,spacedim> *parent = nullptr,
const int level = -1,
const int index = -1,
- const AccessorData *local_data = 0);
+ const AccessorData *local_data = nullptr);
/**
* Conversion constructor. This constructor exists to make certain
void set_user_pointer (void *p) const;
/**
- * Reset the user pointer to a @p NULL pointer. See
+ * Reset the user pointer to a @pnullptrpointer. See
* @ref GlossUserData
* for more information.
*/
* compatibility with the other accessor classes. @p index can be used to
* set the global index of the vertex we point to.
*/
- TriaAccessor (const Triangulation<dim,spacedim> *tria = NULL,
+ TriaAccessor (const Triangulation<dim,spacedim> *tria = nullptr,
const int level = 0,
const int index = 0,
- const AccessorData * = 0);
+ const AccessorData * = nullptr);
/**
* Constructor. Should never be called and thus produces an error.
* compatibility with the other accessor classes. However, it doesn't do
* anything useful here and so may not actually be called.
*/
- TriaAccessor (const Triangulation<1,spacedim> *tria = 0,
+ TriaAccessor (const Triangulation<1,spacedim> *tria = nullptr,
const int = 0,
const int = 0,
- const AccessorData * = 0);
+ const AccessorData * = nullptr);
/**
* Constructor. Should never be called and thus produces an error.
/**
* Constructor.
*/
- CellAccessor (const Triangulation<dim,spacedim> *parent = 0,
+ CellAccessor (const Triangulation<dim,spacedim> *parent = nullptr,
const int level = -1,
const int index = -1,
- const AccessorData *local_data = 0);
+ const AccessorData *local_data = nullptr);
/**
* Copy constructor.
bool
TriaAccessorBase<structdim,dim,spacedim>::operator == (const TriaAccessorBase<structdim,dim,spacedim> &a) const
{
- Assert (tria == a.tria || tria == 0 || a.tria == 0,
+ Assert (tria == a.tria || tria == nullptr || a.tria == nullptr,
TriaAccessorExceptions::ExcCantCompareIterators());
return ((present_level == a.present_level) &&
(present_index == a.present_index));
bool
TriaAccessorBase<structdim,dim,spacedim>::operator != (const TriaAccessorBase<structdim,dim,spacedim> &a) const
{
- Assert (tria == a.tria || tria == 0 || a.tria == 0,
+ Assert (tria == a.tria || tria == nullptr || a.tria == nullptr,
TriaAccessorExceptions::ExcCantCompareIterators());
return ((present_level != a.present_level) ||
(present_index != a.present_index));
const dealii::internal::int2type<1>)
{
Assert (false, ExcInternalError());
- return 0;
+ return nullptr;
}
inline
const dealii::internal::int2type<2>)
{
Assert (false, ExcInternalError());
- return 0;
+ return nullptr;
}
inline
const dealii::internal::int2type<3>)
{
Assert (false, ExcInternalError());
- return 0;
+ return nullptr;
}
/**
const dealii::internal::int2type<3>)
{
Assert (false, ExcInternalError());
- return 0;
+ return nullptr;
}
/**
const dealii::internal::int2type<structdim>)
{
Assert (false, ExcInternalError());
- return 0;
+ return nullptr;
}
template <int dim>
void TriaAccessor<structdim,dim,spacedim>::clear_user_pointer () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- this->objects().user_pointer(this->present_index) = 0;
+ this->objects().user_pointer(this->present_index) = nullptr;
}
TriaAccessor<0, dim, spacedim>::
TriaAccessor (const TriaAccessor<structdim2,dim2,spacedim2> &)
:
- tria (NULL),
+ tria ((nullptr)),
global_vertex_index (numbers::invalid_unsigned_int)
{
Assert(false, ExcImpossibleInDim(0));
TriaAccessor<0, dim, spacedim>::
TriaAccessor (const InvalidAccessor<structdim2,dim2,spacedim2> &)
:
- tria (NULL),
+ tria ((nullptr)),
global_vertex_index (numbers::invalid_unsigned_int)
{
Assert(false, ExcImpossibleInDim(0));
TriaAccessor<0, 1, spacedim>::
TriaAccessor (const TriaAccessor<structdim2,dim2,spacedim2> &)
:
- tria (0),
+ tria (nullptr),
vertex_kind (interior_vertex),
global_vertex_index (numbers::invalid_unsigned_int)
{
TriaAccessor<0, 1, spacedim>::
TriaAccessor (const InvalidAccessor<structdim2,dim2,spacedim2> &)
:
- tria (0),
+ tria (nullptr),
vertex_kind (interior_vertex),
global_vertex_index (numbers::invalid_unsigned_int)
{
const parallel::Triangulation<dim,spacedim> *pt
= dynamic_cast<const parallel::Triangulation<dim,spacedim> *>(this->tria);
- if (pt == 0)
+ if (pt == nullptr)
return true;
else
return (this->subdomain_id() == pt->locally_owned_subdomain());
const parallel::Triangulation<dim,spacedim> *pt
= dynamic_cast<const parallel::Triangulation<dim,spacedim> *>(this->tria);
- if (pt == 0)
+ if (pt == nullptr)
return true;
else
return (this->level_subdomain_id() == pt->locally_owned_subdomain());
const parallel::Triangulation<dim,spacedim> *pt
= dynamic_cast<const parallel::Triangulation<dim,spacedim> *>(this->tria);
- if (pt == 0)
+ if (pt == nullptr)
return false;
else
return (this->subdomain_id() != pt->locally_owned_subdomain());
const parallel::Triangulation<dim,spacedim> *pt
= dynamic_cast<const parallel::Triangulation<dim,spacedim> *>(this->tria);
- if (pt == 0)
+ if (pt == nullptr)
return false;
else
return this->subdomain_id() == numbers::artificial_subdomain_id;
TriaRawIterator (const Triangulation<Accessor::dimension,Accessor::space_dimension> *parent,
const int level,
const int index,
- const typename AccessorType::AccessorData *local_data = 0);
+ const typename AccessorType::AccessorData *local_data = nullptr);
/**
* This is a conversion operator (constructor) which takes another iterator
TriaIterator (const Triangulation<Accessor::dimension,Accessor::space_dimension> *parent,
const int level,
const int index,
- const typename Accessor::AccessorData *local_data = 0);
+ const typename Accessor::AccessorData *local_data = nullptr);
/**
* Construct from an accessor of type OtherAccessor that is convertible to
inline
TriaRawIterator<Accessor>::TriaRawIterator ()
:
- accessor (0, -2, -2, 0)
+ accessor (nullptr, -2, -2, nullptr)
{}
const TriaAccessorBase<Accessor::structure_dimension,Accessor::dimension,Accessor::space_dimension> &tria_accessor,
const typename Accessor::AccessorData *local_data)
:
- accessor(0, -2, -2, local_data)
+ accessor(nullptr, -2, -2, local_data)
{
accessor.copy_from(tria_accessor);
}
*/
UserData()
{
- p = 0;
+ p = nullptr;
}
/**
{
user_data_type = data_unknown;
for (unsigned int i=0; i<user_data.size(); ++i)
- user_data[i].p = 0;
+ user_data[i].p = nullptr;
}
const hp::FECollection<dim,spacedim> &
DoFHandler<dim,spacedim>::get_fe () const
{
- Assert (finite_elements != 0,
+ Assert (finite_elements != nullptr,
ExcMessage ("No finite element collection is associated with "
"this DoFHandler"));
return *finite_elements;
for (unsigned int c=0; c<n_block_cols(); ++c)
{
MatrixType *p = this->sub_objects[r][c];
- this->sub_objects[r][c] = 0;
+ this->sub_objects[r][c] = nullptr;
delete p;
}
sub_objects.reinit (0,0);
// delete previous content of
// the subobjects array
clear ();
- sparsity_pattern = 0;
+ sparsity_pattern = nullptr;
}
BlockSparseMatrix<number>::clear ()
{
BlockMatrixBase<SparseMatrix<number> >::clear();
- sparsity_pattern = 0;
+ sparsity_pattern = nullptr;
}
*
* This function is deprecated.
*/
- void print (const char *format = 0) const DEAL_II_DEPRECATED;
+ void print (const char *format = nullptr) const DEAL_II_DEPRECATED;
/**
* Print to a stream.
* derived from BlockVectorBase<T>).
*/
static const bool value = (sizeof(check_for_block_vector
- ((VectorType *)0))
+ ((VectorType *)nullptr))
==
sizeof(yes_type));
};
typename ChunkSparseMatrix<number>::size_type
ChunkSparseMatrix<number>::m () const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
return cols->rows;
}
typename ChunkSparseMatrix<number>::size_type
ChunkSparseMatrix<number>::n () const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
return cols->cols;
}
const ChunkSparsityPattern &
ChunkSparseMatrix<number>::get_sparsity_pattern () const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
return *cols;
}
AssertIsFinite(value);
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
// it is allowed to set elements of the matrix that are not part of the
// sparsity pattern, if the value to which we set it is zero
const size_type index = compute_location(i,j);
AssertIsFinite(value);
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
if (value != 0.)
{
ChunkSparseMatrix<number> &
ChunkSparseMatrix<number>::operator *= (const number factor)
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
const size_type chunk_size = cols->get_chunk_size();
ChunkSparseMatrix<number> &
ChunkSparseMatrix<number>::operator /= (const number factor)
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (factor !=0, ExcDivideByZero());
const number factor_inv = 1. / factor;
number ChunkSparseMatrix<number>::operator () (const size_type i,
const size_type j) const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
AssertThrow (compute_location(i,j) != SparsityPattern::invalid_entry,
ExcInvalidIndex(i,j));
return val[compute_location(i,j)];
number ChunkSparseMatrix<number>::el (const size_type i,
const size_type j) const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
const size_type index = compute_location(i,j);
if (index != ChunkSparsityPattern::invalid_entry)
inline
number ChunkSparseMatrix<number>::diag_element (const size_type i) const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcNotQuadratic());
AssertIndexRange(i, m());
template <typename number>
ChunkSparseMatrix<number>::ChunkSparseMatrix ()
:
- cols(0, "ChunkSparseMatrix"),
- val(0),
+ cols(nullptr, "ChunkSparseMatrix"),
+ val(nullptr),
max_len(0)
{}
ChunkSparseMatrix<number>::ChunkSparseMatrix (const ChunkSparseMatrix &m)
:
Subscriptor (m),
- cols(0, "ChunkSparseMatrix"),
- val(0),
+ cols(nullptr, "ChunkSparseMatrix"),
+ val(nullptr),
max_len(0)
{
- Assert (m.cols==0 && m.val==0 && m.max_len==0,
+ Assert (m.cols==nullptr && m.val==nullptr && m.max_len==0,
ExcMessage("This constructor can only be called if the provided argument "
"is an empty matrix. This constructor can not be used to "
"copy-construct a non-empty matrix. Use the "
ChunkSparseMatrix<number>::operator = (const ChunkSparseMatrix<number> &m)
{
(void)m;
- Assert (m.cols==0 && m.val==0 && m.max_len==0,
+ Assert (m.cols==nullptr && m.val==nullptr && m.max_len==0,
ExcMessage("This operator can only be called if the provided right "
"hand side is an empty matrix. This operator can not be "
"used to copy a non-empty matrix. Use the "
template <typename number>
ChunkSparseMatrix<number>::ChunkSparseMatrix (const ChunkSparsityPattern &c)
:
- cols(0, "ChunkSparseMatrix"),
- val(0),
+ cols(nullptr, "ChunkSparseMatrix"),
+ val(nullptr),
max_len(0)
{
reinit (c);
ChunkSparseMatrix<number>::ChunkSparseMatrix (const ChunkSparsityPattern &c,
const IdentityMatrix &id)
:
- cols(0, "ChunkSparseMatrix"),
- val(0),
+ cols(nullptr, "ChunkSparseMatrix"),
+ val(nullptr),
max_len(0)
{
(void)id;
template <typename number>
ChunkSparseMatrix<number>::~ChunkSparseMatrix ()
{
- cols = 0;
+ cols = nullptr;
- if (val != 0)
+ if (val != nullptr)
delete[] val;
}
(void)d;
Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert (cols->sparsity_pattern.compressed || cols->empty(),
ChunkSparsityPattern::ExcNotCompressed());
if (cols->empty())
{
- if (val != 0)
+ if (val != nullptr)
delete[] val;
- val = 0;
+ val = nullptr;
max_len = 0;
return;
}
chunk_size * chunk_size;
if (N > max_len || max_len == 0)
{
- if (val != 0)
+ if (val != nullptr)
delete[] val;
val = new number[N];
max_len = N;
void
ChunkSparseMatrix<number>::clear ()
{
- cols = 0;
+ cols = nullptr;
if (val) delete[] val;
- val = 0;
+ val = nullptr;
max_len = 0;
}
bool
ChunkSparseMatrix<number>::empty () const
{
- if (cols == 0)
+ if (cols == nullptr)
return true;
else
return cols->empty();
typename ChunkSparseMatrix<number>::size_type
ChunkSparseMatrix<number>::n_nonzero_elements () const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
return cols->n_nonzero_elements ();
}
typename ChunkSparseMatrix<number>::size_type
ChunkSparseMatrix<number>::n_actually_nonzero_elements () const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
// count those elements that are nonzero, even if they lie in the padding
// around the matrix. since we have the invariant that padding elements are
void
ChunkSparseMatrix<number>::symmetrize ()
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert (cols->rows == cols->cols, ExcNotQuadratic());
Assert (false, ExcNotImplemented());
ChunkSparseMatrix<number> &
ChunkSparseMatrix<number>::copy_from (const ChunkSparseMatrix<somenumber> &matrix)
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (cols == matrix.cols, ExcDifferentChunkSparsityPatterns());
// copy everything, including padding elements
ChunkSparseMatrix<number>::add (const number factor,
const ChunkSparseMatrix<somenumber> &matrix)
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (cols == matrix.cols, ExcDifferentChunkSparsityPatterns());
// add everything, including padding elements
ChunkSparseMatrix<number>::vmult (OutVector &dst,
const InVector &src) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
ChunkSparseMatrix<number>::Tvmult (OutVector &dst,
const InVector &src) const
{
- Assert (val != 0, ExcNotInitialized());
- Assert (cols != 0, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert(n() == dst.size(), ExcDimensionMismatch(n(),dst.size()));
Assert(m() == src.size(), ExcDimensionMismatch(m(),src.size()));
Assert (!PointerComparison::equal(&src, &dst), ExcSourceEqualsDestination());
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
ChunkSparseMatrix<number>::vmult_add (OutVector &dst,
const InVector &src) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
ChunkSparseMatrix<number>::Tvmult_add (OutVector &dst,
const InVector &src) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
somenumber
ChunkSparseMatrix<number>::matrix_norm_square (const Vector<somenumber> &v) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == v.size(), ExcDimensionMismatch(m(),v.size()));
Assert(n() == v.size(), ExcDimensionMismatch(n(),v.size()));
ChunkSparseMatrix<number>::matrix_scalar_product (const Vector<somenumber> &u,
const Vector<somenumber> &v) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == u.size(), ExcDimensionMismatch(m(),u.size()));
Assert(n() == v.size(), ExcDimensionMismatch(n(),v.size()));
typename ChunkSparseMatrix<number>::real_type
ChunkSparseMatrix<number>::l1_norm () const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
const size_type n_chunk_rows = cols->sparsity_pattern.n_rows();
typename ChunkSparseMatrix<number>::real_type
ChunkSparseMatrix<number>::linfty_norm () const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
// this function works like l1_norm(). it can be made more efficient
// (without allocating a temporary vector) as is done in the SparseMatrix
const Vector<somenumber> &u,
const Vector<somenumber> &b) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
Assert(m() == b.size(), ExcDimensionMismatch(m(),b.size()));
Assert(n() == u.size(), ExcDimensionMismatch(n(),u.size()));
{
(void)dst;
(void)src;
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
Assert (dst.size() == n(), ExcDimensionMismatch (dst.size(), n()));
// CVS archives to see the original version which is much clearer...
(void)dst;
(void)src;
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
Assert (dst.size() == n(), ExcDimensionMismatch (dst.size(), n()));
const Vector<somenumber> &src,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
const Vector<somenumber> &src,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
const number /*om*/) const
{
(void)dst;
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
const number /*om*/) const
{
(void)dst;
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
(void)dst;
(void)permutation;
(void)inverse_permutation;
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
(void)dst;
(void)permutation;
(void)inverse_permutation;
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
{
(void)v;
(void)b;
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
Assert (m() == v.size(), ExcDimensionMismatch(m(),v.size()));
{
(void)v;
(void)b;
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
Assert (m() == v.size(), ExcDimensionMismatch(m(),v.size()));
const number /*om*/) const
{
(void)dst;
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcMessage("This operation is only valid on square matrices."));
Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
{
AssertThrow (out, ExcIO());
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (false, ExcNotImplemented());
{
AssertThrow (out, ExcIO());
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
unsigned int width = width_;
{
AssertThrow (out, ExcIO());
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
const size_type chunk_size = cols->get_chunk_size();
const size_type line_index = calculate_line_index(line);
if (line_index >= lines_cache.size() ||
lines_cache[line_index] == numbers::invalid_size_type)
- return 0;
+ return nullptr;
else
return &lines[lines_cache[line_index]].entries;
}
* derived from BlockMatrixBase<T>).
*/
static const bool value = (sizeof(check_for_block_matrix
- ((MatrixType *)0))
+ ((MatrixType *)nullptr))
==
sizeof(yes_type));
};
// global dof index
const size_type line_index = calculate_line_index (local_dof_indices_col[i]);
const ConstraintLine *position =
- lines_cache.size() <= line_index ? 0 : &lines[lines_cache[line_index]];
+ lines_cache.size() <= line_index ? nullptr : &lines[lines_cache[line_index]];
// Gauss elimination of the matrix columns with the inhomogeneity.
// Go through them one by one and again check whether they are
const Epetra_MpiComm *mpi_comm
= dynamic_cast<const Epetra_MpiComm *>(&vec.trilinos_vector().Comm());
- Assert (mpi_comm != 0, ExcInternalError());
+ Assert (mpi_comm != nullptr, ExcInternalError());
output.reinit (needed_elements, mpi_comm->GetMpiComm());
#else
output.reinit (needed_elements, MPI_COMM_WORLD);
vals.resize (n_actual_dofs);
}
else
- Assert (sparse_matrix != 0, ExcInternalError());
+ Assert (sparse_matrix != nullptr, ExcInternalError());
// now do the actual job. go through all the global rows that we will touch
// and call resolve_matrix_row for each of those.
SparseMatrix<number> *sparse_matrix
= dynamic_cast<SparseMatrix<number> *>(&global_matrix.block(block,
block_col));
- Assert (sparse_matrix != 0, ExcInternalError());
+ Assert (sparse_matrix != nullptr, ExcInternalError());
internals::resolve_matrix_row (global_rows, i, start_block,
end_block, local_matrix, sparse_matrix);
}
inline void
IterativeInverse<VectorType>::vmult (VectorType &dst, const VectorType &src) const
{
- Assert(matrix.get() != 0, ExcNotInitialized());
- Assert(preconditioner.get() != 0, ExcNotInitialized());
+ Assert(matrix.get() != nullptr, ExcNotInitialized());
+ Assert(preconditioner.get() != nullptr, ExcNotInitialized());
dst = 0.;
solver.solve(*matrix, dst, src, *preconditioner);
}
BlockVector<Number>::scale (const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &v = dynamic_cast<const BlockVector<Number> &>(vv);
AssertDimension(this->n_blocks(), v.n_blocks());
const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &v = dynamic_cast<const BlockVector<Number> &>(vv);
AssertDimension(this->n_blocks(), v.n_blocks());
BlockVector<Number>::operator += (const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &v = dynamic_cast<const BlockVector<Number> &>(vv);
AssertDimension(this->n_blocks(), v.n_blocks());
BlockVector<Number>::operator -= (const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &v = dynamic_cast<const BlockVector<Number> &>(vv);
AssertDimension(this->n_blocks(), v.n_blocks());
const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &v = dynamic_cast<const BlockVector<Number> &>(vv);
AssertDimension(this->n_blocks(), v.n_blocks());
const VectorSpaceVector<Number> &ww)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &v = dynamic_cast<const BlockVector<Number> &>(vv);
AssertDimension(this->n_blocks(), v.n_blocks());
- Assert(dynamic_cast<const BlockVector<Number> *>(&ww)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&ww)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &w = dynamic_cast<const BlockVector<Number> &>(ww);
AssertDimension(this->n_blocks(), v.n_blocks());
const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &v = dynamic_cast<const BlockVector<Number> &>(vv);
AssertDimension(this->n_blocks(), v.n_blocks());
Assert (this->n_blocks() > 0, ExcEmptyObject());
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &v = dynamic_cast<const BlockVector<Number> &>(vv);
AssertDimension(this->n_blocks(), v.n_blocks());
const VectorSpaceVector<Number> &ww)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &v = dynamic_cast<const BlockVector<Number> &>(vv);
AssertDimension(this->n_blocks(), v.n_blocks());
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const BlockVector<Number> *>(&ww)!=NULL,
+ Assert(dynamic_cast<const BlockVector<Number> *>(&ww)!=nullptr,
ExcVectorTypeNotCompatible());
const BlockVector<Number> &w = dynamic_cast<const BlockVector<Number> &>(ww);
AssertDimension(this->n_blocks(), w.n_blocks());
{
if (new_alloc_size > allocated_size)
{
- Assert (((allocated_size > 0 && val != 0) ||
- val == 0), ExcInternalError());
- if (val != 0)
+ Assert (((allocated_size > 0 && val != nullptr) ||
+ val == nullptr), ExcInternalError());
+ if (val != nullptr)
free(val);
Utilities::System::posix_memalign ((void **)&val, 64, sizeof(Number)*new_alloc_size);
}
else if (new_alloc_size == 0)
{
- if (val != 0)
+ if (val != nullptr)
free(val);
- val = 0;
+ val = nullptr;
allocated_size = 0;
}
thread_loop_partitioner.reset(new ::dealii::parallel::internal::TBBPartitioner());
resize_val (size);
// delete previous content in import data
- if (import_data != 0)
+ if (import_data != nullptr)
delete[] import_data;
- import_data = 0;
+ import_data = nullptr;
// set partitioner to serial version
partitioner.reset (new Utilities::MPI::Partitioner (size));
const bool omit_zeroing_entries)
{
clear_mpi_requests();
- Assert (v.partitioner.get() != 0, ExcNotInitialized());
+ Assert (v.partitioner.get() != nullptr, ExcNotInitialized());
// check whether the partitioners are
// different (check only if the are allocated
if (omit_zeroing_entries == false)
this->operator= (Number());
- if (import_data != 0)
+ if (import_data != nullptr)
{
delete [] import_data;
// is only used as temporary storage for compress() and
// update_ghost_values, and we might have vectors where we never
// call these methods and hence do not need to have the storage.
- import_data = 0;
+ import_data = nullptr;
}
vector_is_ghosted = false;
// initialize to zero
this->operator= (Number());
- if (import_data != 0)
+ if (import_data != nullptr)
{
delete [] import_data;
// is only used as temporary storage for compress() and
// update_ghost_values, and we might have vectors where we never
// call these methods and hence do not need to have the storage.
- import_data = 0;
+ import_data = nullptr;
}
vector_is_ghosted = false;
:
partitioner (new Utilities::MPI::Partitioner()),
allocated_size (0),
- val (0),
- import_data (0)
+ val (nullptr),
+ import_data (nullptr)
{
reinit(0);
}
:
Subscriptor(),
allocated_size (0),
- val (0),
- import_data (0),
+ val (nullptr),
+ import_data (nullptr),
vector_is_ghosted (false)
{
reinit (v, true);
const MPI_Comm communicator)
:
allocated_size (0),
- val (0),
- import_data (0),
+ val (nullptr),
+ import_data (nullptr),
vector_is_ghosted (false)
{
reinit (local_range, ghost_indices, communicator);
const MPI_Comm communicator)
:
allocated_size (0),
- val (0),
- import_data (0),
+ val (nullptr),
+ import_data (nullptr),
vector_is_ghosted (false)
{
reinit (local_range, communicator);
Vector<Number>::Vector (const size_type size)
:
allocated_size (0),
- val (0),
- import_data (0),
+ val (nullptr),
+ import_data (nullptr),
vector_is_ghosted (false)
{
reinit (size, false);
Vector (const std::shared_ptr<const Utilities::MPI::Partitioner> &partitioner)
:
allocated_size (0),
- val (0),
- import_data (0),
+ val (nullptr),
+ import_data (nullptr),
vector_is_ghosted (false)
{
reinit (partitioner);
{
resize_val(0);
- if (import_data != 0)
+ if (import_data != nullptr)
delete[] import_data;
- import_data = 0;
+ import_data = nullptr;
clear_mpi_requests();
}
Vector<Number> &
Vector<Number>::operator = (const Vector<Number2> &c)
{
- Assert (c.partitioner.get() != 0, ExcNotInitialized());
+ Assert (c.partitioner.get() != nullptr, ExcNotInitialized());
// we update ghost values whenever one of the input or output vector
// already held ghost values or when we import data from a vector with
// c does not have any ghosts (constructed without ghost elements given)
// but the current vector does: In that case, we need to exchange data
// also when none of the two vector had updated its ghost values before.
- if (partitioner.get() == 0)
+ if (partitioner.get() == nullptr)
reinit (c, true);
else if (partitioner.get() != c.partitioner.get())
{
compress_requests.resize (n_import_targets + n_ghost_targets);
// allocate import_data in case it is not set up yet
- if (import_data == 0)
+ if (import_data == nullptr)
import_data = new Number[part.n_import_indices()];
// initiate the receive operations
part.local_size()+part.n_ghost_indices());
// allocate import_data in case it is not set up yet
- if (import_data == 0 && part.n_import_indices() > 0)
+ if (import_data == nullptr && part.n_import_indices() > 0)
import_data = new Number[part.n_import_indices()];
// copy the data to be sent to the import_data field
if (part.n_import_indices() > 0)
{
- Assert (import_data != 0, ExcInternalError());
+ Assert (import_data != nullptr, ExcInternalError());
Number *write_position = import_data;
std::vector<std::pair<unsigned int, unsigned int> >::const_iterator
my_imports = part.import_indices().begin();
// If no communication pattern is given, create one. Otherwise, use the
// given one.
std::shared_ptr<const Utilities::MPI::Partitioner> comm_pattern;
- if (communication_pattern.get() == NULL)
+ if (communication_pattern.get() == (nullptr))
{
// Split the IndexSet of V in locally owned elements and ghost indices
// then create the communication pattern
{
comm_pattern =
std::dynamic_pointer_cast<const Utilities::MPI::Partitioner> (communication_pattern);
- AssertThrow(comm_pattern != NULL,
+ AssertThrow(comm_pattern != nullptr,
ExcMessage("The communication pattern is not of type "
"Utilities::MPI::Partitioner."));
}
Vector<Number>::operator += (const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const Vector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &v = dynamic_cast<const Vector<Number> &>(vv);
Vector<Number>::operator -= (const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const Vector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &v = dynamic_cast<const Vector<Number> &>(vv);
const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const Vector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &v = dynamic_cast<const Vector<Number> &>(vv);
const VectorSpaceVector<Number> &ww)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const Vector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &v = dynamic_cast<const Vector<Number> &>(vv);
- Assert(dynamic_cast<const Vector<Number> *>(&ww)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&ww)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &w = dynamic_cast<const Vector<Number> &>(ww);
const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const Vector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &v = dynamic_cast<const Vector<Number> &>(vv);
Vector<Number>::scale (const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const Vector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &v = dynamic_cast<const Vector<Number> &>(vv);
const VectorSpaceVector<Number> &vv)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const Vector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &v = dynamic_cast<const Vector<Number> &>(vv);
Vector<Number>::operator * (const VectorSpaceVector<Number> &vv) const
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const Vector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &v = dynamic_cast<const Vector<Number> &>(vv);
const VectorSpaceVector<Number> &ww)
{
// Downcast. Throws an exception if invalid.
- Assert(dynamic_cast<const Vector<Number> *>(&vv)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&vv)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &v = dynamic_cast<const Vector<Number> &>(vv);
- Assert(dynamic_cast<const Vector<Number> *>(&ww)!=NULL,
+ Assert(dynamic_cast<const Vector<Number> *>(&ww)!=nullptr,
ExcVectorTypeNotCompatible());
const Vector<Number> &w = dynamic_cast<const Vector<Number> &>(ww);
// for it.
if (partitioner.use_count() > 0)
memory += partitioner->memory_consumption()/partitioner.use_count()+1;
- if (import_data != 0)
+ if (import_data != nullptr)
memory += (static_cast<std::size_t>(partitioner->n_import_indices())*
sizeof(Number));
return memory;
const bool scientific,
const bool across) const
{
- Assert (partitioner.get() !=0, ExcInternalError());
+ Assert (partitioner.get() !=nullptr, ExcInternalError());
AssertThrow (out, ExcIO());
std::ios::fmtflags old_flags = out.flags();
unsigned int old_precision = out.precision (precision);
Vector<Number> &Vector<Number>::operator+= (const VectorSpaceVector<Number> &V)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&V)!=NULL, ExcVectorTypeNotCompatible());
+ Assert(dynamic_cast<const Vector<Number>*>(&V)!=nullptr, ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
const Vector<Number> &down_V = dynamic_cast<const Vector<Number>&>(V);
Vector<Number> &Vector<Number>::operator-= (const VectorSpaceVector<Number> &V)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&V)!=NULL, ExcVectorTypeNotCompatible());
+ Assert(dynamic_cast<const Vector<Number>*>(&V)!=nullptr, ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
const Vector<Number> &down_V = dynamic_cast<const Vector<Number>&>(V);
Number Vector<Number>::operator* (const VectorSpaceVector<Number> &V) const
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector<Number>*>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
void Vector<Number>::add(const Number a, const VectorSpaceVector<Number> &V)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector<Number>*>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
const Number b, const VectorSpaceVector<Number> &W)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector<Number>*>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&W)!=NULL,
+ Assert(dynamic_cast<const Vector<Number>*>(&W)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
AssertIsFinite(a);
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector<Number>*>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. It fails, throws an exception.
void Vector<Number>::scale(const VectorSpaceVector<Number> &scaling_factors)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&scaling_factors)!=NULL,
+ Assert(dynamic_cast<const Vector<Number>*>(&scaling_factors)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast scaling_factors. If fails, throws an exception.
AssertIsFinite(a);
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector<Number>*>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
const VectorSpaceVector<Number> &W)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector<Number>*>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Check that casting will work.
- Assert(dynamic_cast<const Vector<Number>*>(&W)!=NULL,
+ Assert(dynamic_cast<const Vector<Number>*>(&W)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
// type is std::true_type if Matrix provides vmult_add and Tvmult_add,
// otherwise it is std::false_type
- typedef decltype(test<T>(0, 0, 0)) type;
+ typedef decltype(test<T>(nullptr, nullptr, nullptr)) type;
};
}
#if DEAL_II_PETSC_VERSION_LT(3, 7, 0)
const PetscErrorCode ierr = PetscOptionsSetValue (name.c_str (), value.c_str ());
#else
- const PetscErrorCode ierr = PetscOptionsSetValue (NULL, name.c_str (), value.c_str ());
+ const PetscErrorCode ierr = PetscOptionsSetValue ((nullptr), name.c_str (), value.c_str ());
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
*/
inline PetscErrorCode destroy_matrix (Mat &matrix)
{
- // PETSc will check whether or not matrix is NULL.
+ // PETSc will check whether or not matrix is (nullptr).
#if DEAL_II_PETSC_VERSION_LT(3, 2, 0)
return MatDestroy (matrix);
#else
*/
inline PetscErrorCode destroy_krylov_solver (KSP &krylov_solver)
{
- // PETSc will check whether or not matrix is NULL.
+ // PETSc will check whether or not matrix is (nullptr).
#if DEAL_II_PETSC_VERSION_LT(3, 2, 0)
return KSPDestroy (krylov_solver);
#else
*
* If <tt>M</tt> is zero, no matrix is stored.
*/
- PointerMatrix (const MatrixType *M=0);
+ PointerMatrix (const MatrixType *M=nullptr);
/**
* Constructor.
PointerMatrixBase<VectorType> *
new_pointer_matrix_base(MatrixType &matrix, const VectorType &, const char *name = "PointerMatrixAux")
{
- return new PointerMatrixAux<MatrixType, VectorType>(0, &matrix, name);
+ return new PointerMatrixAux<MatrixType, VectorType>(nullptr, &matrix, name);
}
/**
template<typename MatrixType, typename VectorType>
PointerMatrix<MatrixType, VectorType>::PointerMatrix (const char *name)
- : m(0, name)
+ : m(nullptr, name)
{}
inline void
PointerMatrix<MatrixType, VectorType>::clear ()
{
- m = 0;
+ m = nullptr;
}
inline bool
PointerMatrix<MatrixType, VectorType>::empty () const
{
- if (m == 0)
+ if (m == nullptr)
return true;
return m->empty();
}
PointerMatrix<MatrixType, VectorType>::vmult (VectorType &dst,
const VectorType &src) const
{
- Assert (m != 0, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
m->vmult (dst, src);
}
PointerMatrix<MatrixType, VectorType>::Tvmult (VectorType &dst,
const VectorType &src) const
{
- Assert (m != 0, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
m->Tvmult (dst, src);
}
PointerMatrix<MatrixType, VectorType>::vmult_add (VectorType &dst,
const VectorType &src) const
{
- Assert (m != 0, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
m->vmult_add (dst, src);
}
PointerMatrix<MatrixType, VectorType>::Tvmult_add (VectorType &dst,
const VectorType &src) const
{
- Assert (m != 0, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
m->Tvmult_add (dst, src);
}
: mem(mem, name),
m(M, name)
{
- if (mem == 0) mem = &my_memory;
+ if (mem == nullptr) mem = &my_memory;
}
inline void
PointerMatrixAux<MatrixType, VectorType>::clear ()
{
- m = 0;
+ m = nullptr;
}
PointerMatrixAux<MatrixType, VectorType>::vmult (VectorType &dst,
const VectorType &src) const
{
- if (mem == 0)
+ if (mem == nullptr)
mem = &my_memory;
- Assert (mem != 0, ExcNotInitialized());
- Assert (m != 0, ExcNotInitialized());
+ Assert (mem != nullptr, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
m->vmult (dst, src);
}
PointerMatrixAux<MatrixType, VectorType>::Tvmult (VectorType &dst,
const VectorType &src) const
{
- if (mem == 0)
+ if (mem == nullptr)
mem = &my_memory;
- Assert (mem != 0, ExcNotInitialized());
- Assert (m != 0, ExcNotInitialized());
+ Assert (mem != nullptr, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
m->Tvmult (dst, src);
}
PointerMatrixAux<MatrixType, VectorType>::vmult_add (VectorType &dst,
const VectorType &src) const
{
- if (mem == 0)
+ if (mem == nullptr)
mem = &my_memory;
- Assert (mem != 0, ExcNotInitialized());
- Assert (m != 0, ExcNotInitialized());
+ Assert (mem != nullptr, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
VectorType *v = mem->alloc();
v->reinit(dst);
m->vmult (*v, src);
PointerMatrixAux<MatrixType, VectorType>::Tvmult_add (VectorType &dst,
const VectorType &src) const
{
- if (mem == 0)
+ if (mem == nullptr)
mem = &my_memory;
- Assert (mem != 0, ExcNotInitialized());
- Assert (m != 0, ExcNotInitialized());
+ Assert (mem != nullptr, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
VectorType *v = mem->alloc();
v->reinit(dst);
m->Tvmult (*v, src);
inline void
PointerMatrixVector<number>::clear ()
{
- m = 0;
+ m = nullptr;
}
PointerMatrixVector<number>::vmult (Vector<number> &dst,
const Vector<number> &src) const
{
- Assert (m != 0, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
Assert (dst.size() == 1, ExcDimensionMismatch(dst.size(), 1));
dst(0) = *m * src;
PointerMatrixVector<number>::Tvmult (Vector<number> &dst,
const Vector<number> &src) const
{
- Assert (m != 0, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
Assert(src.size() == 1, ExcDimensionMismatch(src.size(), 1));
dst.equ (src(0), *m);
PointerMatrixVector<number>::vmult_add (Vector<number> &dst,
const Vector<number> &src) const
{
- Assert (m != 0, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
Assert (dst.size() == 1, ExcDimensionMismatch(dst.size(), 1));
dst(0) += *m * src;
PointerMatrixVector<number>::Tvmult_add (Vector<number> &dst,
const Vector<number> &src) const
{
- Assert (m != 0, ExcNotInitialized());
+ Assert (m != nullptr, ExcNotInitialized());
Assert(src.size() == 1, ExcDimensionMismatch(src.size(), 1));
dst.add (src(0), *m);
inline void
PreconditionRelaxation<MatrixType>::clear ()
{
- A = 0;
+ A = nullptr;
}
template <typename MatrixType>
inline typename PreconditionRelaxation<MatrixType>::size_type
PreconditionRelaxation<MatrixType>::m () const
{
- Assert (A!=0, ExcNotInitialized());
+ Assert (A!=nullptr, ExcNotInitialized());
return A->m();
}
inline typename PreconditionRelaxation<MatrixType>::size_type
PreconditionRelaxation<MatrixType>::n () const
{
- Assert (A!=0, ExcNotInitialized());
+ Assert (A!=nullptr, ExcNotInitialized());
return A->n();
}
"PreconditionJacobi and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->precondition_Jacobi (dst, src, this->relaxation);
}
"PreconditionJacobi and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->precondition_Jacobi (dst, src, this->relaxation);
}
"PreconditionJacobi and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->Jacobi_step (dst, src, this->relaxation);
}
"PreconditionSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->precondition_SOR (dst, src, this->relaxation);
}
"PreconditionSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->precondition_TSOR (dst, src, this->relaxation);
}
"PreconditionSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->SOR_step (dst, src, this->relaxation);
}
"PreconditionSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->TSOR_step (dst, src, this->relaxation);
}
dynamic_cast<const SparseMatrix<typename MatrixType::value_type> *>(&*this->A);
// calculate the positions first after the diagonal.
- if (mat != 0)
+ if (mat != nullptr)
{
const size_type n = this->A->n();
pos_right_of_diagonal.resize(n, static_cast<std::size_t>(-1));
"PreconditionSSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->precondition_SSOR (dst, src, this->relaxation, pos_right_of_diagonal);
}
"PreconditionSSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->precondition_SSOR (dst, src, this->relaxation, pos_right_of_diagonal);
}
"PreconditionSSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
this->A->SSOR_step (dst, src, this->relaxation);
}
"PreconditionPSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
dst = src;
this->A->PSOR (dst, *permutation, *inverse_permutation, this->relaxation);
}
"PreconditionPSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
dst = src;
this->A->TPSOR (dst, *permutation, *inverse_permutation, this->relaxation);
}
{
(void)matrix;
(void)preconditioner;
- AssertThrow(preconditioner.get() != NULL, ExcNotInitialized());
+ AssertThrow(preconditioner.get() != nullptr, ExcNotInitialized());
}
template <typename MatrixType, typename VectorType>
std::shared_ptr<DiagonalMatrix<VectorType> > &preconditioner,
VectorType &diagonal_inverse)
{
- if (preconditioner.get() == NULL ||
+ if (preconditioner.get() ==nullptr||
preconditioner->m() != matrix.m())
{
- if (preconditioner.get() == NULL)
+ if (preconditioner.get() == (nullptr))
preconditioner.reset(new DiagonalMatrix<VectorType>());
Assert(preconditioner->m() == 0,
{
is_initialized = false;
theta = delta = 1.0;
- matrix_ptr = 0;
+ matrix_ptr = nullptr;
{
VectorType empty_vector;
data.matrix_diagonal_inverse.reinit(empty_vector);
(const VectorType &src) const
{
Assert(is_initialized == false, ExcInternalError());
- Assert(data.preconditioner.get() != NULL, ExcNotInitialized());
+ Assert(data.preconditioner.get() != nullptr, ExcNotInitialized());
update1.reinit(src);
update2.reinit(src, true);
typename PreconditionChebyshev<MatrixType,VectorType,PreconditionerType>::size_type
PreconditionChebyshev<MatrixType,VectorType,PreconditionerType>::m () const
{
- Assert (matrix_ptr!=0, ExcNotInitialized());
+ Assert (matrix_ptr!=nullptr, ExcNotInitialized());
return matrix_ptr->m();
}
typename PreconditionChebyshev<MatrixType,VectorType,PreconditionerType>::size_type
PreconditionChebyshev<MatrixType,VectorType,PreconditionerType>::n () const
{
- Assert (matrix_ptr!=0, ExcNotInitialized());
+ Assert (matrix_ptr!=nullptr, ExcNotInitialized());
return matrix_ptr->n();
}
inline bool
PreconditionBlock<MatrixType, inverse_type>::empty () const
{
- if (A == 0)
+ if (A == nullptr)
return true;
return A->empty();
}
PreconditionBlock<MatrixType,inverse_type>::PreconditionBlock (bool store)
: PreconditionBlockBase<inverse_type>(store),
blocksize(0),
- A(0, typeid(*this).name()),
+ A(nullptr, typeid(*this).name()),
relaxation(1.0)
{}
{
PreconditionBlockBase<inverse_type>::clear();
blocksize = 0;
- A = 0;
+ A = nullptr;
}
template <typename MatrixType, typename inverse_type>
void PreconditionBlock<MatrixType,inverse_type>::invert_permuted_diagblocks()
{
- Assert (A!=0, ExcNotInitialized());
+ Assert (A!=nullptr, ExcNotInitialized());
Assert (blocksize!=0, ExcNotInitialized());
const MatrixType &M=*A;
const Vector<number2> &src,
const bool transpose_diagonal) const
{
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
const MatrixType &M=*this->A;
const Vector<number2> &src,
const bool transpose_diagonal) const
{
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
const MatrixType &M=*this->A;
template <typename MatrixType, typename inverse_type>
void PreconditionBlock<MatrixType,inverse_type>::invert_diagblocks()
{
- Assert (A!=0, ExcNotInitialized());
+ Assert (A!=nullptr, ExcNotInitialized());
Assert (blocksize!=0, ExcNotInitialized());
const MatrixType &M=*A;
const Vector<number2> &src,
bool adding) const
{
- Assert(this->A!=0, ExcNotInitialized());
+ Assert(this->A!=nullptr, ExcNotInitialized());
const MatrixType &M=*this->A;
const bool transpose_diagonal,
const bool) const
{
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
const MatrixType &M=*this->A;
const bool permuted = (this->permutation.size() != 0);
const bool transpose_diagonal,
const bool) const
{
- Assert (this->A!=0, ExcNotInitialized());
+ Assert (this->A!=nullptr, ExcNotInitialized());
const MatrixType &M=*this->A;
const bool permuted = (this->permutation.size() != 0);
PreconditionSelector<MatrixType,VectorType>::~PreconditionSelector()
{
// release the matrix A
- A=0;
+ A=nullptr;
}
inline typename PreconditionSelector<MatrixType,VectorType>::size_type
PreconditionSelector<MatrixType,VectorType>::m () const
{
- Assert(A!=0, ExcNoMatrixGivenToUse());
+ Assert(A!=nullptr, ExcNoMatrixGivenToUse());
return A->m();
}
inline typename PreconditionSelector<MatrixType,VectorType>::size_type
PreconditionSelector<MatrixType,VectorType>::n () const
{
- Assert(A!=0, ExcNoMatrixGivenToUse());
+ Assert(A!=nullptr, ExcNoMatrixGivenToUse());
return A->n();
}
}
else
{
- Assert(A!=0, ExcNoMatrixGivenToUse());
+ Assert(A!=nullptr, ExcNoMatrixGivenToUse());
if (preconditioning=="jacobi")
{
}
else
{
- Assert(A!=0, ExcNoMatrixGivenToUse());
+ Assert(A!=nullptr, ExcNoMatrixGivenToUse());
if (preconditioning=="jacobi")
{
inline
ReadWriteVector<Number>::ReadWriteVector ()
:
- val(NULL)
+ val((nullptr))
{
reinit(0, true);
}
ReadWriteVector<Number>::ReadWriteVector (const ReadWriteVector<Number> &v)
:
Subscriptor(),
- val(NULL)
+ val((nullptr))
{
this->operator=(v);
}
inline
ReadWriteVector<Number>::ReadWriteVector (const size_type size)
:
- val(NULL)
+ val((nullptr))
{
reinit (size, false);
}
inline
ReadWriteVector<Number>::ReadWriteVector (const IndexSet &locally_stored_indices)
:
- val(NULL)
+ val((nullptr))
{
reinit (locally_stored_indices);
}
{
if (new_alloc_size == 0)
{
- if (val != NULL)
+ if (val != (nullptr))
free(val);
- val = NULL;
+ val = (nullptr);
thread_loop_partitioner.reset(new parallel::internal::TBBPartitioner());
}
else
{
- if (val != NULL)
+ if (val != (nullptr))
free(val);
Utilities::System::posix_memalign ((void **)&val, 64, sizeof(Number)*new_alloc_size);
// If no communication pattern is given, create one. Otherwise, use the
// given one.
std::shared_ptr<const Utilities::MPI::Partitioner> comm_pattern;
- if (communication_pattern.get() == NULL)
+ if (communication_pattern.get() == (nullptr))
{
comm_pattern.reset(new Utilities::MPI::Partitioner(vec.locally_owned_elements(),
get_stored_elements(),
{
comm_pattern =
std::dynamic_pointer_cast<const Utilities::MPI::Partitioner> (communication_pattern);
- AssertThrow(comm_pattern != NULL,
+ AssertThrow(comm_pattern != nullptr,
ExcMessage("The communication pattern is not of type "
"Utilities::MPI::Partitioner."));
}
// If no communication pattern is given, create one. Otherwise, use the one
// given.
- if (communication_pattern == NULL)
+ if (communication_pattern == (nullptr))
{
// The first time import is called, we create a communication pattern.
// Check if the communication pattern already exists and if it can be
{
epetra_comm_pattern =
std::dynamic_pointer_cast<const EpetraWrappers::CommunicationPattern> (comm_pattern);
- if (epetra_comm_pattern == NULL)
+ if (epetra_comm_pattern == (nullptr))
epetra_comm_pattern = std::make_shared<const EpetraWrappers::CommunicationPattern>(
create_epetra_comm_pattern(source_elements, mpi_comm));
}
{
epetra_comm_pattern = std::dynamic_pointer_cast<const EpetraWrappers::CommunicationPattern> (
communication_pattern);
- AssertThrow(epetra_comm_pattern != NULL,
+ AssertThrow(epetra_comm_pattern != nullptr,
ExcMessage(std::string("The communication pattern is not of type ") +
"LinearAlgebra::EpetraWrappers::CommunicationPattern."));
}
const typename PreconditionBlockBase<InverseNumberType>::Inversion inversion
= PreconditionBlockBase<InverseNumberType>::gauss_jordan,
const double threshold = 0.,
- VectorType *temp_ghost_vector = NULL);
+ VectorType *temp_ghost_vector = (nullptr));
/**
* The mapping from indices to blocks. Each row of this pattern enumerates
void
RelaxationBlock<MatrixType, InverseNumberType, VectorType>::clear ()
{
- A = 0;
- additional_data = 0;
+ A = nullptr;
+ additional_data = nullptr;
PreconditionBlockBase<InverseNumberType>::clear ();
}
// If the following Assertion triggers, you either set temp_ghost_vector
// for a serial computation (don't!), or nobody implemented, instantiated, and
// tested the parallel version for your vector type.
- Assert(other==NULL, ExcNotImplemented());
+ Assert(other==nullptr, ExcNotImplemented());
(void)other;
return prev;
}
const TrilinosWrappers::MPI::Vector &prev,
TrilinosWrappers::MPI::Vector *other)
{
- Assert(other!=NULL,
+ Assert(other!=nullptr,
ExcMessage("You need to provide a ghosted vector in RelaxationBlock::AdditionalData::temp_trilinos_ghost_vector."));
Assert(other->size()==prev.size(), ExcInternalError());
const AdditionalData &data)
:
Solver<VectorType>(cn),
- Vx(NULL),
- Vr(NULL),
- Vrbar(NULL),
- Vp(NULL),
- Vy(NULL),
- Vz(NULL),
- Vt(NULL),
- Vv(NULL),
- Vb(NULL),
+ Vx((nullptr)),
+ Vr((nullptr)),
+ Vrbar((nullptr)),
+ Vp((nullptr)),
+ Vy((nullptr)),
+ Vz((nullptr)),
+ Vt((nullptr)),
+ Vv((nullptr)),
+ Vb((nullptr)),
alpha(0.),
beta(0.),
omega(0.),
const AdditionalData &data)
:
Solver<VectorType>(cn,mem),
- Vr(NULL),
- Vp(NULL),
- Vz(NULL),
+ Vr((nullptr)),
+ Vp((nullptr)),
+ Vz((nullptr)),
additional_data(data)
{}
const AdditionalData &data)
:
Solver<VectorType>(cn),
- Vr(NULL),
- Vp(NULL),
- Vz(NULL),
+ Vr((nullptr)),
+ Vp((nullptr)),
+ Vz((nullptr)),
additional_data(data)
{}
VectorMemory<VectorType> &vmem)
:
mem(vmem),
- data (max_size, 0),
+ data (max_size, nullptr),
offset(0)
{}
{
for (typename std::vector<VectorType *>::iterator v = data.begin();
v != data.end(); ++v)
- if (*v != 0)
+ if (*v != nullptr)
mem.free(*v);
}
Assert (i+offset<data.size(),
ExcIndexRange(i, -offset, data.size()-offset));
- Assert (data[i-offset] != 0, ExcNotInitialized());
+ Assert (data[i-offset] != nullptr, ExcNotInitialized());
return *data[i-offset];
}
{
Assert (i+offset<data.size(),
ExcIndexRange(i,-offset, data.size()-offset));
- if (data[i-offset] == 0)
+ if (data[i-offset] == nullptr)
{
data[i-offset] = mem.alloc();
data[i-offset]->reinit(temp);
// Following vectors are needed
// when not the default residuals
// are used as stopping criterion
- VectorType *r=0;
- VectorType *x_=0;
- dealii::Vector<double> *gamma_=0;
+ VectorType *r=nullptr;
+ VectorType *x_=nullptr;
+ dealii::Vector<double> *gamma_=nullptr;
if (!use_default_residual)
{
r=this->memory.alloc();
const AdditionalData &)
:
Solver<VectorType>(cn),
- Vu0(NULL),
- Vu1(NULL),
- Vu2(NULL),
- Vm0(NULL),
- Vm1(NULL),
- Vm2(NULL),
- Vv(NULL),
+ Vu0((nullptr)),
+ Vu1((nullptr)),
+ Vu2((nullptr)),
+ Vm0((nullptr)),
+ Vm1((nullptr)),
+ Vm2((nullptr)),
+ Vv((nullptr)),
res2(numbers::signaling_nan<double>())
{}
const AdditionalData &data)
:
Solver<VectorType> (cn,mem),
- Vr(NULL),
- Vd(NULL),
+ Vr((nullptr)),
+ Vd((nullptr)),
additional_data(data)
{}
const AdditionalData &data)
:
Solver<VectorType> (cn),
- Vr(NULL),
- Vd(NULL),
+ Vr((nullptr)),
+ Vd((nullptr)),
additional_data(data),
res(numbers::signaling_nan<double>())
{}
AdditionalData (const double strengthen_diagonal=0,
const unsigned int extra_off_diagonals=0,
const bool use_previous_sparsity=false,
- const SparsityPattern *use_this_sparsity=0);
+ const SparsityPattern *use_this_sparsity=nullptr);
/**
* <code>strengthen_diag</code> times the sum of absolute row entries is
:
SparseMatrix<number>(),
strengthen_diagonal (0),
- own_sparsity(0)
+ own_sparsity(nullptr)
{}
if (own_sparsity)
{
delete own_sparsity;
- own_sparsity=0;
+ own_sparsity=nullptr;
}
}
{
const SparsityPattern &matrix_sparsity=matrix.get_sparsity_pattern();
- const SparsityPattern *sparsity_pattern_to_use = 0;
+ const SparsityPattern *sparsity_pattern_to_use = nullptr;
if (data.use_this_sparsity)
sparsity_pattern_to_use = data.use_this_sparsity;
inline
typename SparseMatrix<number>::size_type SparseMatrix<number>::m () const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
return cols->rows;
}
inline
typename SparseMatrix<number>::size_type SparseMatrix<number>::n () const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
return cols->cols;
}
SparseMatrix<number> &
SparseMatrix<number>::operator *= (const number factor)
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
number *val_ptr = &val[0];
const number *const end_ptr = &val[cols->n_nonzero_elements()];
SparseMatrix<number> &
SparseMatrix<number>::operator /= (const number factor)
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (factor != number(), ExcDivideByZero());
const number factor_inv = number(1.) / factor;
number SparseMatrix<number>::operator () (const size_type i,
const size_type j) const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert (cols->operator()(i,j) != SparsityPattern::invalid_entry,
ExcInvalidIndex(i,j));
return val[cols->operator()(i,j)];
number SparseMatrix<number>::el (const size_type i,
const size_type j) const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
const size_type index = cols->operator()(i,j);
if (index != SparsityPattern::invalid_entry)
inline
number SparseMatrix<number>::diag_element (const size_type i) const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcNotQuadratic());
AssertIndexRange(i, m());
inline
number &SparseMatrix<number>::diag_element (const size_type i)
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert (m() == n(), ExcNotQuadratic());
AssertIndexRange(i, m());
const bool across,
const bool diagonal_first) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
bool hanging_diagonal = false;
number diagonal = number();
template <typename number>
SparseMatrix<number>::SparseMatrix ()
:
- cols(0, "SparseMatrix"),
- val(0),
+ cols(nullptr, "SparseMatrix"),
+ val(nullptr),
max_len(0)
{}
SparseMatrix<number>::SparseMatrix (const SparseMatrix &m)
:
Subscriptor (m),
- cols(0, "SparseMatrix"),
- val(0),
+ cols(nullptr, "SparseMatrix"),
+ val(nullptr),
max_len(0)
{
- Assert (m.cols==0 && m.val==0 && m.max_len==0,
+ Assert (m.cols==nullptr && m.val==nullptr && m.max_len==0,
ExcMessage("This constructor can only be called if the provided argument "
"is an empty matrix. This constructor can not be used to "
"copy-construct a non-empty matrix. Use the "
SparseMatrix<number>::operator = (const SparseMatrix<number> &m)
{
(void)m;
- Assert (m.cols==0 && m.val==0 && m.max_len==0,
+ Assert (m.cols==nullptr && m.val==nullptr && m.max_len==0,
ExcMessage("This operator can only be called if the provided right "
"hand side is an empty matrix. This operator can not be "
"used to copy a non-empty matrix. Use the "
template <typename number>
SparseMatrix<number>::SparseMatrix (const SparsityPattern &c)
:
- cols(0, "SparseMatrix"),
- val(0),
+ cols(nullptr, "SparseMatrix"),
+ val(nullptr),
max_len(0)
{
reinit (c);
SparseMatrix<number>::SparseMatrix (const SparsityPattern &c,
const IdentityMatrix &id)
:
- cols(0, "SparseMatrix"),
- val(0),
+ cols(nullptr, "SparseMatrix"),
+ val(nullptr),
max_len(0)
{
(void)id;
template <typename number>
SparseMatrix<number>::~SparseMatrix ()
{
- cols = 0;
+ cols = nullptr;
- if (val != 0)
+ if (val != nullptr)
delete[] val;
}
(void)d;
Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert (cols->compressed || cols->empty(), SparsityPattern::ExcNotCompressed());
// do initial zeroing of elements in parallel. Try to achieve a similar
if (cols->empty())
{
- if (val != 0)
+ if (val != nullptr)
delete[] val;
- val = 0;
+ val = nullptr;
max_len = 0;
return;
}
const std::size_t N = cols->n_nonzero_elements();
if (N > max_len || max_len == 0)
{
- if (val != 0)
+ if (val != nullptr)
delete[] val;
val = new number[N];
max_len = N;
void
SparseMatrix<number>::clear ()
{
- cols = 0;
+ cols = nullptr;
if (val) delete[] val;
- val = 0;
+ val = nullptr;
max_len = 0;
}
bool
SparseMatrix<number>::empty () const
{
- if (cols == 0)
+ if (cols == nullptr)
return true;
else
return cols->empty();
typename SparseMatrix<number>::size_type
SparseMatrix<number>::get_row_length (const size_type row) const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
return cols->row_length(row);
}
std::size_t
SparseMatrix<number>::n_nonzero_elements () const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
return cols->n_nonzero_elements ();
}
std::size_t
SparseMatrix<number>::n_actually_nonzero_elements (const double threshold) const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert (threshold >= 0, ExcMessage ("Negative threshold!"));
size_type nnz = 0;
const std::size_t nnz_alloc = n_nonzero_elements();
void
SparseMatrix<number>::symmetrize ()
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert (cols->rows == cols->cols, ExcNotQuadratic());
const size_type n_rows = m();
SparseMatrix<number> &
SparseMatrix<number>::copy_from (const SparseMatrix<somenumber> &matrix)
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (cols == matrix.cols, ExcDifferentSparsityPatterns());
std::copy (&matrix.val[0], &matrix.val[cols->n_nonzero_elements()],
SparseMatrix<number>::add (const number factor,
const SparseMatrix<somenumber> &matrix)
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert (cols == matrix.cols, ExcDifferentSparsityPatterns());
number *val_ptr = &val[0];
const bool elide_zero_values,
const bool col_indices_are_sorted)
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
// if we have sufficiently many columns
// and sorted indices it is faster to
const number2 *values,
const bool elide_zero_values)
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
AssertIndexRange(row, m());
// First, search all the indices to find
SparseMatrix<number>::vmult (OutVector &dst,
const InVector &src) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
SparseMatrix<number>::Tvmult (OutVector &dst,
const InVector &src) const
{
- Assert (val != 0, ExcNotInitialized());
- Assert (cols != 0, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert(n() == dst.size(), ExcDimensionMismatch(n(),dst.size()));
Assert(m() == src.size(), ExcDimensionMismatch(m(),src.size()));
SparseMatrix<number>::vmult_add (OutVector &dst,
const InVector &src) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
SparseMatrix<number>::Tvmult_add (OutVector &dst,
const InVector &src) const
{
- Assert (val != 0, ExcNotInitialized());
- Assert (cols != 0, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
Assert(n() == dst.size(), ExcDimensionMismatch(n(),dst.size()));
Assert(m() == src.size(), ExcDimensionMismatch(m(),src.size()));
somenumber
SparseMatrix<number>::matrix_norm_square (const Vector<somenumber> &v) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == v.size(), ExcDimensionMismatch(m(),v.size()));
Assert(n() == v.size(), ExcDimensionMismatch(n(),v.size()));
SparseMatrix<number>::matrix_scalar_product (const Vector<somenumber> &u,
const Vector<somenumber> &v) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == u.size(), ExcDimensionMismatch(m(),u.size()));
Assert(n() == v.size(), ExcDimensionMismatch(n(),v.size()));
{
const bool use_vector = V.size() == n() ? true : false;
Assert (n() == B.m(), ExcDimensionMismatch(n(), B.m()));
- Assert (cols != 0, ExcNotInitialized());
- Assert (B.cols != 0, ExcNotInitialized());
- Assert (C.cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (B.cols != nullptr, ExcNotInitialized());
+ Assert (C.cols != nullptr, ExcNotInitialized());
const SparsityPattern &sp_A = *cols;
const SparsityPattern &sp_B = *B.cols;
{
const bool use_vector = V.size() == m() ? true : false;
Assert (m() == B.m(), ExcDimensionMismatch(m(), B.m()));
- Assert (cols != 0, ExcNotInitialized());
- Assert (B.cols != 0, ExcNotInitialized());
- Assert (C.cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (B.cols != nullptr, ExcNotInitialized());
+ Assert (C.cols != nullptr, ExcNotInitialized());
const SparsityPattern &sp_A = *cols;
const SparsityPattern &sp_B = *B.cols;
typename SparseMatrix<number>::real_type
SparseMatrix<number>::l1_norm () const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Vector<real_type> column_sums(n());
const size_type n_rows = m();
typename SparseMatrix<number>::real_type
SparseMatrix<number>::linfty_norm () const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
const number *val_ptr = &val[cols->rowstart[0]];
const Vector<somenumber> &u,
const Vector<somenumber> &b) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
Assert(m() == b.size(), ExcDimensionMismatch(m(),b.size()));
Assert(n() == u.size(), ExcDimensionMismatch(n(),u.size()));
const Vector<somenumber> &src,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
AssertDimension (dst.size(), n());
AssertDimension (src.size(), n());
// you may want to take a look at the CVS
// archives to see the original version
// which is much clearer...
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
AssertDimension (dst.size(), n());
AssertDimension (src.size(), n());
const Vector<somenumber> &src,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
dst = src;
SOR(dst,om);
const Vector<somenumber> &src,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
dst = src;
TSOR(dst,om);
SparseMatrix<number>::SOR (Vector<somenumber> &dst,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
AssertDimension (dst.size(), n());
SparseMatrix<number>::TSOR (Vector<somenumber> &dst,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
AssertDimension (dst.size(), n());
const std::vector<size_type> &inverse_permutation,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
const std::vector<size_type> &inverse_permutation,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
const Vector<somenumber> &b,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
Assert (m() == v.size(), ExcDimensionMismatch(m(),v.size()));
const Vector<somenumber> &b,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
Assert (m() == v.size(), ExcDimensionMismatch(m(),v.size()));
Assert (m() == b.size(), ExcDimensionMismatch(m(),b.size()));
const Vector<somenumber> &b,
const number om) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
Assert (m() == v.size(), ExcDimensionMismatch(m(),v.size()));
Assert (m() == b.size(), ExcDimensionMismatch(m(),b.size()));
//TODO: Is this called anywhere? If so, multiplication with om(2-om)D is missing
Assert(false, ExcNotImplemented());
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
AssertDimension (m(), n());
Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
const SparsityPattern &
SparseMatrix<number>::get_sparsity_pattern () const
{
- Assert (cols != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
return *cols;
}
const char *zero_string,
const double denominator) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
unsigned int width = width_;
void SparseMatrix<number>::print_pattern (std::ostream &out,
const double threshold) const
{
- Assert (cols != 0, ExcNotInitialized());
- Assert (val != 0, ExcNotInitialized());
+ Assert (cols != nullptr, ExcNotInitialized());
+ Assert (val != nullptr, ExcNotInitialized());
for (size_type i=0; i<m(); ++i)
{
if (entry->column == col)
return entry;
if (entry->column == Entry::invalid)
- return 0;
+ return nullptr;
}
- return 0;
+ return nullptr;
}
if (elide_zero_values && value == 0.)
{
Entry *entry = locate(i,j);
- if (entry != 0)
+ if (entry != nullptr)
entry->value = 0.;
}
else
template<typename number2>
void apply_preconditioner (Vector<number2> &dst,
const Vector<number2> &src,
- const std::vector<bool> *const dof_mask = 0) const;
+ const std::vector<bool> *const dof_mask = nullptr) const;
/**
* Determine an estimate for the memory consumption (in bytes) of this
conserve_mem (conserve_mem),
selected (&selected_dofs),
n_threads (n_threads),
- inverses (M.m(), 0),
+ inverses (M.m(), nullptr),
_m (M.m()),
_n (M.n())
{
for (i=inverses.begin(); i!=inverses.end(); ++i)
{
FullMatrix<float> *p = *i;
- *i = 0;
- if (p != 0) delete p;
+ *i = nullptr;
+ if (p != nullptr) delete p;
}
}
void
SparseVanka<number>::compute_inverses ()
{
- Assert(matrix != 0, ExcNotInitialized());
- Assert(selected != 0, ExcNotInitialized());
+ Assert(matrix != nullptr, ExcNotInitialized());
+ Assert(selected != nullptr, ExcNotInitialized());
#ifndef DEAL_II_WITH_THREADS
compute_inverses (0, matrix->m());
SparseVanka<number>::compute_inverse (const size_type row,
std::vector<size_type> &local_indices)
{
- Assert(matrix != 0, ExcNotInitialized());
- Assert(selected != 0, ExcNotInitialized());
+ Assert(matrix != nullptr, ExcNotInitialized());
+ Assert(selected != nullptr, ExcNotInitialized());
// first define an alias to the sparsity
// pattern of the matrix, since this
SparseVanka<number>::vmult (Vector<number2> &dst,
const Vector<number2> &src) const
{
- Assert(matrix != 0, ExcNotInitialized());
- Assert(selected != 0, ExcNotInitialized());
+ Assert(matrix != nullptr, ExcNotInitialized());
+ Assert(selected != nullptr, ExcNotInitialized());
// first set output vector to zero
dst = 0;
// blocks. this variable is used to
// optimize access to vectors a
// little bit.
- const bool range_is_restricted = (dof_mask != 0);
+ const bool range_is_restricted = (dof_mask != nullptr);
// space to be used for local
// systems. allocate as much memory
// inverses, then unalias the
// local matrix
if (conserve_mem == true)
- inverses[row] = 0;
+ inverses[row] = nullptr;
}
}
std::size_t
SparsityPattern::n_nonzero_elements () const
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
Assert (compressed, ExcNotCompressed());
return rowstart[rows]-rowstart[0];
}
ar &max_dim &rows &cols &max_vec_len &max_row_length &compressed &store_diagonal_first_in_row;
- if (rowstart != 0)
+ if (rowstart != nullptr)
delete[] rowstart;
rowstart = new std::size_t[max_dim + 1];
- if (colnums != 0)
+ if (colnums != nullptr)
delete[] colnums;
colnums = new size_type[max_vec_len];
void initialize (const ::dealii::SparseMatrix<number> &deal_ii_sparse_matrix,
const AdditionalData &additional_data = AdditionalData(),
const double drop_tolerance = 1e-13,
- const ::dealii::SparsityPattern *use_this_sparsity = 0);
+ const ::dealii::SparsityPattern *use_this_sparsity = nullptr);
/**
* This function can be used for a faster recalculation of the
void initialize (const ::dealii::SparseMatrix<number> &deal_ii_sparse_matrix,
const AdditionalData &additional_data = AdditionalData(),
const double drop_tolerance = 1e-13,
- const ::dealii::SparsityPattern *use_this_sparsity = 0);
+ const ::dealii::SparsityPattern *use_this_sparsity = nullptr);
/**
* Destroys the preconditioner, leaving an object like just after having
void reinit (const ::dealii::SparseMatrix<number> &dealii_sparse_matrix,
const double drop_tolerance=1e-13,
const bool copy_values=true,
- const ::dealii::SparsityPattern *use_this_sparsity=0);
+ const ::dealii::SparsityPattern *use_this_sparsity=nullptr);
/**
* This reinit function takes as input a Trilinos Epetra_CrsMatrix and
const ::dealii::SparseMatrix<number> &dealii_sparse_matrix,
const double drop_tolerance=1e-13,
const bool copy_values=true,
- const ::dealii::SparsityPattern *use_this_sparsity=0) DEAL_II_DEPRECATED;
+ const ::dealii::SparsityPattern *use_this_sparsity=nullptr) DEAL_II_DEPRECATED;
/**
* This function is similar to the other initialization function with
const ::dealii::SparseMatrix<number> &dealii_sparse_matrix,
const double drop_tolerance=1e-13,
const bool copy_values=true,
- const ::dealii::SparsityPattern *use_this_sparsity=0) DEAL_II_DEPRECATED;
+ const ::dealii::SparsityPattern *use_this_sparsity=nullptr) DEAL_II_DEPRECATED;
//@}
/**
* @name Constructors and initialization using an IndexSet description
const MPI_Comm &communicator = MPI_COMM_WORLD,
const double drop_tolerance=1e-13,
const bool copy_values=true,
- const ::dealii::SparsityPattern *use_this_sparsity=0);
+ const ::dealii::SparsityPattern *use_this_sparsity=nullptr);
/**
* This function is similar to the other initialization function with
const MPI_Comm &communicator = MPI_COMM_WORLD,
const double drop_tolerance=1e-13,
const bool copy_values=true,
- const ::dealii::SparsityPattern *use_this_sparsity=0);
+ const ::dealii::SparsityPattern *use_this_sparsity=nullptr);
//@}
/**
* @name Information on the matrix
// If the matrix structure has not been fixed (i.e., we did not have a
// sparsity pattern), it does not know about the number of columns so we
// must always take this from the additional column space map
- Assert(column_space_map.get() != 0, ExcInternalError());
+ Assert(column_space_map.get() != nullptr, ExcInternalError());
#ifndef DEAL_II_WITH_64BIT_INDICES
return column_space_map->NumGlobalElements();
#else
int ierr;
if ( graph->RowMap().LID(static_cast<TrilinosWrappers::types::int_type>(row)) != -1)
ierr = graph->InsertGlobalIndices (row, n_cols, col_index_ptr);
- else if (nonlocal_graph.get() != 0)
+ else if (nonlocal_graph.get() != nullptr)
{
// this is the case when we have explicitly set the off-processor rows
// and want to create a separate matrix object for them (to retain
void Vector::reinit (const Epetra_Map ¶llel_partitioner,
const dealii::Vector<number> &v)
{
- if (vector.get() == 0 || vector->Map().SameAs(parallel_partitioner) == false)
+ if (vector.get() == nullptr || vector->Map().SameAs(parallel_partitioner) == false)
reinit(parallel_partitioner);
const int size = parallel_partitioner.NumMyElements();
*
* This function is deprecated.
*/
- void print (const char *format = 0) const DEAL_II_DEPRECATED;
+ void print (const char *format = nullptr) const DEAL_II_DEPRECATED;
/**
* Print to a stream. @p precision denotes the desired precision with
VectorBase::reinit (const VectorBase &v,
const bool omit_zeroing_entries)
{
- Assert (vector.get() != 0,
+ Assert (vector.get() != nullptr,
ExcMessage("Vector has not been constructed properly."));
if (omit_zeroing_entries == false ||
vector_partitioner().SameAs(v.vector_partitioner())==false)
vector.reset (new Epetra_FEVector(*v.vector));
- if (v.nonlocal_vector.get() != 0)
+ if (v.nonlocal_vector.get() != nullptr)
nonlocal_vector.reset(new Epetra_MultiVector(v.nonlocal_vector->Map(), 1));
owned_elements = v.owned_elements;
int ierr = vector->PutScalar(s);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
- if (nonlocal_vector.get() != 0)
+ if (nonlocal_vector.get() != nullptr)
{
ierr = nonlocal_vector->PutScalar(0.);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
const TrilinosWrappers::types::int_type local_row = vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(row));
if (local_row != -1)
(*vector)[0][local_row] += values[i];
- else if (nonlocal_vector.get() == 0)
+ else if (nonlocal_vector.get() == nullptr)
{
const int ierr = vector->SumIntoGlobalValues (1,
(const TrilinosWrappers::types::int_type *)(&row),
*
* This function is deprecated.
*/
- void print (const char *format = 0) const DEAL_II_DEPRECATED;
+ void print (const char *format = nullptr) const DEAL_II_DEPRECATED;
/**
* Print to a stream. @p precision denotes the desired precision with which
:
vec_size(0),
max_vec_size(0),
- val(0)
+ val(nullptr)
{
reinit(0);
}
:
vec_size (0),
max_vec_size (0),
- val (0)
+ val (nullptr)
{
// allocate memory. do not initialize it, as we will copy over to it in a
// second
:
vec_size(0),
max_vec_size(0),
- val(0)
+ val(nullptr)
{
reinit (n, false);
}
if (val)
{
deallocate();
- val=0;
+ val=nullptr;
}
}
Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
- val(0)
+ val(nullptr)
{
if (vec_size != 0)
{
Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
- val(0)
+ val(nullptr)
{
if (vec_size != 0)
{
Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
- val(0)
+ val(nullptr)
{
if (vec_size != 0)
{
Subscriptor(),
vec_size(0),
max_vec_size(0),
- val(0)
+ val(nullptr)
{
if (v.size() != 0)
{
Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
- val(0)
+ val(nullptr)
{
if (vec_size != 0)
{
Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
- val(0)
+ val(nullptr)
{
if (vec_size != 0)
{
if (n==0)
{
if (val) deallocate();
- val = 0;
+ val = nullptr;
max_vec_size = vec_size = 0;
thread_loop_partitioner.reset(new parallel::internal::TBBPartitioner());
return;
if (v.vec_size==0)
{
if (val) deallocate();
- val = 0;
+ val = nullptr;
max_vec_size = vec_size = 0;
return;
};
Vector<Number>::allocate()
{
// make sure that we don't create a memory leak
- Assert (val == 0, ExcInternalError());
+ Assert (val == nullptr, ExcInternalError());
// then allocate memory with the proper alignment requirements of 64 bytes
Utilities::System::posix_memalign ((void **)&val, 64, sizeof(Number)*max_vec_size);
Vector<Number>::deallocate()
{
free(val);
- val = 0;
+ val = nullptr;
}
DEAL_II_NAMESPACE_CLOSE
inline
VectorMemory<VectorType>::Pointer::Pointer(VectorMemory<VectorType> &mem)
:
- pool(&mem, typeid(*this).name()), v(0)
+ pool(&mem, typeid(*this).name()), v(nullptr)
{
v = pool->alloc();
}
inline
GrowingVectorMemory<VectorType>::Pool::Pool()
:
- data(0)
+ data(nullptr)
{}
GrowingVectorMemory<VectorType>::Pool::~Pool()
{
// Nothing to do if memory was unused.
- if (data == 0) return;
+ if (data == nullptr) return;
// First, delete all remaining
// vectors. Actually, there should
void
GrowingVectorMemory<VectorType>::Pool::initialize(const size_type size)
{
- if (data == 0)
+ if (data == nullptr)
{
data = new std::vector<entry_type>(size);
std::vector<entry_type> new_data;
- if (pool.data != 0)
+ if (pool.data != nullptr)
{
const typename std::vector<entry_type>::const_iterator
end = pool.data->end();
void print (const T &t,
const char *format)
{
- if (format != 0)
+ if (format != nullptr)
std::printf (format, t);
else
std::printf (" %5.2f", double(t));
void print (const std::complex<T> &t,
const char *format)
{
- if (format != 0)
+ if (format != nullptr)
std::printf (format, t.real(), t.imag());
else
std::printf (" %5.2f+%5.2fi",
if (vec_size >= 4*internal::Vector::minimum_parallel_grain_size &&
MultithreadInfo::n_threads() > 1)
{
- Assert(partitioner.get() != NULL,
+ Assert(partitioner.get() != nullptr,
ExcInternalError("Unexpected initialization of Vector that does "
"not set the TBB partitioner to a usable state."));
std::shared_ptr<tbb::affinity_partitioner> tbb_partitioner =
if (vec_size >= 4*internal::Vector::minimum_parallel_grain_size &&
MultithreadInfo::n_threads() > 1)
{
- Assert(partitioner.get() != NULL,
+ Assert(partitioner.get() != nullptr,
ExcInternalError("Unexpected initialization of Vector that does "
"not set the TBB partitioner to a usable state."));
std::shared_ptr<tbb::affinity_partitioner> tbb_partitioner =
// memory it doesn't own
this->vec_size = 0;
this->max_vec_size = 0;
- this->val = 0;
+ this->val = nullptr;
}
AssertIndexRange (row, row_starts.size()-1);
const unsigned int index = row_starts[row][0];
AssertIndexRange(index, dof_indices.size()+1);
- return dof_indices.empty() ? 0 : &dof_indices[0] + index;
+ return dof_indices.empty() ? nullptr : &dof_indices[0] + index;
}
AssertIndexRange (row, row_starts.size()-1);
const unsigned int index = row_starts[row+1][0];
AssertIndexRange(index, dof_indices.size()+1);
- return dof_indices.empty() ? 0 : &dof_indices[0] + index;
+ return dof_indices.empty() ? nullptr : &dof_indices[0] + index;
}
AssertIndexRange (row, row_starts.size()-1);
const unsigned int index = row_starts[row][1];
AssertIndexRange (index, constraint_indicator.size()+1);
- return constraint_indicator.empty() ? 0 : &constraint_indicator[0] + index;
+ return constraint_indicator.empty() ? nullptr : &constraint_indicator[0] + index;
}
AssertIndexRange (row, row_starts.size()-1);
const unsigned int index = row_starts[row+1][1];
AssertIndexRange (index, constraint_indicator.size()+1);
- return constraint_indicator.empty() ? 0 : &constraint_indicator[0] + index;
+ return constraint_indicator.empty() ? nullptr : &constraint_indicator[0] + index;
}
AssertDimension (row_starts.size(), row_starts_plain_indices.size());
const unsigned int index = row_starts_plain_indices[row];
AssertIndexRange(index, plain_dof_indices.size()+1);
- return plain_dof_indices.empty() ? 0 : &plain_dof_indices[0] + index;
+ return plain_dof_indices.empty() ? nullptr : &plain_dof_indices[0] + index;
}
}
ConstraintValues<double> &constraint_values,
bool &cell_at_boundary)
{
- Assert (vector_partitioner.get() !=0, ExcInternalError());
+ Assert (vector_partitioner.get() !=nullptr, ExcInternalError());
const unsigned int n_mpi_procs = vector_partitioner->n_mpi_processes();
const types::global_dof_index first_owned = vector_partitioner->local_range().first;
const types::global_dof_index last_owned = vector_partitioner->local_range().second;
constraints.get_constraint_entries(current_dof);
// dof is constrained
- if (entries_ptr != 0)
+ if (entries_ptr != nullptr)
{
// in case we want to access plain indices, we need to know
// about the location of constrained indices as well (all the
data (&data_in.get_shape_info
(fe_no_in, quad_no_in, active_fe_index,
active_quad_index)),
- cartesian_data (0),
- jacobian (0),
- J_value (0),
+ cartesian_data (nullptr),
+ jacobian (nullptr),
+ J_value (nullptr),
quadrature_weights (mapping_info->mapping_data_gen[quad_no].
quadrature_weights[active_quad_index].begin()),
- quadrature_points (0),
- jacobian_grad (0),
- jacobian_grad_upper(0),
+ quadrature_points (nullptr),
+ jacobian_grad (nullptr),
+ jacobian_grad_upper(nullptr),
cell (numbers::invalid_unsigned_int),
cell_type (internal::MatrixFreeFunctions::undefined),
cell_data_number (numbers::invalid_unsigned_int),
n_fe_components (n_components_),
active_fe_index (numbers::invalid_unsigned_int),
active_quad_index (numbers::invalid_unsigned_int),
- matrix_info (0),
- dof_info (0),
- mapping_info (0),
+ matrix_info (nullptr),
+ dof_info (nullptr),
+ mapping_info (nullptr),
// select the correct base element from the given FE component
data (new internal::MatrixFreeFunctions::ShapeInfo<Number>(quadrature, fe, fe.component_to_base_index(first_selected_component).first)),
- cartesian_data (0),
- jacobian (0),
- J_value (0),
- quadrature_weights (0),
- quadrature_points (0),
- jacobian_grad (0),
- jacobian_grad_upper(0),
+ cartesian_data (nullptr),
+ jacobian (nullptr),
+ J_value (nullptr),
+ quadrature_weights (nullptr),
+ quadrature_points (nullptr),
+ jacobian_grad (nullptr),
+ jacobian_grad_upper(nullptr),
cell (0),
cell_type (internal::MatrixFreeFunctions::general),
cell_data_number (numbers::invalid_unsigned_int),
fe.component_to_base_index(first_selected_component).first;
set_data_pointers();
- Assert(other == 0 || other->mapped_geometry.get() != 0, ExcInternalError());
- if (other != 0 &&
+ Assert(other == nullptr || other->mapped_geometry.get() != nullptr, ExcInternalError());
+ if (other != nullptr &&
other->mapped_geometry->get_quadrature() == quadrature)
mapped_geometry = other->mapped_geometry;
else
FEEvaluationBase<dim,n_components_,Number>
::FEEvaluationBase (const FEEvaluationBase<dim,n_components_,Number> &other)
:
- scratch_data_array (other.matrix_info == 0 ?
+ scratch_data_array (other.matrix_info == nullptr ?
new AlignedVector<VectorizedArray<Number> >() :
other.matrix_info->acquire_scratch_data()),
quad_no (other.quad_no),
matrix_info (other.matrix_info),
dof_info (other.dof_info),
mapping_info (other.mapping_info),
- data (other.matrix_info == 0 ?
+ data (other.matrix_info == nullptr ?
new internal::MatrixFreeFunctions::ShapeInfo<Number>(*other.data) :
other.data),
- cartesian_data (0),
- jacobian (0),
- J_value (0),
- quadrature_weights (mapping_info != 0 ?
+ cartesian_data (nullptr),
+ jacobian (nullptr),
+ J_value (nullptr),
+ quadrature_weights (mapping_info != nullptr ?
mapping_info->mapping_data_gen[quad_no].
quadrature_weights[active_quad_index].begin()
:
- 0),
- quadrature_points (0),
- jacobian_grad (0),
- jacobian_grad_upper(0),
+ nullptr),
+ quadrature_points (nullptr),
+ jacobian_grad (nullptr),
+ jacobian_grad_upper(nullptr),
cell (numbers::invalid_unsigned_int),
cell_type (internal::MatrixFreeFunctions::general),
cell_data_number (numbers::invalid_unsigned_int),
set_data_pointers();
// Create deep copy of mapped geometry for use in parallel...
- if (other.mapped_geometry.get() != 0)
+ if (other.mapped_geometry.get() != nullptr)
{
mapped_geometry.reset
(new internal::MatrixFreeFunctions::
AssertDimension(first_selected_component, other.first_selected_component);
// release old memory
- if (matrix_info == 0)
+ if (matrix_info == nullptr)
{
delete data;
delete scratch_data_array;
matrix_info = other.matrix_info;
dof_info = other.dof_info;
mapping_info = other.mapping_info;
- if (other.matrix_info == 0)
+ if (other.matrix_info == nullptr)
{
data = new internal::MatrixFreeFunctions::ShapeInfo<Number>(*other.data);
scratch_data_array = new AlignedVector<VectorizedArray<Number> >();
}
set_data_pointers();
- cartesian_data = 0;
- jacobian = 0;
- J_value = 0;
- quadrature_weights = mapping_info != 0 ?
+ cartesian_data = nullptr;
+ jacobian = nullptr;
+ J_value = nullptr;
+ quadrature_weights = mapping_info != nullptr ?
mapping_info->mapping_data_gen[quad_no].
quadrature_weights[active_quad_index].begin()
:
- 0;
- quadrature_points = 0;
- jacobian_grad = 0;
- jacobian_grad_upper = 0;
+ nullptr;
+ quadrature_points = nullptr;
+ jacobian_grad = nullptr;
+ jacobian_grad_upper = nullptr;
cell = numbers::invalid_unsigned_int;
cell_type = internal::MatrixFreeFunctions::general;
cell_data_number = numbers::invalid_unsigned_int;
// Create deep copy of mapped geometry for use in parallel...
- if (other.mapped_geometry.get() != 0)
+ if (other.mapped_geometry.get() != nullptr)
{
mapped_geometry.reset
(new internal::MatrixFreeFunctions::
inline
FEEvaluationBase<dim,n_components_,Number>::~FEEvaluationBase ()
{
- if (matrix_info != 0)
+ if (matrix_info != nullptr)
{
try
{
FEEvaluationBase<dim,n_components_,Number>
::set_data_pointers()
{
- Assert(scratch_data_array != NULL, ExcInternalError());
+ Assert(scratch_data_array != nullptr, ExcInternalError());
const unsigned int tensor_dofs_per_cell =
Utilities::fixed_power<dim>(this->data->fe_degree+1);
void
FEEvaluationBase<dim,n_components_,Number>::reinit (const unsigned int cell_in)
{
- Assert (mapped_geometry == 0,
+ Assert (mapped_geometry == nullptr,
ExcMessage("FEEvaluation was initialized without a matrix-free object."
" Integer indexing is not possible"));
- if (mapped_geometry != 0)
+ if (mapped_geometry != nullptr)
return;
- Assert (dof_info != 0, ExcNotInitialized());
- Assert (mapping_info != 0, ExcNotInitialized());
+ Assert (dof_info != nullptr, ExcNotInitialized());
+ Assert (mapping_info != nullptr, ExcNotInitialized());
AssertIndexRange (cell_in, dof_info->row_starts.size()-1);
AssertDimension (((dof_info->cell_active_fe_index.size() > 0) ?
dof_info->cell_active_fe_index[cell_in] : 0),
FEEvaluationBase<dim,n_components_,Number>
::reinit (const TriaIterator<DoFCellAccessor<DoFHandlerType,level_dof_access> > &cell)
{
- Assert(matrix_info == 0,
+ Assert(matrix_info == nullptr,
ExcMessage("Cannot use initialization from cell iterator if "
"initialized from MatrixFree object. Use variant for "
"on the fly computation with arguments as for FEValues "
"instead"));
- Assert(mapped_geometry.get() != 0, ExcNotInitialized());
+ Assert(mapped_geometry.get() != nullptr, ExcNotInitialized());
mapped_geometry->reinit(static_cast<typename Triangulation<dim>::cell_iterator>(cell));
local_dof_indices.resize(cell->get_fe().dofs_per_cell);
if (level_dof_access)
const internal::MatrixFreeFunctions::ShapeInfo<Number> &
FEEvaluationBase<dim,n_components_,Number>::get_shape_info() const
{
- Assert(data != 0, ExcInternalError());
+ Assert(data != nullptr, ExcInternalError());
return *data;
}
::fill_JxW_values(AlignedVector<VectorizedArray<Number> > &JxW_values) const
{
AssertDimension(JxW_values.size(), data->n_q_points);
- Assert (this->J_value != 0, ExcNotInitialized());
+ Assert (this->J_value != nullptr, ExcNotInitialized());
if (this->cell_type == internal::MatrixFreeFunctions::cartesian ||
this->cell_type == internal::MatrixFreeFunctions::affine)
{
- Assert (this->mapping_info != 0, ExcNotImplemented());
+ Assert (this->mapping_info != nullptr, ExcNotImplemented());
VectorizedArray<Number> J = this->J_value[0];
for (unsigned int q=0; q<this->data->n_q_points; ++q)
JxW_values[q] = J * this->quadrature_weights[q];
VectorizedArray<Number>
FEEvaluationBase<dim,n_components_,Number>::JxW(const unsigned int q_point) const
{
- Assert (this->J_value != 0, ExcNotInitialized());
+ Assert (this->J_value != nullptr, ExcNotInitialized());
if (this->cell_type == internal::MatrixFreeFunctions::cartesian ||
this->cell_type == internal::MatrixFreeFunctions::affine)
{
- Assert (this->mapping_info != 0, ExcInternalError());
+ Assert (this->mapping_info != nullptr, ExcInternalError());
return this->J_value[0] * this->quadrature_weights[q_point];
}
else
// Case 1: No MatrixFree object given, simple case because we do not need to
// process constraints and need not care about vectorization
- if (matrix_info == 0)
+ if (matrix_info == nullptr)
{
Assert (!local_dof_indices.empty(), ExcNotInitialized());
return;
}
- Assert (dof_info != 0, ExcNotInitialized());
+ Assert (dof_info != nullptr, ExcNotInitialized());
Assert (matrix_info->indices_initialized() == true,
ExcNotInitialized());
Assert (cell != numbers::invalid_unsigned_int, ExcNotInitialized());
::read_dof_values_plain (const VectorType *src[])
{
// Case without MatrixFree initialization object
- if (matrix_info == 0)
+ if (matrix_info == nullptr)
{
internal::VectorReader<Number> reader;
read_write_operation (reader, src);
// this is different from the other three operations because we do not use
// constraints here, so this is a separate function.
- Assert (dof_info != 0, ExcNotInitialized());
+ Assert (dof_info != nullptr, ExcNotInitialized());
Assert (matrix_info->indices_initialized() == true,
ExcNotInitialized());
Assert (cell != numbers::invalid_unsigned_int, ExcNotInitialized());
:
BaseClass (mapping, fe, quadrature, update_flags,
first_selected_component,
- static_cast<FEEvaluationBase<dim,1,Number>*>(0)),
+ static_cast<FEEvaluationBase<dim,1,Number>*>(nullptr)),
dofs_per_cell (this->data->dofs_per_cell),
n_q_points (this->data->n_q_points)
{
:
BaseClass (StaticMappingQ1<dim>::mapping, fe, quadrature, update_flags,
first_selected_component,
- static_cast<FEEvaluationBase<dim,1,Number>*>(0)),
+ static_cast<FEEvaluationBase<dim,1,Number>*>(nullptr)),
dofs_per_cell (this->data->dofs_per_cell),
n_q_points (this->data->n_q_points)
{
{
Assert (this->mapping_info->quadrature_points_initialized == true,
ExcNotInitialized());
- Assert (this->quadrature_points != 0, ExcNotInitialized());
+ Assert (this->quadrature_points != nullptr, ExcNotInitialized());
AssertIndexRange (q, n_q_points);
// Cartesian mesh: not all quadrature points are stored, only the
{
Assert (this->dof_values_initialized == true,
internal::ExcAccessToUninitializedField());
- Assert(this->matrix_info != 0 ||
+ Assert(this->matrix_info != nullptr ||
this->mapped_geometry->is_initialized(), ExcNotInitialized());
// Run time selection of algorithm matching the element type. Since some
if (integrate_gradients == true)
Assert (this->gradients_quad_submitted == true,
internal::ExcAccessToUninitializedField());
- Assert(this->matrix_info != 0 ||
+ Assert(this->matrix_info != nullptr ||
this->mapped_geometry->is_initialized(), ExcNotInitialized());
// Run time selection of algorithm matching the element type. Since some
const unsigned int fe_index = active_fe_index.size() > 0 ?
active_fe_index[cell] : 0;
const unsigned int n_q_points = current_data.n_q_points[fe_index];
- if (fe_values[fe_index].get() == 0)
+ if (fe_values[fe_index].get() == nullptr)
fe_values[fe_index].reset
(new dealii::FEValues<dim> (mapping, dummy_fe,
current_data.quadrature[fe_index],
MatrixFree<dim,Number>::constraint_pool_begin (const unsigned int row) const
{
AssertIndexRange (row, constraint_pool_row_index.size()-1);
- return constraint_pool_data.empty() ? 0 :
+ return constraint_pool_data.empty() ? nullptr :
&constraint_pool_data[0] + constraint_pool_row_index[row];
}
MatrixFree<dim,Number>::constraint_pool_end (const unsigned int row) const
{
AssertIndexRange (row, constraint_pool_row_index.size()-1);
- return constraint_pool_data.empty() ? 0 :
+ return constraint_pool_data.empty() ? nullptr :
&constraint_pool_data[0] + constraint_pool_row_index[row+1];
}
AssertIndexRange (vector_number, irreg_filled);
#endif
- const DoFHandler<dim> *dofh = 0;
+ const DoFHandler<dim> *dofh = nullptr;
if (dof_handlers.active_dof_handler == DoFHandlers::usual)
{
AssertDimension (dof_handlers.dof_handler.size(),
const internal::MatrixFreeFunctions::TaskInfo &task_info_in,
const bool is_blocked_in)
:
- dummy (NULL),
+ dummy ((nullptr)),
worker (worker_in),
partition (partition_in),
task_info (task_info_in),
worker(cell_range);
if (is_blocked==true)
dummy->spawn (*dummy);
- return NULL;
+ return (nullptr);
}
tbb::empty_task *dummy;
const internal::MatrixFreeFunctions::TaskInfo &task_info_in,
const bool is_blocked_in = false)
:
- dummy (NULL),
+ dummy ((nullptr)),
function (function_in),
partition (partition_in),
task_info (task_info_in),
root->destroy(*root);
if (is_blocked==true)
dummy->spawn (*dummy);
- return NULL;
+ return (nullptr);
}
tbb::empty_task *dummy;
const internal::MatrixFreeFunctions::TaskInfo &task_info_in,
const bool is_blocked_in)
:
- dummy (NULL),
+ dummy ((nullptr)),
worker (worker_in),
partition (partition_in),
task_info (task_info_in),
CellWork<Worker> (worker,task_info));
if (is_blocked==true)
dummy->spawn (*dummy);
- return NULL;
+ return (nullptr);
}
tbb::empty_task *dummy;
tbb::task *execute ()
{
internal::update_ghost_values_finish(src);
- return 0;
+ return nullptr;
}
private:
tbb::task *execute ()
{
internal::compress_start(dst);
- return 0;
+ return nullptr;
}
private:
const parallel::Triangulation<dim> *dist_tria =
dynamic_cast<const parallel::Triangulation<dim>*>
(&(dof_handler[0]->get_triangulation()));
- size_info.communicator = dist_tria != 0 ?
+ size_info.communicator = dist_tria != nullptr ?
dist_tria->get_communicator() :
MPI_COMM_SELF;
size_info.my_pid =
const parallel::Triangulation<dim> *dist_tria =
dynamic_cast<const parallel::Triangulation<dim>*>
(&(dof_handler[0]->get_triangulation()));
- size_info.communicator = dist_tria != 0 ?
+ size_info.communicator = dist_tria != nullptr ?
dist_tria->get_communicator() :
MPI_COMM_SELF;
size_info.my_pid =
return false;
// then check of the base element is supported
- if (dynamic_cast<const FE_Poly<TensorProductPolynomials<dim>,dim,spacedim>*>(fe_ptr)!=0)
+ if (dynamic_cast<const FE_Poly<TensorProductPolynomials<dim>,dim,spacedim>*>(fe_ptr)!=nullptr)
return true;
if (dynamic_cast<const FE_Poly<TensorProductPolynomials<dim,
- Polynomials::PiecewisePolynomial<double> >,dim,spacedim>*>(fe_ptr)!=0)
+ Polynomials::PiecewisePolynomial<double> >,dim,spacedim>*>(fe_ptr)!=nullptr)
return true;
- if (dynamic_cast<const FE_DGP<dim, spacedim>*>(fe_ptr)!=0)
+ if (dynamic_cast<const FE_DGP<dim, spacedim>*>(fe_ptr)!=nullptr)
return true;
- if (dynamic_cast<const FE_Q_DG0<dim, spacedim>*>(fe_ptr)!=0)
+ if (dynamic_cast<const FE_Q_DG0<dim, spacedim>*>(fe_ptr)!=nullptr)
return true;
// if the base element is not in the above list it is not supported
// For serial Triangulations always take all cells
const unsigned int subdomain_id
= (dynamic_cast<const parallel::Triangulation<dim> *>
- (&dof_handler[0]->get_triangulation())!=0)
+ (&dof_handler[0]->get_triangulation())!=nullptr)
? my_pid : numbers::invalid_subdomain_id;
for ( ; cell != end_cell; ++cell)
internal::resolve_cell (cell, cell_level_index, subdomain_id);
// For serial Triangulations always take all cells
const unsigned int subdomain_id
= (dynamic_cast<const parallel::Triangulation<dim> *>
- (&dof_handler[0]->get_triangulation())!=0)
+ (&dof_handler[0]->get_triangulation())!=nullptr)
? my_pid : numbers::invalid_subdomain_id;
for ( ; cell != end_cell; ++cell)
internal::resolve_cell (cell, cell_level_index,
constraint_pool_row_index.resize(1, 0);
for (unsigned int i=0; i<constraints.size(); ++i)
{
- Assert(constraints[i] != 0, ExcInternalError());
+ Assert(constraints[i] != nullptr, ExcInternalError());
constraint_pool_data.insert(constraint_pool_data.end(),
constraints[i]->begin(),
constraints[i]->end());
:
Subscriptor(),
have_interface_matrices(false)
- {
- // boost-1.62.0 doesn't allow initializing a shared_ptr
- // with NULL. Make sure the default constructor does that.
- Assert(data.get() == NULL, ExcInternalError());
- }
+ {}
typename Base<dim,VectorType>::size_type
Base<dim,VectorType>::m () const
{
- Assert(data.get() != NULL,
+ Assert(data.get() != nullptr,
ExcNotInitialized());
typename Base<dim, VectorType>::size_type total_size = 0;
for (unsigned int i=0; i<selected_rows.size(); ++i)
typename Base<dim,VectorType>::size_type
Base<dim,VectorType>::n () const
{
- Assert(data.get() != NULL,
+ Assert(data.get() != nullptr,
ExcNotInitialized());
typename Base<dim, VectorType>::size_type total_size = 0;
for (unsigned int i=0; i<selected_columns.size(); ++i)
{
(void) col;
Assert (row == col, ExcNotImplemented());
- Assert (inverse_diagonal_entries.get() != NULL &&
+ Assert (inverse_diagonal_entries.get() !=nullptr&&
inverse_diagonal_entries->m() > 0, ExcNotInitialized());
return 1.0/(*inverse_diagonal_entries)(row,row);
}
void
Base<dim,VectorType>::initialize_dof_vector (VectorType &vec) const
{
- Assert(data.get() != NULL,
+ Assert(data.get() != nullptr,
ExcNotInitialized());
AssertDimension(n_blocks(vec), selected_rows.size());
for (unsigned int i = 0; i < n_blocks(vec); ++i)
std::size_t
Base<dim,VectorType>::memory_consumption () const
{
- return inverse_diagonal_entries.get() != NULL ? inverse_diagonal_entries->memory_consumption() : sizeof(*this);
+ return inverse_diagonal_entries.get() !=nullptr? inverse_diagonal_entries->memory_consumption() : sizeof(*this);
}
const std::shared_ptr<DiagonalMatrix<VectorType> > &
Base<dim,VectorType>::get_matrix_diagonal_inverse() const
{
- Assert(inverse_diagonal_entries.get() != NULL &&
+ Assert(inverse_diagonal_entries.get() !=nullptr&&
inverse_diagonal_entries->m() > 0, ExcNotInitialized());
return inverse_diagonal_entries;
}
MGInterfaceOperator<OperatorType>::MGInterfaceOperator ()
:
Subscriptor(),
- mf_base_operator(NULL)
+ mf_base_operator((nullptr))
{
}
void
MGInterfaceOperator<OperatorType>::clear ()
{
- mf_base_operator = NULL;
+ mf_base_operator = (nullptr);
}
"operator");
#endif
- Assert(mf_base_operator != NULL,
+ Assert(mf_base_operator != nullptr,
ExcNotInitialized());
mf_base_operator->vmult_interface_down(dst, src);
"operator");
#endif
- Assert(mf_base_operator != NULL,
+ Assert(mf_base_operator != nullptr,
ExcNotInitialized());
mf_base_operator->vmult_interface_up(dst, src);
compute_diagonal()
{
typedef typename Base<dim,VectorType>::value_type Number;
- Assert((Base<dim, VectorType>::data.get() != NULL), ExcNotInitialized());
+ Assert((Base<dim, VectorType>::data.get() != nullptr), ExcNotInitialized());
this->inverse_diagonal_entries.
reset(new DiagonalMatrix<VectorType>());
compute_diagonal()
{
typedef typename Base<dim,VectorType>::value_type Number;
- Assert((Base<dim, VectorType>::data.get() != NULL), ExcNotInitialized());
+ Assert((Base<dim, VectorType>::data.get() != nullptr), ExcNotInitialized());
unsigned int dummy = 0;
this->inverse_diagonal_entries.
const FE_Q_DG0<dim> *fe_q_dg0 = dynamic_cast<const FE_Q_DG0<dim>*>(fe);
element_type = tensor_general;
- if (fe_poly != 0)
+ if (fe_poly != nullptr)
scalar_lexicographic = fe_poly->get_poly_space_numbering_inverse();
- else if (fe_poly_piece != 0)
+ else if (fe_poly_piece != nullptr)
scalar_lexicographic = fe_poly_piece->get_poly_space_numbering_inverse();
- else if (fe_dgp != 0)
+ else if (fe_dgp != nullptr)
{
scalar_lexicographic.resize(fe_dgp->dofs_per_cell);
for (unsigned int i=0; i<fe_dgp->dofs_per_cell; ++i)
scalar_lexicographic[i] = i;
element_type = truncated_tensor;
}
- else if (fe_q_dg0 != 0)
+ else if (fe_q_dg0 != nullptr)
{
scalar_lexicographic = fe_q_dg0->get_poly_space_numbering_inverse();
element_type = tensor_symmetric_plus_dg0;
const std::vector<types::global_dof_index> &dof1,
const std::vector<types::global_dof_index> &dof2)
{
- if (constraints == 0)
+ if (constraints == nullptr)
{
for (unsigned int j=0; j<local.n_rows(); ++j)
for (unsigned int k=0; k<local.n_cols(); ++k)
DoFInfo<dim,spacedim,number>::get_indices(const DHCellIterator &c)
{
indices.resize(c->get_fe().dofs_per_cell);
- if (block_info == 0 || block_info->local().size() == 0)
+ if (block_info == nullptr || block_info->local().size() == 0)
c->get_active_or_mg_dof_indices(indices);
else
{
const Mapping<dim,spacedim> &mapping,
const Quadrature<FEVALUES::integral_dimension> &quadrature,
const UpdateFlags flags,
- const BlockInfo *local_block_info = 0);
+ const BlockInfo *local_block_info = nullptr);
/**
* Initialize the data vector and cache the selector.
*/
void initialize(const FiniteElement<dim, spacedim> &el,
const Mapping<dim, spacedim> &mapping,
- const BlockInfo *block_info = 0);
+ const BlockInfo *block_info = nullptr);
/**
* Initialize the IntegrationInfo objects contained.
const Mapping<dim, spacedim> &mapping,
const AnyData &data,
const VectorType &dummy,
- const BlockInfo *block_info = 0);
+ const BlockInfo *block_info = nullptr);
/**
* Initialize the IntegrationInfo objects contained.
*
const Mapping<dim, spacedim> &mapping,
const AnyData &data,
const MGLevelObject<VectorType> &dummy,
- const BlockInfo *block_info = 0);
+ const BlockInfo *block_info = nullptr);
/**
* @name FEValues setup
*/
const FEFaceValues<dim,sdim> *pf = dynamic_cast<const FEFaceValues<dim,sdim>*>(&p);
const FESubfaceValues<dim,sdim> *ps = dynamic_cast<const FESubfaceValues<dim,sdim>*>(&p);
- if (pc != 0)
+ if (pc != nullptr)
fevalv[i] = std::shared_ptr<FEValuesBase<dim,sdim> > (
new FEValues<dim,sdim> (pc->get_mapping(), pc->get_fe(),
pc->get_quadrature(), pc->get_update_flags()));
- else if (pf != 0)
+ else if (pf != nullptr)
fevalv[i] = std::shared_ptr<FEValuesBase<dim,sdim> > (
new FEFaceValues<dim,sdim> (pf->get_mapping(), pf->get_fe(), pf->get_quadrature(), pf->get_update_flags()));
- else if (ps != 0)
+ else if (ps != nullptr)
fevalv[i] = std::shared_ptr<FEValuesBase<dim,sdim> > (
new FESubfaceValues<dim,sdim> (ps->get_mapping(), ps->get_fe(), ps->get_quadrature(), ps->get_update_flags()));
else
const BlockInfo *block_info)
{
fe_pointer = ⪙
- if (block_info == 0 || block_info->local().size() == 0)
+ if (block_info == nullptr || block_info->local().size() == 0)
{
fevalv.resize(1);
fevalv[0] = std::shared_ptr<FEValuesBase<dim,sdim> > (
inline const FiniteElement<dim, spacedim> &
IntegrationInfo<dim,spacedim>::finite_element() const
{
- Assert (fe_pointer !=0, ExcNotInitialized());
+ Assert (fe_pointer !=nullptr, ExcNotInitialized());
return *fe_pointer;
}
}
}
- const bool split_fevalues = info.block_info != 0;
+ const bool split_fevalues = info.block_info != nullptr;
if (!global_data->empty())
fill_local_data(info, split_fevalues);
}
dof_info.cell.reinit(cell);
dof_info.cell_valid = true;
- const bool integrate_cell = (cell_worker != 0);
- const bool integrate_boundary = (boundary_worker != 0);
- const bool integrate_interior_face = (face_worker != 0);
+ const bool integrate_cell = (cell_worker != nullptr);
+ const bool integrate_boundary = (boundary_worker != nullptr);
+ const bool integrate_interior_face = (face_worker != nullptr);
if (integrate_cell)
info.cell.reinit(dof_info.cell);
inline void
GnuplotPatch::write(const T &d) const
{
- if (os == 0)
+ if (os == nullptr)
deallog << d;
else
(*os) << d;
inline void
GnuplotPatch::write_endl() const
{
- if (os == 0)
+ if (os == nullptr)
deallog << std::endl;
else
(*os) << std::endl;
inline
GnuplotPatch::GnuplotPatch()
:
- os(0)
+ os(nullptr)
{}
info.indices:
info.indices_by_block[i];
- if (constraints !=0)
+ if (constraints !=nullptr)
constraints->distribute_local_to_global(info.vector(k).block(i), ldi, *v);
else
v->add(ldi, info.vector(k).block(i));
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
- if (constraints == 0)
+ if (constraints == nullptr)
{
for (unsigned int j=0; j<i1.size(); ++j)
for (unsigned int k=0; k<i2.size(); ++k)
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
- if (mg_constrained_dofs == 0)
+ if (mg_constrained_dofs == nullptr)
{
for (unsigned int j=0; j<i1.size(); ++j)
for (unsigned int k=0; k<i2.size(); ++k)
AssertDimension(M.n(), i1.size());
AssertDimension(M.m(), i2.size());
- if (mg_constrained_dofs == 0)
+ if (mg_constrained_dofs == nullptr)
{
for (unsigned int j=0; j<i1.size(); ++j)
for (unsigned int k=0; k<i2.size(); ++k)
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
- if (mg_constrained_dofs == 0)
+ if (mg_constrained_dofs == nullptr)
{
for (unsigned int j=0; j<i1.size(); ++j)
for (unsigned int k=0; k<i2.size(); ++k)
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
- Assert(mg_constrained_dofs != 0, ExcInternalError());
+ Assert(mg_constrained_dofs != nullptr, ExcInternalError());
for (unsigned int j=0; j<i1.size(); ++j)
for (unsigned int k=0; k<i2.size(); ++k)
{
AssertDimension(M.n(), i1.size());
AssertDimension(M.m(), i2.size());
- Assert(mg_constrained_dofs != 0, ExcInternalError());
+ Assert(mg_constrained_dofs != nullptr, ExcInternalError());
for (unsigned int j=0; j<i1.size(); ++j)
for (unsigned int k=0; k<i2.size(); ++k)
{
assemble((*matrix)[level], info.matrix(0,false).matrix,
info.indices, info.indices, level);
- if (mg_constrained_dofs != 0)
+ if (mg_constrained_dofs != nullptr)
{
assemble_in((*interface_in)[level], info.matrix(0,false).matrix,
info.indices, info.indices, level);
assemble((*matrix)[level], info.matrix(k,false).matrix,
info.indices_by_block[row], info.indices_by_block[column], level);
- if (mg_constrained_dofs != 0)
+ if (mg_constrained_dofs != nullptr)
{
assemble_in((*interface_in)[level], info.matrix(k,false).matrix,
info.indices_by_block[row], info.indices_by_block[column], level);
AnyData residuals = ResidualSimple<VectorType>::residuals;
VectorType *v = residuals.entry<VectorType *>(index);
- if (ResidualSimple<VectorType>::constraints == 0)
+ if (ResidualSimple<VectorType>::constraints == nullptr)
{
for (unsigned int i=0; i<indices.size(); ++i)
(*v)(indices[i]) += vector(i);
AnyData residuals = ResidualSimple<VectorType>::residuals;
VectorType *v = residuals.entry<VectorType *>(index);
- if (ResidualSimple<VectorType>::constraints == 0)
+ if (ResidualSimple<VectorType>::constraints == nullptr)
{
for (unsigned int j=0; j<i1.size(); ++j)
for (unsigned int k=0; k<i2.size(); ++k)
max_level=matrices.max_level();
for (; i<=max_level; ++i)
{
- smoothers[i] = 0;
- matrices[i] = 0;
+ smoothers[i] = nullptr;
+ matrices[i] = nullptr;
}
}
/**
* Constructor, taking the coarse grid matrix.
*/
- MGCoarseGridHouseholder (const FullMatrix<number> *A = 0);
+ MGCoarseGridHouseholder (const FullMatrix<number> *A = nullptr);
/**
* Initialize for a new matrix.
/* ------------------ Functions for MGCoarseGridApplySmoother -----------*/
template<class VectorType>
MGCoarseGridApplySmoother<VectorType>::MGCoarseGridApplySmoother ()
- : coarse_smooth(NULL)
+ : coarse_smooth((nullptr))
{
}
template<class VectorType>
MGCoarseGridApplySmoother<VectorType>::MGCoarseGridApplySmoother (const MGSmootherBase<VectorType> &coarse_smooth)
- : coarse_smooth(NULL)
+ : coarse_smooth((nullptr))
{
initialize(coarse_smooth);
}
MGCoarseGridLACIteration<SolverType, VectorType>
::clear()
{
- solver = 0;
+ solver = nullptr;
if (matrix)
delete matrix;
- matrix = 0;
+ matrix = nullptr;
if (precondition)
delete precondition;
- precondition = 0;
+ precondition = nullptr;
}
VectorType &dst,
const VectorType &src) const
{
- Assert(solver!=0, ExcNotInitialized());
- Assert(matrix!=0, ExcNotInitialized());
- Assert(precondition!=0, ExcNotInitialized());
+ Assert(solver!=nullptr, ExcNotInitialized());
+ Assert(matrix!=nullptr, ExcNotInitialized());
+ Assert(precondition!=nullptr, ExcNotInitialized());
solver->solve(*matrix, dst, src, *precondition);
}
VectorType &dst,
const VectorType &src) const
{
- Assert(solver!=0, ExcNotInitialized());
- Assert(matrix!=0, ExcNotInitialized());
- Assert(preconditioner!=0, ExcNotInitialized());
+ Assert(solver!=nullptr, ExcNotInitialized());
+ Assert(matrix!=nullptr, ExcNotInitialized());
+ Assert(preconditioner!=nullptr, ExcNotInitialized());
solver->solve(*matrix, dst, src, *preconditioner);
}
MGCoarseGridHouseholder<number, VectorType>::MGCoarseGridHouseholder
(const FullMatrix<number> *A)
{
- if (A != 0) householder.initialize(*A);
+ if (A != nullptr) householder.initialize(*A);
}
unsigned int i=matrices.min_level(),
max_level=matrices.max_level();
for (; i<=max_level; ++i)
- matrices[i]=0;
+ matrices[i]=nullptr;
}
unsigned int i=matrices.min_level(),
max_level=matrices.max_level();
for (; i<=max_level; ++i)
- matrices[i]=0;
+ matrices[i]=nullptr;
}
{
if (v[level].size() != mg_dof.locally_owned_mg_dofs(level).size() ||
v[level].local_size() != mg_dof.locally_owned_mg_dofs(level).n_elements())
- v[level].reinit(mg_dof.locally_owned_mg_dofs(level), tria != 0 ?
+ v[level].reinit(mg_dof.locally_owned_mg_dofs(level), tria != nullptr ?
tria->get_communicator() : MPI_COMM_SELF);
else
v[level] = 0.;
const dealii::parallel::distributed::Triangulation<dim,spacedim> *tria =
(dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&mg_dof.get_triangulation()));
- AssertThrow(tria!=NULL, ExcMessage("multigrid with Trilinos vectors only works with distributed Triangulation!"));
+ AssertThrow(tria!=nullptr, ExcMessage("multigrid with Trilinos vectors only works with distributed Triangulation!"));
#ifdef DEAL_II_WITH_P4EST
for (unsigned int level=v.min_level();
dst = 0;
do_copy_from_mg (mg_dof_handler,
dst.block(target_component[selected_component]), src);
- if (constraints != 0)
+ if (constraints != nullptr)
constraints->condense(dst);
}
{
dst = 0;
do_copy_from_mg (mg_dof_handler, dst, src);
- if (constraints != 0)
+ if (constraints != nullptr)
{
//If we were given constraints
//apply them to the dst that goes
transfer(&transfer, typeid(*this).name()),
pre_smooth(&pre_smooth, typeid(*this).name()),
post_smooth(&post_smooth, typeid(*this).name()),
- edge_down(0, typeid(*this).name()),
- edge_up(0, typeid(*this).name()),
+ edge_down(nullptr, typeid(*this).name()),
+ edge_up(nullptr, typeid(*this).name()),
debug(0)
{
const unsigned int dof_handler_max_level
transfer(&transfer, typeid(*this).name()),
pre_smooth(&pre_smooth, typeid(*this).name()),
post_smooth(&post_smooth, typeid(*this).name()),
- edge_out(0, typeid(*this).name()),
- edge_in(0, typeid(*this).name()),
- edge_down(0, typeid(*this).name()),
- edge_up(0, typeid(*this).name()),
+ edge_out(nullptr, typeid(*this).name()),
+ edge_in(nullptr, typeid(*this).name()),
+ edge_down(nullptr, typeid(*this).name()),
+ edge_up(nullptr, typeid(*this).name()),
debug(0)
{
if (max_level == numbers::invalid_unsigned_int)
// so it should be a safe bet to use it to query MPI communicator:
const Triangulation<dim> &tria = dof_handler->get_triangulation();
const parallel::distributed::Triangulation<dim> *ptria = dynamic_cast<const parallel::distributed::Triangulation<dim> *>(&tria);
- Assert (ptria != NULL, ExcInternalError());
+ Assert (ptria != nullptr, ExcInternalError());
return ptria->get_communicator ();
}
if (debug>1)
deallog << "Residual on level " << level << std::endl;
matrix->vmult(level, t[level], solution[level]);
- if (edge_out != 0)
+ if (edge_out != nullptr)
{
edge_out->vmult_add(level, t[level], solution[level]);
if (debug>2)
// Get the defect on the next coarser level as part of the (DG) edge matrix
// and then the main part by the restriction of the transfer
- if (edge_down != 0)
+ if (edge_down != nullptr)
{
edge_down->vmult(level, t[level-1], solution[level]);
defect[level-1] -= t[level-1];
solution[level] += t[level];
// get in contribution from edge matrices to the defect
- if (edge_in != 0)
+ if (edge_in != nullptr)
{
edge_in->Tvmult(level, t[level], solution[level]);
defect[level] -= t[level];
}
- if (edge_up != 0)
+ if (edge_up != nullptr)
{
edge_up->Tvmult(level, t[level], solution[level-1]);
defect[level] -= t[level];
if (debug>1)
deallog << cychar << "-cycle residual level " << level << std::endl;
matrix->vmult(level, t[level], solution[level]);
- if (edge_out != 0)
+ if (edge_out != nullptr)
edge_out->vmult_add(level, t[level], solution[level]);
t[level].sadd(-1.0, 1.0, defect2[level]);
// Get the defect on the next coarser level as part of the (DG) edge matrix
// and then the main part by the restriction of the transfer
- if (edge_down != 0)
+ if (edge_down != nullptr)
edge_down->vmult(level, defect2[level-1], solution[level]);
else
defect2[level-1] = 0;
solution[level] += t[level];
// get in contribution from edge matrices to the defect
- if (edge_in != 0)
+ if (edge_in != nullptr)
{
edge_in->Tvmult(level, t[level], solution[level]);
defect2[level] -= t[level];
}
- if (edge_up != 0)
+ if (edge_up != nullptr)
{
edge_up->Tvmult(level, t[level], solution[level-1]);
defect2[level] -= t[level];
ExcMessage ("You are trying to access the cell associated with a "
"DataPostprocessorInputs::Scalar object for which no cell has "
"been set."));
- Assert(boost::any_cast<typename DoFHandlerType::cell_iterator>(&cell) != 0,
+ Assert(boost::any_cast<typename DoFHandlerType::cell_iterator>(&cell) != nullptr,
ExcMessage ("You are trying to access the cell associated with a "
"DataPostprocessorInputs::Scalar with a DoFHandler type that "
"is different from the type with which it has been set. For "
DoFOutputOperator<VectorType, dim, spacedim>::operator<<(
const AnyData &data)
{
- Assert ((dof!=0), ExcNotInitialized());
+ Assert ((dof!=nullptr), ExcNotInitialized());
out.attach_dof_handler (*dof);
for (unsigned int i=0; i<data.size(); ++i)
{
const VectorType *p = data.try_read_ptr<VectorType>(i);
- if (p!=0)
+ if (p!=nullptr)
{
out.add_data_vector (*p, data.name(i));
}
const InputVector &solution,
Vector<float> &error,
const ComponentMask &component_mask = ComponentMask(),
- const Function<spacedim> *coefficients = 0,
+ const Function<spacedim> *coefficients = nullptr,
const unsigned int n_threads = numbers::invalid_unsigned_int,
const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
const types::material_id material_id = numbers::invalid_material_id,
const InputVector &solution,
Vector<float> &error,
const ComponentMask &component_mask = ComponentMask(),
- const Function<spacedim> *coefficients = 0,
+ const Function<spacedim> *coefficients = nullptr,
const unsigned int n_threads = numbers::invalid_unsigned_int,
const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
const types::material_id material_id = numbers::invalid_material_id,
const InputVector &solution,
Vector<float> &error,
const ComponentMask &component_mask = ComponentMask(),
- const Function<spacedim> *coefficients = 0,
+ const Function<spacedim> *coefficients = nullptr,
const unsigned int n_threads = numbers::invalid_unsigned_int,
const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
const types::material_id material_id = numbers::invalid_material_id,
const std::vector<const InputVector *> &solutions,
std::vector<Vector<float>*> &errors,
const ComponentMask &component_mask = ComponentMask(),
- const Function<spacedim> *coefficients = 0,
+ const Function<spacedim> *coefficients = nullptr,
const unsigned int n_threads = numbers::invalid_unsigned_int,
const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
const types::material_id material_id = numbers::invalid_material_id,
const InputVector &solution,
Vector<float> &error,
const ComponentMask &component_mask = ComponentMask(),
- const Function<spacedim> *coefficients = 0,
+ const Function<spacedim> *coefficient = nullptr,
const unsigned int n_threads = numbers::invalid_unsigned_int,
const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
const types::material_id material_id = numbers::invalid_material_id);
const InputVector &solution,
Vector<float> &error,
const ComponentMask &component_mask = ComponentMask(),
- const Function<spacedim> *coefficients = 0,
+ const Function<spacedim> *coefficients = nullptr,
const unsigned int n_threads = numbers::invalid_unsigned_int,
const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
const types::material_id material_id = numbers::invalid_material_id);
// if a coefficient was given: use that to scale the jump in the
// gradient
- if (parallel_data.coefficients != 0)
+ if (parallel_data.coefficients != nullptr)
{
// scalar coefficient
if (parallel_data.coefficients->n_components == 1)
#ifdef DEAL_II_WITH_P4EST
if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof_handler.get_triangulation())
- != 0)
+ != nullptr)
Assert ((subdomain_id_ == numbers::invalid_subdomain_id)
||
(subdomain_id_ ==
const types::subdomain_id subdomain_id
= ((dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof_handler.get_triangulation())
- != 0)
+ != nullptr)
?
dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>&>
(dof_handler.get_triangulation()).locally_owned_subdomain()
Assert (component_mask.n_selected_components(n_components) > 0,
ExcInvalidComponentMask());
- Assert ((coefficients == 0) ||
+ Assert ((coefficients == nullptr) ||
(coefficients->n_components == n_components) ||
(coefficients->n_components == 1),
ExcInvalidCoefficient());
parallel_data (dof_handler.get_fe(),
face_quadratures,
mapping_collection,
- (!neumann_bc.empty() || (coefficients != 0)),
+ (!neumann_bc.empty() || (coefficients != nullptr)),
solutions.size(),
subdomain_id,
material_id,
const FiniteElement<dim,spacedim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components();
- Assert(data.rhs_function == 0 ||
+ Assert(data.rhs_function == nullptr ||
data.rhs_function->n_components==1 ||
data.rhs_function->n_components==n_components,
::dealii::MatrixCreator::ExcComponentMismatch());
- Assert(data.coefficient == 0 ||
+ Assert(data.coefficient == nullptr ||
data.coefficient->n_components==1 ||
data.coefficient->n_components==n_components,
::dealii::MatrixCreator::ExcComponentMismatch());
copy_data.dof_indices.resize (dofs_per_cell);
cell->get_dof_indices (copy_data.dof_indices);
- const bool use_rhs_function = data.rhs_function != 0;
+ const bool use_rhs_function = data.rhs_function != nullptr;
if (use_rhs_function)
{
if (data.rhs_function->n_components==1)
}
}
- const bool use_coefficient = data.coefficient != 0;
+ const bool use_coefficient = data.coefficient != nullptr;
if (use_coefficient)
{
if (data.coefficient->n_components==1)
const FiniteElement<dim,spacedim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components();
- Assert(data.rhs_function == 0 ||
+ Assert(data.rhs_function == nullptr ||
data.rhs_function->n_components==1 ||
data.rhs_function->n_components==n_components,
::dealii::MatrixCreator::ExcComponentMismatch());
- Assert(data.coefficient == 0 ||
+ Assert(data.coefficient == nullptr ||
data.coefficient->n_components==1 ||
data.coefficient->n_components==n_components,
::dealii::MatrixCreator::ExcComponentMismatch());
cell->get_dof_indices (copy_data.dof_indices);
- const bool use_rhs_function = data.rhs_function != 0;
+ const bool use_rhs_function = data.rhs_function != nullptr;
if (use_rhs_function)
{
if (data.rhs_function->n_components==1)
}
}
- const bool use_coefficient = data.coefficient != 0;
+ const bool use_coefficient = data.coefficient != nullptr;
if (use_coefficient)
{
if (data.coefficient->n_components==1)
ExcInternalError());
Assert (data.cell_matrix.n() == dofs_per_cell,
ExcInternalError());
- Assert ((right_hand_side == 0)
+ Assert ((right_hand_side == nullptr)
||
(data.cell_rhs.size() == dofs_per_cell),
ExcInternalError());
- if (right_hand_side != 0)
+ if (right_hand_side != nullptr)
data.constraints->distribute_local_to_global(data.cell_matrix,
data.cell_rhs,
data.dof_indices,
MatrixCreator::internal::AssemblerData::Scratch<dim, spacedim,number>
assembler_data (fe_collection,
update_values | update_JxW_values |
- (coefficient != 0 ? update_quadrature_points : UpdateFlags(0)),
- coefficient, /*rhs_function=*/0,
+ (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)),
+ coefficient, /*rhs_function=*/nullptr,
q_collection, mapping_collection);
MatrixCreator::internal::AssemblerData::CopyData<number> copy_data;
&MatrixCreator::internal::mass_assembler<dim, spacedim, typename DoFHandler<dim,spacedim>::active_cell_iterator,number>,
std::bind (&MatrixCreator::internal::
copy_local_to_global<number,SparseMatrix<number>, Vector<number> >,
- std::placeholders::_1, &matrix, (Vector<number> *)0),
+ std::placeholders::_1, &matrix, (Vector<number> *)nullptr),
assembler_data,
copy_data);
}
MatrixCreator::internal::AssemblerData::Scratch<dim, spacedim,number>
assembler_data (dof.get_fe(),
update_values | update_JxW_values |
- (coefficient != 0 ? update_quadrature_points : UpdateFlags(0)),
- coefficient, /*rhs_function=*/0,
+ (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)),
+ coefficient, /*rhs_function=*/nullptr,
q, mapping);
MatrixCreator::internal::AssemblerData::CopyData<number> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
&MatrixCreator::internal::mass_assembler<dim, spacedim, typename hp::DoFHandler<dim,spacedim>::active_cell_iterator,number>,
std::bind (&MatrixCreator::internal::
copy_local_to_global<number,SparseMatrix<number>, Vector<number> >,
- std::placeholders::_1, &matrix, (Vector<number> *)0),
+ std::placeholders::_1, &matrix, (Vector<number> *)nullptr),
assembler_data,
copy_data);
}
std::vector<number> coefficient_values (fe_values.n_quadrature_points, 1.);
std::vector<Vector<number> > coefficient_vector_values (fe_values.n_quadrature_points,
Vector<number>(n_components));
- const bool coefficient_is_vector = (coefficient != 0 && coefficient->n_components != 1)
+ const bool coefficient_is_vector = (coefficient != nullptr && coefficient->n_components != 1)
? true : false;
std::vector<number> rhs_values_scalar (fe_values.n_quadrature_points);
// If a scalar function is given, update the
// values, if not, use the default one set in the
// constructor above
- if (coefficient != 0)
+ if (coefficient != nullptr)
coefficient->value_list (fe_values.get_quadrature_points(),
coefficient_values);
// Copy scalar values into vector
boundary_functions.find(cell->face(face)->boundary_id())
->second->value_list (fe_values.get_quadrature_points(), rhs_values_scalar);
- if (coefficient != 0)
+ if (coefficient != nullptr)
coefficient->value_list (fe_values.get_quadrature_points(),
coefficient_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
Assert (boundary_functions.size() != 0, ExcInternalError());
Assert (dof_to_boundary_mapping.size() == dof.n_dofs(),
ExcInternalError());
- Assert (coefficient ==0 ||
+ Assert (coefficient ==nullptr ||
coefficient->n_components==1 ||
coefficient->n_components==n_components, ExcComponentMismatch());
->second->vector_value_list (fe_values.get_quadrature_points(),
rhs_values_system);
- if (coefficient != 0)
+ if (coefficient != nullptr)
{
if (coefficient->n_components==1)
{
boundary_functions.find(cell->face(face)->boundary_id())
->second->value_list (fe_values.get_quadrature_points(), rhs_values_scalar);
- if (coefficient != 0)
+ if (coefficient != nullptr)
{
coefficient_values.resize (fe_values.n_quadrature_points);
coefficient->value_list (fe_values.get_quadrature_points(),
Assert (boundary_functions.size() != 0, ExcInternalError());
Assert (dof_to_boundary_mapping.size() == dof.n_dofs(),
ExcInternalError());
- Assert (coefficient ==0 ||
+ Assert (coefficient ==nullptr ||
coefficient->n_components==1 ||
coefficient->n_components==n_components, ExcComponentMismatch());
MatrixCreator::internal::AssemblerData::Scratch<dim, spacedim,double>
assembler_data (fe_collection,
update_gradients | update_JxW_values |
- (coefficient != 0 ? update_quadrature_points : UpdateFlags(0)),
- coefficient, /*rhs_function=*/0,
+ (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)),
+ coefficient, /*rhs_function=*/nullptr,
q_collection, mapping_collection);
MatrixCreator::internal::AssemblerData::CopyData<double> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
copy_local_to_global<double,SparseMatrix<double>, Vector<double> >,
std::placeholders::_1,
&matrix,
- (Vector<double> *)NULL),
+ (Vector<double> *)(nullptr)),
assembler_data,
copy_data);
}
MatrixCreator::internal::AssemblerData::Scratch<dim, spacedim,double>
assembler_data (dof.get_fe(),
update_gradients | update_JxW_values |
- (coefficient != 0 ? update_quadrature_points : UpdateFlags(0)),
- coefficient, /*rhs_function=*/0,
+ (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)),
+ coefficient, /*rhs_function=*/nullptr,
q, mapping);
MatrixCreator::internal::AssemblerData::CopyData<double> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
copy_local_to_global<double,SparseMatrix<double>, Vector<double> >,
std::placeholders::_1,
&matrix,
- (Vector<double> *)0),
+ (Vector<double> *)nullptr),
assembler_data,
copy_data);
}
const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim> &q,
SparseMatrix<number> &matrix,
- const Function<spacedim,number> *const a = 0,
+ const Function<spacedim,number> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
void create_mass_matrix (const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim> &q,
SparseMatrix<number> &matrix,
- const Function<spacedim,number> *const a = 0,
+ const Function<spacedim,number> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
SparseMatrix<number> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const a = 0,
+ const Function<spacedim,number> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim> &q,
SparseMatrix<number> &matrix,
- const Function<spacedim,number> *const a = 0,
+ const Function<spacedim,number> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
SparseMatrix<number> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const a = 0,
+ const Function<spacedim,number> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim> &q,
SparseMatrix<double> &matrix,
- const Function<spacedim> *const a = 0,
+ const Function<spacedim> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
void create_laplace_matrix (const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim> &q,
SparseMatrix<double> &matrix,
- const Function<spacedim> *const a = 0,
+ const Function<spacedim> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
SparseMatrix<double> &matrix,
const Function<spacedim> &rhs,
Vector<double> &rhs_vector,
- const Function<spacedim> *const a = 0,
+ const Function<spacedim> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
SparseMatrix<double> &matrix,
const Function<spacedim> &rhs,
Vector<double> &rhs_vector,
- const Function<spacedim> *const a = 0,
+ const Function<spacedim> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim> &q,
SparseMatrix<double> &matrix,
- const Function<spacedim> *const a = 0,
+ const Function<spacedim> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
void create_laplace_matrix (const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim> &q,
SparseMatrix<double> &matrix,
- const Function<spacedim> *const a = 0,
+ const Function<spacedim> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
SparseMatrix<double> &matrix,
const Function<spacedim> &rhs,
Vector<double> &rhs_vector,
- const Function<spacedim> *const a = 0,
+ const Function<spacedim> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
SparseMatrix<double> &matrix,
const Function<spacedim> &rhs,
Vector<double> &rhs_vector,
- const Function<spacedim> *const a = 0,
+ const Function<spacedim> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
*/
struct Pointerstruct
{
- Pointerstruct() : indices_ptr(0), dof_values_ptr(0), active_fe_index(0) {};
+ Pointerstruct() : indices_ptr(nullptr), dof_values_ptr(nullptr), active_fe_index(0) {};
Pointerstruct(std::vector<types::global_dof_index> *indices_ptr_in,
const unsigned int active_fe_index_in = 0)
:
indices_ptr(indices_ptr_in),
- dof_values_ptr (0),
+ dof_values_ptr (nullptr),
active_fe_index(active_fe_index_in) {};
Pointerstruct(std::vector<Vector<typename VectorType::value_type> > *dof_values_ptr_in,
const unsigned int active_fe_index_in = 0) :
- indices_ptr (0),
+ indices_ptr (nullptr),
dof_values_ptr(dof_values_ptr_in),
active_fe_index(active_fe_index_in) {};
std::size_t memory_consumption () const;
OutVector &difference,
const Quadrature<dim> &q,
const NormType &norm,
- const Function<spacedim,double> *weight = 0,
+ const Function<spacedim,double> *weight = nullptr,
const double exponent = 2.);
/**
OutVector &difference,
const Quadrature<dim> &q,
const NormType &norm,
- const Function<spacedim,double> *weight = 0,
+ const Function<spacedim,double> *weight = nullptr,
const double exponent = 2.);
/**
OutVector &difference,
const hp::QCollection<dim> &q,
const NormType &norm,
- const Function<spacedim,double> *weight = 0,
+ const Function<spacedim,double> *weight = nullptr,
const double exponent = 2.);
/**
OutVector &difference,
const hp::QCollection<dim> &q,
const NormType &norm,
- const Function<spacedim,double> *weight = 0,
+ const Function<spacedim,double> *weight = nullptr,
const double exponent = 2.);
/**
// interpolate the boundary values and then condense the matrix and vector
if (constraints_are_compatible)
{
- const Function<spacedim,number> *dummy = 0;
+ const Function<spacedim,number> *dummy = nullptr;
MatrixCreator::create_mass_matrix (mapping, dof, quadrature,
mass_matrix, function, tmp,
dummy, constraints);
project_to_boundary_first);
else
{
- Assert((dynamic_cast<const parallel::Triangulation<dim>* > (&(dof.get_triangulation()))==0),
+ Assert((dynamic_cast<const parallel::Triangulation<dim>* > (&(dof.get_triangulation()))==nullptr),
ExcNotImplemented());
do_project (mapping, dof, constraints, quadrature,
function, vec_result,
const DoFHandler<dim> *const dof_ptr = dynamic_cast<const DoFHandler<dim>*> (&dof);
const Function<dim, typename VectorType::value_type> *const function_ptr
= dynamic_cast<const Function<dim, typename VectorType::value_type>*> (&function);
- Assert (mapping_ptr!=0, ExcInternalError());
- Assert (dof_ptr!=0, ExcInternalError());
+ Assert (mapping_ptr!=nullptr, ExcInternalError());
+ Assert (dof_ptr!=nullptr, ExcInternalError());
project<VectorType, dim>
(*mapping_ptr, *dof_ptr, constraints, quadrature, *function_ptr, vec_result,
enforce_zero_boundary, q_boundary, project_to_boundary_first);
}
else
{
- Assert((dynamic_cast<const parallel::Triangulation<dim,spacedim>* > (&(dof.get_triangulation()))==0),
+ Assert((dynamic_cast<const parallel::Triangulation<dim,spacedim>* > (&(dof.get_triangulation()))==nullptr),
ExcNotImplemented());
do_project (mapping, dof, constraints, quadrature,
function, vec_result,
const hp::QCollection<dim-1> &q_boundary,
const bool project_to_boundary_first)
{
- Assert((dynamic_cast<const parallel::Triangulation<dim,spacedim>* > (&(dof.get_triangulation()))==0),
+ Assert((dynamic_cast<const parallel::Triangulation<dim,spacedim>* > (&(dof.get_triangulation()))==nullptr),
ExcNotImplemented());
do_project (mapping, dof, constraints, quadrature,
MatrixCreator::create_boundary_mass_matrix (mapping, dof, q,
mass_matrix, boundary_functions,
rhs, dof_to_boundary_mapping,
- (const Function<spacedim,number> *) 0,
+ (const Function<spacedim,number> *) nullptr,
component_mapping);
// For certain weird elements,
reference_quadrature_points = fe_values.get_quadrature ().get_points ();
std::pair<unsigned int, unsigned int> base_indices (0, 0);
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) != nullptr)
{
unsigned int fe_index = 0;
unsigned int fe_index_old = 0;
// Compute the degrees of
// freedom.
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).first
== base_indices)
&& (fe.base_element (base_indices.first).face_to_cell_index (line * fe.degree, face)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).second
<= fe.base_element (base_indices.first).face_to_cell_index
((line + 1) * fe.degree - 1, face)))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0) && (line * fe.degree <= i)
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr) && (line * fe.degree <= i)
&& (i < (line + 1) * fe.degree)))
{
const double tangential_solution_component
const unsigned int degree = fe.degree - 1;
std::pair<unsigned int, unsigned int> base_indices (0, 0);
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) != nullptr)
{
unsigned int fe_index = 0;
unsigned int fe_index_old = 0;
// Compute the degrees
// of freedom.
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).first
== base_indices))
- || (dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0))
+ || (dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr))
{
dof_values[i]
+= fe_values.JxW (q_point)
tmp[d] = values[q_point] (first_vector_component + d);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).first == base_indices)
&& (fe.base_element (base_indices.first).face_to_cell_index (2 * fe.degree, face)
<= fe.system_to_base_index (fe.face_to_cell_index (i, face)).second)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).second
<= fe.base_element (base_indices.first).face_to_cell_index (4 * fe.degree - 1, face)))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0) && (2 * fe.degree <= i)
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr) && (2 * fe.degree <= i)
&& (i < 4 * fe.degree)))
tmp -= dof_values[i] * fe_values[vec].value (fe.face_to_cell_index (i, face), q_point);
unsigned int index = 0;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).first
== base_indices)
&& (fe.base_element (base_indices.first).face_to_cell_index
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).second
< fe.base_element (base_indices.first).face_to_cell_index
((degree + GeometryInfo<dim>::lines_per_face) * fe.degree, face)))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0)
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr)
&& (GeometryInfo<dim>::lines_per_face * fe.degree <= i)
&& (i < (degree + GeometryInfo<dim>::lines_per_face) * fe.degree)))
{
unsigned int index = 0;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).first
== base_indices)
&& (fe.base_element (base_indices.first).face_to_cell_index
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).second
< fe.base_element (base_indices.first).face_to_cell_index
((degree + GeometryInfo<dim>::lines_per_face) * fe.degree, face)))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0)
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr)
&& (GeometryInfo<dim>::lines_per_face * fe.degree <= i)
&& (i < (degree + GeometryInfo<dim>::lines_per_face) * fe.degree)))
{
tmp[d] = values[q_point] (first_vector_component + d);
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).first
== base_indices)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).second
<= fe.base_element (base_indices.first).face_to_cell_index (2 * fe.degree - 1, face))
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).second
>= fe.base_element (base_indices.first).face_to_cell_index (0, face)))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0) && (i < 2 * fe.degree)))
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr) && (i < 2 * fe.degree)))
tmp -= dof_values[i] * fe_values[vec].value (fe.face_to_cell_index (i, face), q_point);
const double JxW
unsigned int index = 0;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).first
== base_indices)
&& (fe.base_element (base_indices.first).face_to_cell_index
((degree + GeometryInfo<dim>::lines_per_face) * fe.degree, face)
<= fe.system_to_base_index (fe.face_to_cell_index (i, face)).second))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0)
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr)
&& ((degree + GeometryInfo<dim>::lines_per_face) * fe.degree <= i)))
{
const Tensor<1, dim> shape_value
unsigned int index = 0;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (fe.face_to_cell_index (i, face)).first
== base_indices)
&& (fe.base_element (base_indices.first).face_to_cell_index
((degree + GeometryInfo<dim>::lines_per_face) * fe.degree, face)
<= fe.system_to_base_index (fe.face_to_cell_index (i, face)).second))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0)
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr)
&& ((degree + GeometryInfo<dim>::lines_per_face) * fe.degree <= i)))
{
dof_values[i] = solution (index);
// FE_Nothing object
// there is no work to
// do
- if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != nullptr)
return;
// This is only
// element. If the FE
// is a FESystem, we
// cannot check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
// FE_Nothing object
// there is no work to
// do
- if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != nullptr)
return;
// This is only
// element. If the FE is
// a FESystem we cannot
// check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
if (cell->face (face)->boundary_id () == boundary_component)
{
// if the FE is a FE_Nothing object there is no work to do
- if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != nullptr)
return;
// This is only implemented, if the FE is a Nedelec
// element. If the FE is a FESystem we cannot check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
if (cell->face (face)->boundary_id () == boundary_component)
{
// if the FE is a FE_Nothing object there is no work to do
- if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != nullptr)
return;
// This is only implemented, if the FE is a Nedelec
// element. If the FE is a FESystem we cannot check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
// If not using FESystem then must be using FE_Nedelec,
// which has one base element and one copy of it (with 3 components).
std::pair<unsigned int, unsigned int> base_indices (0, 0);
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) != nullptr)
{
unsigned int fe_index = 0;
unsigned int fe_index_old = 0;
const unsigned int cell_idx = fe.face_to_cell_index (face_idx, face);
// Check this cell_idx belongs to the correct base_element, component and line:
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (cell_idx).first == base_indices)
&& (lower_bound <= fe.system_to_base_index (cell_idx).second)
&& (fe.system_to_base_index (cell_idx).second <= upper_bound))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0)
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr)
&& (line * (degree + 1) <= face_idx)
&& (face_idx <= (line + 1) * (degree + 1) - 1)))
{
// If not using FESystem then must be using FE_Nedelec,
// which has one base element and one copy of it (with 3 components).
std::pair<unsigned int, unsigned int> base_indices (0, 0);
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) != nullptr)
{
unsigned int fe_index = 0;
unsigned int fe_index_old = 0;
for (unsigned int face_idx = 0; face_idx < fe.dofs_per_face; ++face_idx)
{
const unsigned int cell_idx = fe.face_to_cell_index (face_idx, face);
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (cell_idx).first == base_indices))
- || (dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0))
+ || (dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr))
{
associated_edge_dof_to_face_dof[associated_edge_dof_index] = face_idx;
++associated_edge_dof_index;
const unsigned int face_idx = line*fe.dofs_per_line + line_idx;
const unsigned int cell_idx = fe.face_to_cell_index(face_idx, face);
// Check this cell_idx belongs to the correct base_element, component and line:
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (cell_idx).first == base_indices)
&& (lower_bound <= fe.system_to_base_index (cell_idx).second)
&& (fe.system_to_base_index (cell_idx).second <= upper_bound))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0)
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr)
&& (line * (degree + 1) <= face_idx)
&& (face_idx <= (line + 1) * (degree + 1) - 1)))
{
face_idx < fe.dofs_per_face; ++face_idx)
{
const unsigned int cell_idx = fe.face_to_cell_index (face_idx, face);
- if (((dynamic_cast<const FESystem<dim>*> (&fe) != 0)
+ if (((dynamic_cast<const FESystem<dim>*> (&fe) != nullptr)
&& (fe.system_to_base_index (cell_idx).first == base_indices))
- || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != 0)))
+ || ((dynamic_cast<const FE_Nedelec<dim>*> (&fe) != nullptr)))
{
associated_face_dof_to_face_dof[associated_face_dof_index] = face_idx;
++associated_face_dof_index;
if (cell->face (face)->boundary_id () == boundary_component)
{
// If the FE is an FE_Nothing object there is no work to do
- if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != nullptr)
{
return;
}
// This is only implemented for FE_Nedelec elements.
// If the FE is a FESystem we cannot check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
if (cell->face (face)->boundary_id () == boundary_component)
{
// If the FE is an FE_Nothing object there is no work to do
- if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != nullptr)
{
return;
}
// This is only implemented for FE_Nedelec elements.
// If the FE is a FESystem we cannot check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_Nedelec<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
// FE_Nothing object
// there is no work to
// do
- if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != 0)
+ if (dynamic_cast<const FE_Nothing<dim>*> (&cell->get_fe ()) != nullptr)
return;
// This is only
// element. If the FE is
// a FESystem we cannot
// check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_RaviartThomas<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_RaviartThomas<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
// element. If the FE is
// a FESystem we cannot
// check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_RaviartThomas<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_RaviartThomas<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
// element. If the FE is
// a FESystem we cannot
// check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_RaviartThomas<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_RaviartThomas<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
// element. If the FE is
// a FESystem we cannot
// check this.
- if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == 0)
+ if (dynamic_cast<const FESystem<dim>*> (&cell->get_fe ()) == nullptr)
{
typedef FiniteElement<dim> FEL;
- AssertThrow (dynamic_cast<const FE_RaviartThomas<dim>*> (&cell->get_fe ()) != 0,
+ AssertThrow (dynamic_cast<const FE_RaviartThomas<dim>*> (&cell->get_fe ()) != nullptr,
typename FEL::ExcInterpolationNotImplemented ());
}
const std::vector<std::pair<types::global_dof_index, double> > *constrained
= no_normal_flux_constraints.get_constraint_entries((*it)[constrained_index]);
// find components to which this index is constrained to
- Assert(constrained != 0, ExcInternalError());
+ Assert(constrained != nullptr, ExcInternalError());
Assert(constrained->size() < dim, ExcInternalError());
for (unsigned int c=0; c<constrained->size(); ++c)
{
const dealii::FEValues<dim, spacedim> &fe_values = data.x_fe_values.get_present_fe_values ();
const unsigned int n_q_points = fe_values.n_quadrature_points;
- if (weight!=0)
+ if (weight!=nullptr)
{
if (weight->n_components>1)
weight->vector_value_list (fe_values.get_quadrature_points(),
const unsigned int n_components = dof.get_fe().n_components();
- if (weight!=0)
+ if (weight!=nullptr)
{
Assert ((weight->n_components==1) || (weight->n_components==n_components),
ExcDimensionMismatch(weight->n_components, n_components));
function(""),
cond(""),
exc(""),
- stacktrace (NULL),
+ stacktrace (nullptr),
n_stacktrace_frames (0),
what_str("")
{
#ifdef DEAL_II_HAVE_GLIBC_STACKTRACE
for (unsigned int i=0; i<sizeof(raw_stacktrace)/sizeof(raw_stacktrace[0]); ++i)
- raw_stacktrace[i] = NULL;
+ raw_stacktrace[i] = nullptr;
#endif
}
function(exc.function),
cond(exc.cond),
exc(exc.exc),
- stacktrace (NULL), // don't copy stacktrace to avoid double de-allocation problem
+ stacktrace (nullptr), // don't copy stacktrace to avoid double de-allocation problem
n_stacktrace_frames (0),
what_str("") // don't copy the error message, it gets generated dynamically by what()
{
#ifdef DEAL_II_HAVE_GLIBC_STACKTRACE
for (unsigned int i=0; i<sizeof(raw_stacktrace)/sizeof(raw_stacktrace[0]); ++i)
- raw_stacktrace[i] = NULL;
+ raw_stacktrace[i] = nullptr;
#endif
}
ExceptionBase::~ExceptionBase () noexcept
{
free (stacktrace); // free(NULL) is allowed
- stacktrace = NULL;
+ stacktrace = nullptr;
}
// between numerous "..."-enclosed strings that the preprocessor
// collates into a single string, making it awkward to read. Consequently,
// elide this text if the message was generated via an ExcMessage object
- if (std::strstr(cond, "dealii::ExcMessage") != NULL)
+ if (std::strstr(cond, "dealii::ExcMessage") != nullptr)
out << "The name and call sequence of the exception was:" << std::endl
<< " " << exc << std::endl;
// for unknown reasons :-) if we can, demangle the function name
#ifdef DEAL_II_HAVE_LIBSTDCXX_DEMANGLER
int status;
- char *p = abi::__cxa_demangle(functionname.c_str(), 0, 0, &status);
+ char *p = abi::__cxa_demangle(functionname.c_str(), nullptr, nullptr, &status);
if ((status == 0) && (functionname != "main"))
{
static Threads::Mutex rand_mutex;
Threads::Mutex::ScopedLock lock(rand_mutex);
static boost::random::uniform_real_distribution<> uniform_distribution(0,1);
- static boost::random::mt19937 rng(static_cast<unsigned long>(std::time(0)));
+ static boost::random::mt19937 rng(static_cast<unsigned long>(std::time(nullptr)));
return uniform_distribution(rng);
}
?
reinterpret_cast<TrilinosWrappers::types::int_type *>(&indices[0])
:
- 0),
+ nullptr),
0,
#ifdef DEAL_II_WITH_MPI
Epetra_MpiComm(communicator)
JobIdentifier::JobIdentifier()
{
- time_t t = std::time(0);
+ time_t t = std::time(nullptr);
id = std::string("JobId ");
#if defined(DEAL_II_HAVE_UNISTD_H) && defined(DEAL_II_HAVE_GETHOSTNAME)
LogStream::LogStream()
:
std_out(&std::cerr),
- file(0),
+ file(nullptr),
std_depth(0),
file_depth(10000),
print_utime(false),
float_threshold(0.),
offset(0),
print_thread_id(false),
- old_cerr(0),
+ old_cerr(nullptr),
at_newline(true)
{
get_prefixes().push("DEAL:");
void LogStream::detach ()
{
Threads::Mutex::ScopedLock lock(log_lock);
- file = 0;
+ file = nullptr;
}
void LogStream::log_cerr ()
{
Threads::Mutex::ScopedLock lock(log_lock);
- if (old_cerr == 0)
+ if (old_cerr == nullptr)
{
old_cerr = std::cerr.rdbuf(file->rdbuf());
}
else
{
std::cerr.rdbuf(old_cerr);
- old_cerr = 0;
+ old_cerr = nullptr;
}
}
bool
LogStream::has_file() const
{
- return (file != 0);
+ return (file != nullptr);
}
#ifdef DEAL_II_WITH_P4EST
//Initialize p4est and libsc components
- sc_init(MPI_COMM_WORLD, 0, 0, NULL, SC_LP_SILENT);
- p4est_init (0, SC_LP_SILENT);
+ sc_init(MPI_COMM_WORLD, 0, 0, nullptr, SC_LP_SILENT);
+ p4est_init (nullptr, SC_LP_SILENT);
#endif
constructor_has_already_run = true;
// then also see if something was given in the environment
{
const char *penv = getenv ("DEAL_II_NUM_THREADS");
- if (penv!=NULL)
+ if (penv!=nullptr)
{
unsigned int max_threads_env = numbers::invalid_unsigned_int;
try
PatternBase *p;
p = Integer::create(description);
- if (p != 0)
+ if (p != nullptr)
return p;
p = Double::create(description);
- if (p !=0 )
+ if (p !=nullptr )
return p;
p = Selection::create(description);
- if (p !=0 )
+ if (p !=nullptr )
return p;
p = List::create(description);
- if (p !=0 )
+ if (p !=nullptr )
return p;
p = MultipleSelection::create(description);
- if (p !=0 )
+ if (p !=nullptr )
return p;
p = Bool::create(description);
- if (p!=0 )
+ if (p!=nullptr )
return p;
p = Anything::create(description);
- if (p !=0 )
+ if (p !=nullptr )
return p;
p = FileName::create(description);
- if (p !=0 )
+ if (p !=nullptr )
return p;
p = DirectoryName::create(description);
- if (p!=0 )
+ if (p!=nullptr )
return p;
Assert(false, ExcNotImplemented());
- return 0;
+ return nullptr;
}
std::size_t
PatternBase::memory_consumption () const
{
- if (dynamic_cast<const Integer *>(this) != 0)
+ if (dynamic_cast<const Integer *>(this) != nullptr)
return sizeof(Integer);
- else if (dynamic_cast<const Double *>(this) != 0)
+ else if (dynamic_cast<const Double *>(this) != nullptr)
return sizeof(Double);
- else if (dynamic_cast<const Bool *>(this) != 0)
+ else if (dynamic_cast<const Bool *>(this) != nullptr)
return sizeof(Bool);
- else if (dynamic_cast<const Anything *>(this) != 0)
+ else if (dynamic_cast<const Anything *>(this) != nullptr)
return sizeof(Anything);
else
return sizeof(*this) + 32;
return new Integer();
}
else
- return 0;
+ return nullptr;
}
{
const std::string description_init_str = description_init;
if (description.compare(0, description_init_str.size(), description_init_str) != 0)
- return NULL;
+ return nullptr;
if (*description.rbegin() != ']')
- return NULL;
+ return nullptr;
std::string temp = description.substr(description_init_str.size());
if (temp == "]")
{
// parse lower bound and give up if not a double
if (!(is >> lower_bound))
- return NULL;
+ return nullptr;
}
// ignore failure here and assume we got MAX_DOUBLE as upper bound:
return new Selection(sequence);
}
else
- return 0;
+ return nullptr;
}
List::~List ()
{
delete pattern;
- pattern = 0;
+ pattern = nullptr;
}
return new List(*base_pattern, min_elements, max_elements, separator);
}
else
- return 0;
+ return nullptr;
}
Map::~Map ()
{
delete key_pattern;
- key_pattern = 0;
+ key_pattern = nullptr;
delete value_pattern;
- value_pattern = 0;
+ value_pattern = nullptr;
}
separator);
}
else
- return 0;
+ return nullptr;
}
return new MultipleSelection(sequence);
}
else
- return 0;
+ return nullptr;
}
if (description.compare(0, std::strlen(description_init), description_init) == 0)
return new Bool();
else
- return 0;
+ return nullptr;
}
if (description.compare(0, std::strlen(description_init), description_init) == 0)
return new Anything();
else
- return 0;
+ return nullptr;
}
return new FileName(type);
}
else
- return 0;
+ return nullptr;
}
if (description.compare(0, std::strlen(description_init), description_init) == 0)
return new DirectoryName();
else
- return 0;
+ return nullptr;
}
} // end namespace Patterns
deallog << "PathSearch[" << cls << "] trying "
<< real_name << std::endl;
FILE *fp = fopen(real_name.c_str(), open_mode);
- if (fp != 0)
+ if (fp != nullptr)
{
if (debug > 0)
deallog << "PathSearch[" << cls << "] opened "
deallog << "PathSearch[" << cls << "] trying "
<< real_name << std::endl;
FILE *fp = fopen(real_name.c_str(), open_mode);
- if (fp != 0)
+ if (fp != nullptr)
{
if (debug > 0)
deallog << "PathSearch[" << cls << "] opened "
// well if necessary. copy the polynomial to
// do this
std::shared_ptr<Polynomial<number> > q_data;
- const Polynomial<number> *q = 0;
+ const Polynomial<number> *q = nullptr;
if (p.in_lagrange_product_form == true)
{
q_data.reset (new Polynomial<number>(p));
// well if necessary. copy the polynomial to
// do this
std::shared_ptr<Polynomial<number> > q_data;
- const Polynomial<number> *q = 0;
+ const Polynomial<number> *q = nullptr;
if (p.in_lagrange_product_form == true)
{
q_data.reset (new Polynomial<number>(p));
// well if necessary. copy the polynomial to
// do this
std::shared_ptr<Polynomial<number> > q_data;
- const Polynomial<number> *q = 0;
+ const Polynomial<number> *q = nullptr;
if (p.in_lagrange_product_form == true)
{
q_data.reset (new Polynomial<number>(p));
return Monomial<number>(0, 0.);
std::shared_ptr<Polynomial<number> > q_data;
- const Polynomial<number> *q = 0;
+ const Polynomial<number> *q = nullptr;
if (in_lagrange_product_form == true)
{
q_data.reset (new Polynomial<number>(*this));
// no simple form possible for Lagrange
// polynomial on product form
std::shared_ptr<Polynomial<number> > q_data;
- const Polynomial<number> *q = 0;
+ const Polynomial<number> *q = nullptr;
if (in_lagrange_product_form == true)
{
q_data.reset (new Polynomial<number>(*this));
unsigned int n_functions=n+1;
Assert(support_point<n_functions,
ExcIndexRange(support_point, 0, n_functions));
- double const *x=0;
+ double const *x=nullptr;
switch (n)
{
Assert(false, ExcInternalError())
}
- Assert(x!=0, ExcInternalError());
+ Assert(x!=nullptr, ExcInternalError());
for (unsigned int i=0; i<n_functions; ++i)
a[i]=x[support_point*n_functions+i];
}
// already exist?
if ( (recursive_coefficients.size() < k+1) ||
((recursive_coefficients.size() >= k+1) &&
- (recursive_coefficients[k].get() == 0)) )
+ (recursive_coefficients[k].get() == nullptr)) )
// no, then generate the
// respective coefficients
{
Subscriptor::Subscriptor ()
:
counter (0),
- object_info (0)
+ object_info (nullptr)
{
// this has to go somewhere to avoid an extra warning.
(void)unknown_subscriber;
Subscriptor::Subscriptor (const Subscriptor &)
:
counter (0),
- object_info (0)
+ object_info (nullptr)
{}
Subscriptor::subscribe(const char *id) const
{
#ifdef DEBUG
- if (object_info == 0)
+ if (object_info == nullptr)
object_info = &typeid(*this);
Threads::Mutex::ScopedLock lock (subscription_lock);
++counter;
Subscriptor::unsubscribe(const char *id) const
{
#ifdef DEBUG
- const char *name = (id != 0) ? id : unknown_subscriber;
+ const char *name = (id != nullptr) ? id : unknown_subscriber;
AssertNothrow (counter>0, ExcNoSubscriber(object_info->name(), name));
// This is for the case that we do
// not abort after the exception
const char *,
void *)
{
- pthread_barrier_init (&barrier, 0, count);
+ pthread_barrier_init (&barrier, nullptr, count);
}
#else
//TODO: Break this out into a function like the functions in
//namespace windows above
struct timeval wall_timer;
- gettimeofday(&wall_timer, NULL);
+ gettimeofday(&wall_timer, nullptr);
start_wall_time = wall_timer.tv_sec + 1.e-6 * wall_timer.tv_usec;
rusage usage;
cumulative_time += dtime_children - start_time_children;
struct timeval wall_timer;
- gettimeofday(&wall_timer, NULL);
+ gettimeofday(&wall_timer, nullptr);
last_lap_time = wall_timer.tv_sec + 1.e-6 * wall_timer.tv_usec
- start_wall_time;
#elif defined(DEAL_II_MSVC)
{
#if defined(DEAL_II_HAVE_SYS_TIME_H) && defined(DEAL_II_HAVE_SYS_RESOURCE_H)
struct timeval wall_timer;
- gettimeofday(&wall_timer, NULL);
+ gettimeofday(&wall_timer, nullptr);
return (wall_timer.tv_sec
+ 1.e-6 * wall_timer.tv_usec
- start_wall_time
std::string get_time ()
{
- std::time_t time1= std::time (0);
+ std::time_t time1= std::time (nullptr);
std::tm *time = std::localtime(&time1);
std::ostringstream o;
std::string get_date ()
{
- std::time_t time1= std::time (0);
+ std::time_t time1= std::time (nullptr);
std::tm *time = std::localtime(&time1);
std::ostringstream o;
const int ierr = ::posix_memalign (memptr, alignment, size);
AssertThrow (ierr == 0, ExcOutOfMemory());
- AssertThrow (*memptr != 0, ExcOutOfMemory());
+ AssertThrow (*memptr != nullptr, ExcOutOfMemory());
#else
// Windows does not appear to have posix_memalign. just use the
// regular malloc in that case
// return a duplicate of it
const Epetra_MpiComm
*mpi_comm = dynamic_cast<const Epetra_MpiComm *>(&communicator);
- if (mpi_comm != 0)
+ if (mpi_comm != nullptr)
return new Epetra_MpiComm(Utilities::MPI::
duplicate_communicator(mpi_comm->GetMpiComm()));
#endif
// not an MPI communicator, return a
// copy of the same object again
Assert (dynamic_cast<const Epetra_SerialComm *>(&communicator)
- != 0,
+ != nullptr,
ExcInternalError());
return new Epetra_SerialComm(dynamic_cast<const Epetra_SerialComm &>(communicator));
}
#ifdef DEAL_II_WITH_MPI
Epetra_MpiComm
*mpi_comm = dynamic_cast<Epetra_MpiComm *>(&communicator);
- if (mpi_comm != 0)
+ if (mpi_comm != nullptr)
{
MPI_Comm comm = mpi_comm->GetMpiComm();
*mpi_comm = Epetra_MpiComm(MPI_COMM_SELF);
void *user_data)
{
p4est_iterate (parallel_forest, parallel_ghost, user_data,
- NULL,
+ nullptr,
find_ghosts_face<2,spacedim>,
find_ghosts_corner<2,spacedim>);
}
void *user_data)
{
p8est_iterate (parallel_forest, parallel_ghost, user_data,
- NULL,
+ nullptr,
find_ghosts_face<3,spacedim>,
find_ghosts_edge<3,spacedim>,
find_ghosts_corner<3,spacedim>);
Triangulation<dim, spacedim>::
copy_triangulation (const dealii::Triangulation<dim, spacedim> &other_tria)
{
- Assert ((dynamic_cast<const dealii::parallel::distributed::Triangulation<dim,spacedim> *>(&other_tria) == NULL),
+ Assert ((dynamic_cast<const dealii::parallel::distributed::Triangulation<dim,spacedim> *>(&other_tria) == nullptr),
ExcMessage("Cannot use this function on parallel::distributed::Triangulation."));
dealii::parallel::Triangulation<dim,spacedim>::copy_triangulation (other_tria);
offset (numbers::invalid_unsigned_int)
{
Assert (dynamic_cast<const parallel::distributed::Triangulation<dim>*>
- (&dof_handler->get_triangulation()) != 0,
+ (&dof_handler->get_triangulation()) != nullptr,
ExcMessage("parallel::distributed::SolutionTransfer requires a parallel::distributed::Triangulation object."));
}
= (dynamic_cast<parallel::distributed::Triangulation<dim,DoFHandlerType::space_dimension>*>
(const_cast<dealii::Triangulation<dim,DoFHandlerType::space_dimension>*>
(&dof_handler->get_triangulation())));
- Assert (tria != 0, ExcInternalError());
+ Assert (tria != nullptr, ExcInternalError());
offset
= tria->register_data_attach(size,
= (dynamic_cast<parallel::distributed::Triangulation<dim,DoFHandlerType::space_dimension>*>
(const_cast<dealii::Triangulation<dim,DoFHandlerType::space_dimension>*>
(&dof_handler->get_triangulation())));
- Assert (tria != 0, ExcInternalError());
+ Assert (tria != nullptr, ExcInternalError());
tria->notify_ready_to_unpack(offset,
std::bind(&SolutionTransfer<dim, VectorType,
false),
settings(settings_),
triangulation_has_content (false),
- connectivity (0),
- parallel_forest (0),
+ connectivity (nullptr),
+ parallel_forest (nullptr),
refinement_in_progress (false),
attached_data_size(0),
n_attached_datas(0),
n_attached_deserialize(0)
{
- parallel_ghost = 0;
+ parallel_ghost = nullptr;
}
Assert (triangulation_has_content == false,
ExcInternalError());
- Assert (connectivity == 0, ExcInternalError());
- Assert (parallel_forest == 0, ExcInternalError());
+ Assert (connectivity == nullptr, ExcInternalError());
+ Assert (parallel_forest == nullptr, ExcInternalError());
Assert (refinement_in_progress == false, ExcInternalError());
}
{
triangulation_has_content = false;
- if (parallel_ghost != 0)
+ if (parallel_ghost != nullptr)
{
dealii::internal::p4est::functions<dim>::ghost_destroy (parallel_ghost);
- parallel_ghost = 0;
+ parallel_ghost = nullptr;
}
- if (parallel_forest != 0)
+ if (parallel_forest != nullptr)
{
dealii::internal::p4est::functions<dim>::destroy (parallel_forest);
- parallel_forest = 0;
+ parallel_forest = nullptr;
}
- if (connectivity != 0)
+ if (connectivity != nullptr)
{
dealii::internal::p4est::functions<dim>::connectivity_destroy (connectivity);
- connectivity = 0;
+ connectivity = nullptr;
}
coarse_cell_to_p4est_tree_permutation.resize (0);
void
Triangulation<dim,spacedim>::write_mesh_vtk (const char *file_basename) const
{
- Assert (parallel_forest != 0,
+ Assert (parallel_forest != nullptr,
ExcMessage ("Can't produce output when no forest is created yet."));
dealii::internal::p4est::functions<dim>::
- vtk_write_file (parallel_forest, 0, file_basename);
+ vtk_write_file (parallel_forest, nullptr, file_basename);
}
// and release the data
void *userptr = parallel_forest->user_pointer;
- dealii::internal::p4est::functions<dim>::reset_data (parallel_forest, 0, NULL, NULL);
+ dealii::internal::p4est::functions<dim>::reset_data (parallel_forest, 0, nullptr, nullptr);
parallel_forest->user_pointer = userptr;
}
Assert(this->n_levels()==1, ExcMessage("Triangulation may only contain coarse cells when calling load()."));
- if (parallel_ghost != 0)
+ if (parallel_ghost != nullptr)
{
dealii::internal::p4est::functions<dim>::ghost_destroy (parallel_ghost);
- parallel_ghost = 0;
+ parallel_ghost = nullptr;
}
dealii::internal::p4est::functions<dim>::destroy (parallel_forest);
- parallel_forest = 0;
+ parallel_forest = nullptr;
dealii::internal::p4est::functions<dim>::connectivity_destroy (connectivity);
- connectivity = 0;
+ connectivity = nullptr;
unsigned int version, numcpus, attached_size, attached_count, n_coarse_cells;
{
unsigned int
Triangulation<dim,spacedim>::get_checksum () const
{
- Assert (parallel_forest != 0,
+ Assert (parallel_forest != nullptr,
ExcMessage ("Can't produce a check sum when no forest is created yet."));
return dealii::internal::p4est::functions<dim>::checksum (parallel_forest);
}
/* minimum level of upfront refinement */ 0,
/* use uniform upfront refinement */ 1,
/* user_data_size = */ 0,
- /* user_data_constructor = */ NULL,
+ /* user_data_constructor = */ nullptr,
/* user_pointer */ this);
}
/* minimum level of upfront refinement */ 0,
/* use uniform upfront refinement */ 1,
/* user_data_size = */ 0,
- /* user_data_constructor = */ NULL,
+ /* user_data_constructor = */ nullptr,
/* user_pointer */ this);
}
/* minimum level of upfront refinement */ 0,
/* use uniform upfront refinement */ 1,
/* user_data_size = */ 0,
- /* user_data_constructor = */ NULL,
+ /* user_data_constructor = */ nullptr,
/* user_pointer */ this);
}
// query p4est for the ghost cells
- if (parallel_ghost != 0)
+ if (parallel_ghost != nullptr)
{
dealii::internal::p4est::functions<dim>::ghost_destroy (parallel_ghost);
- parallel_ghost = 0;
+ parallel_ghost = nullptr;
}
parallel_ghost = dealii::internal::p4est::functions<dim>::ghost_new (parallel_forest,
(dim == 2
ExcInternalError());
parallel_forest->user_pointer = &refine_and_coarsen_list;
- if (parallel_ghost != 0)
+ if (parallel_ghost != nullptr)
{
dealii::internal::p4est::functions<dim>::ghost_destroy (parallel_ghost);
- parallel_ghost = 0;
+ parallel_ghost = nullptr;
}
dealii::internal::p4est::functions<dim>::
refine (parallel_forest, /* refine_recursive */ false,
&RefineAndCoarsenList<dim,spacedim>::refine_callback,
- /*init_callback=*/NULL);
+ /*init_callback=*/nullptr);
dealii::internal::p4est::functions<dim>::
coarsen (parallel_forest, /* coarsen_recursive */ false,
&RefineAndCoarsenList<dim,spacedim>::coarsen_callback,
- /*init_callback=*/NULL);
+ /*init_callback=*/nullptr);
// make sure all cells in the lists have been consumed
Assert (refine_and_coarsen_list.pointers_are_at_end(),
:
typename dealii::internal::p4est::types<dim>::
balance_type(P8EST_CONNECT_FULL)),
- /*init_callback=*/NULL);
+ /*init_callback=*/nullptr);
// before repartitioning the mesh let others attach mesh related info
// (such as SolutionTransfer data) to the p4est
dealii::internal::p4est::functions<dim>::
partition (parallel_forest,
/* prepare coarsening */ 1,
- /* weight_callback */ NULL);
+ /* weight_callback */ nullptr);
else
{
// get cell weights for a weighted repartitioning.
dealii::internal::p4est::functions<dim>::
partition (parallel_forest,
/* prepare coarsening */ 1,
- /* weight_callback */ NULL);
+ /* weight_callback */ nullptr);
}
else
{
// and release the data
void *userptr = parallel_forest->user_pointer;
- dealii::internal::p4est::functions<dim>::reset_data (parallel_forest, 0, NULL, NULL);
+ dealii::internal::p4est::functions<dim>::reset_data (parallel_forest, 0, nullptr, nullptr);
parallel_forest->user_pointer = userptr;
}
}
/* minimum level of upfront refinement */ 0,
/* use uniform upfront refinement */ 1,
/* user_data_size = */ 0,
- /* user_data_constructor = */ NULL,
+ /* user_data_constructor = */ nullptr,
/* user_pointer */ this);
void *userptr = parallel_forest->user_pointer;
dealii::internal::p4est::functions<dim>::reset_data (parallel_forest,
attached_data_size+sizeof(CellStatus),
- NULL, NULL);
+ nullptr, nullptr);
parallel_forest->user_pointer = userptr;
Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
ExcMessage ("DoFHandler not initialized"));
- Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
+ Assert (this->dof_handler != nullptr, typename BaseClass::ExcInvalidObject());
internal::DoFCellAccessor::Implementation::
update_cell_dof_indices_cache (*this);
Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
ExcMessage ("DoFHandler not initialized"));
- Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
+ Assert (this->dof_handler != nullptr, typename BaseClass::ExcInvalidObject());
internal::DoFCellAccessor::Implementation::
set_dof_indices (*this, local_dof_indices);
{
if ((dynamic_cast<DoFHandler<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
(this->dof_handler)
- != 0)
+ != nullptr)
||
// for hp-DoFHandlers, we need to require that on
// active cells, you either don't specify an fe_index,
// fe_index is given
Assert ((dynamic_cast<DoFHandler<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
(this->dof_handler)
- != 0)
+ != nullptr)
||
(fe_index != DoFHandlerType::default_fe_index),
ExcMessage ("You cannot call this function on non-active cells "
const FiniteElement<dim,spacedim> &fe = this->get_dof_handler().get_fe()[fe_index];
const unsigned int dofs_per_cell = fe.dofs_per_cell;
- Assert (this->dof_handler != 0,
+ Assert (this->dof_handler != nullptr,
typename BaseClass::ExcInvalidObject());
Assert (interpolated_values.size() == dofs_per_cell,
typename BaseClass::ExcVectorDoesNotMatch());
{
if ((dynamic_cast<DoFHandler<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
(this->dof_handler)
- != 0)
+ != nullptr)
||
// for hp-DoFHandlers, we need to require that on
// active cells, you either don't specify an fe_index,
{
Assert ((dynamic_cast<DoFHandler<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
(this->dof_handler)
- != 0)
+ != nullptr)
||
(fe_index != DoFHandlerType::default_fe_index),
ExcMessage ("You cannot call this function on non-active cells "
const FiniteElement<dim,spacedim> &fe = this->get_dof_handler().get_fe()[fe_index];
const unsigned int dofs_per_cell = fe.dofs_per_cell;
- Assert (this->dof_handler != 0,
+ Assert (this->dof_handler != nullptr,
typename BaseClass::ExcInvalidObject());
Assert (local_values.size() == dofs_per_cell,
typename BaseClass::ExcVectorDoesNotMatch());
DoFHandler<dim,spacedim>::DoFHandler (const Triangulation<dim,spacedim> &tria)
:
tria(&tria, typeid(*this).name()),
- selected_fe(0, typeid(*this).name()),
- faces(NULL),
- mg_faces (NULL)
+ selected_fe(nullptr, typeid(*this).name()),
+ faces(nullptr),
+ mg_faces (nullptr)
{
// decide whether we need a
// sequential or a parallel
// distributed policy
if (dynamic_cast<const parallel::shared::Triangulation< dim, spacedim>*>
(&tria)
- != 0)
+ != nullptr)
policy.reset (new internal::DoFHandler::Policy::ParallelShared<dim,spacedim>());
else if (dynamic_cast<const parallel::distributed::Triangulation< dim, spacedim >*>
(&tria)
- == 0)
+ == nullptr)
policy.reset (new internal::DoFHandler::Policy::Sequential<dim,spacedim>());
else
policy.reset (new internal::DoFHandler::Policy::ParallelDistributed<dim,spacedim>());
template<int dim, int spacedim>
DoFHandler<dim,spacedim>::DoFHandler ()
:
- tria(0, typeid(*this).name()),
- selected_fe(0, typeid(*this).name()),
- faces(NULL),
- mg_faces (NULL)
+ tria(nullptr, typeid(*this).name()),
+ selected_fe(nullptr, typeid(*this).name()),
+ faces(nullptr),
+ mg_faces (nullptr)
{}
const FiniteElement<dim,spacedim> &fe)
{
tria = &t;
- faces = 0;
+ faces = nullptr;
number_cache.n_global_dofs = 0;
// decide whether we need a
// distributed policy
if (dynamic_cast<const parallel::shared::Triangulation< dim, spacedim>*>
(&t)
- != 0)
+ != nullptr)
policy.reset (new internal::DoFHandler::Policy::ParallelShared<dim,spacedim>());
else if (dynamic_cast<const parallel::distributed::Triangulation< dim, spacedim >*>
(&t)
- == 0)
+ == nullptr)
policy.reset (new internal::DoFHandler::Policy::Sequential<dim,spacedim>());
else
policy.reset (new internal::DoFHandler::Policy::ParallelDistributed<dim,spacedim>());
for (unsigned int level = 0; level < mg_levels.size (); ++level)
mem += mg_levels[level]->memory_consumption ();
- if (mg_faces != 0)
+ if (mg_faces != nullptr)
mem += MemoryConsumption::memory_consumption (*mg_faces);
for (unsigned int i = 0; i < mg_vertex_dofs.size (); ++i)
// only if this is a sequential
// triangulation. it doesn't work
// correctly yet if it is parallel
- if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&*tria) == 0)
+ if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&*tria) == nullptr)
block_info_object.initialize(*this, false, true);
}
// only if this is a sequential
// triangulation. it doesn't work
// correctly yet if it is parallel
- if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&*tria) == 0)
+ if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&*tria) == nullptr)
block_info_object.initialize (*this, true, false);
}
mg_levels.clear ();
delete mg_faces;
- mg_faces = NULL;
+ mg_faces = nullptr;
std::vector<MGVertexDoFs> tmp;
void DoFHandler<dim,spacedim>::clear ()
{
// release lock to old fe
- selected_fe = 0;
+ selected_fe = nullptr;
// release memory
clear_space ();
levels.resize (0);
delete faces;
- faces = 0;
+ faces = nullptr;
std::vector<types::global_dof_index> tmp;
std::swap (vertex_dofs, tmp);
template<int dim, int spacedim>
-DoFHandler<dim, spacedim>::MGVertexDoFs::MGVertexDoFs (): coarsest_level (numbers::invalid_unsigned_int), finest_level (0), indices (0), indices_offset (0)
+DoFHandler<dim, spacedim>::MGVertexDoFs::MGVertexDoFs (): coarsest_level (numbers::invalid_unsigned_int), finest_level (0), indices (nullptr), indices_offset (nullptr)
{
}
template<int dim, int spacedim>
void DoFHandler<dim, spacedim>::MGVertexDoFs::init (const unsigned int cl, const unsigned int fl, const unsigned int dofs_per_vertex)
{
- if (indices != 0)
+ if (indices != nullptr)
{
delete[] indices;
- indices = 0;
+ indices = nullptr;
}
- if (indices_offset != 0)
+ if (indices_offset != nullptr)
{
delete[] indices_offset;
- indices_offset = 0;
+ indices_offset = nullptr;
}
coarsest_level = cl;
const unsigned int n_indices = n_levels * dofs_per_vertex;
indices = new types::global_dof_index[n_indices];
- Assert (indices != 0, ExcNoMemory ());
+ Assert (indices != nullptr, ExcNoMemory ());
for (unsigned int i = 0; i < n_indices; ++i)
indices[i] = DoFHandler<dim, spacedim>::invalid_dof_index;
indices_offset = new types::global_dof_index[n_levels];
- Assert (indices != 0, ExcNoMemory ());
+ Assert (indices != nullptr, ExcNoMemory ());
for (unsigned int i = 0; i < n_levels; ++i)
indices_offset[i] = i * dofs_per_vertex;
// and then turn artificial cells on at the end of this function.
const parallel::shared::Triangulation<dim, spacedim> *tr =
(dynamic_cast<const parallel::shared::Triangulation<dim, spacedim>*> (&dof_handler.get_triangulation()));
- Assert(tr != 0, ExcInternalError());
+ Assert(tr != nullptr, ExcInternalError());
typename parallel::shared::Triangulation<dim,spacedim>::active_cell_iterator
cell = dof_handler.get_triangulation().begin_active(),
endc = dof_handler.get_triangulation().end();
// case artificial cells are present.
const parallel::shared::Triangulation<dim, spacedim> *tr =
(dynamic_cast<const parallel::shared::Triangulation<dim, spacedim>*> (&dof_handler.get_triangulation()));
- Assert(tr != 0, ExcInternalError());
+ Assert(tr != nullptr, ExcInternalError());
typename parallel::shared::Triangulation<dim,spacedim>::active_cell_iterator
cell = dof_handler.get_triangulation().begin_active(),
endc = dof_handler.get_triangulation().end();
const parallel::distributed::Triangulation< dim, spacedim > *tr
= (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof_handler.get_triangulation()));
- Assert (tr != 0, ExcInternalError());
+ Assert (tr != nullptr, ExcInternalError());
// now collect cells and their
// dof_indices for the
= (dynamic_cast<parallel::distributed::Triangulation<dim,spacedim>*>
(const_cast<dealii::Triangulation< dim, spacedim >*>
(&dof_handler.get_triangulation())));
- Assert (tr != 0, ExcInternalError());
+ Assert (tr != nullptr, ExcInternalError());
const unsigned int
n_cpus = Utilities::MPI::n_mpi_processes (tr->get_communicator());
= (dynamic_cast<parallel::distributed::Triangulation<dim,spacedim>*>
(const_cast<dealii::Triangulation< dim, spacedim >*>
(&dof_handler.get_triangulation())));
- Assert (tr != 0, ExcInternalError());
+ Assert (tr != nullptr, ExcInternalError());
AssertThrow(
(tr->settings & parallel::distributed::Triangulation< dim, spacedim >::construct_multigrid_hierarchy),
= (dynamic_cast<parallel::distributed::Triangulation<dim,spacedim>*>
(const_cast<dealii::Triangulation< dim, spacedim >*>
(&dof_handler.get_triangulation())));
- Assert (tr != 0, ExcInternalError());
+ Assert (tr != nullptr, ExcInternalError());
std::vector<bool> user_flags;
tr->save_user_flags(user_flags);
{
Assert ((dynamic_cast<const parallel::distributed::Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
(&dof_handler.get_triangulation())
- == 0),
+ == nullptr),
ExcMessage ("This function can not be used with distributed triangulations."
"See the documentation for more information."));
// ask is for its locally owned subdomain
Assert ((dynamic_cast<const parallel::distributed::
Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> *>
- (&dof_handler.get_triangulation()) == 0),
+ (&dof_handler.get_triangulation()) == nullptr),
ExcMessage ("For parallel::distributed::Triangulation objects and "
"associated DoF handler objects, asking for any information "
"related to a subdomain other than the locally owned one does "
// is non-empty (n_dofs()>0).
const unsigned int n_subdomains
= (dynamic_cast<const parallel::Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> *>
- (&dof_handler.get_triangulation()) == 0
+ (&dof_handler.get_triangulation()) == nullptr
?
(1+*std::max_element (subdomain_association.begin (),
subdomain_association.end ()))
// ask is for its locally owned subdomain
Assert ((dynamic_cast<const parallel::distributed::
Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> *>
- (&dof_handler.get_triangulation()) == 0),
+ (&dof_handler.get_triangulation()) == nullptr),
ExcMessage ("For parallel::distributed::Triangulation objects and "
"associated DoF handler objects, asking for any information "
"related to a subdomain other than the locally owned one does "
// ask is for its locally owned subdomain
Assert ((dynamic_cast<const parallel::distributed::
Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> *>
- (&dof_handler.get_triangulation()) == 0),
+ (&dof_handler.get_triangulation()) == nullptr),
ExcMessage ("For parallel::distributed::Triangulation objects and "
"associated DoF handler objects, asking for any subdomain other "
"than the locally owned one does not make sense."));
Assert ((dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof_handler.get_triangulation())
==
- 0),
+ nullptr),
ExcMessage ("This function can not be used with distributed triangulations."
"See the documentation for more information."));
Assert ((dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof_handler.get_triangulation())
==
- 0),
+ nullptr),
ExcMessage ("This function can not be used with distributed triangulations."
"See the documentation for more information."));
get_fe_collection (const dealii::DoFHandler<dim,spacedim> &)
{
Assert(false, ExcInternalError());
- return NULL;
+ return nullptr;
}
}
// there are only 2 boundary indicators in 1d, so it is no
// performance problem to call the other function
std::map<types::boundary_id, const Function<DoFHandlerType::space_dimension,double>*> boundary_ids;
- boundary_ids[0] = 0;
- boundary_ids[1] = 0;
+ boundary_ids[0] = nullptr;
+ boundary_ids[1] = nullptr;
make_boundary_sparsity_pattern<DoFHandlerType, SparsityPatternType>
(dof,
boundary_ids,
Assert (std::fabs(sum-1) < eps, ExcInternalError());
}
}
- else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != nullptr)
{
// nothing to do here, the FE_Nothing has no degrees of freedom anyway
}
// or if the other one is an FE_Nothing. in the first case, there should be
// exactly one single DoF of each FE at a vertex, and they should have
// identical value
- if (dynamic_cast<const FE_Bernstein<dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_Bernstein<dim,spacedim>*>(&fe_other) != nullptr)
{
return
std::vector<std::pair<unsigned int, unsigned int> >
(1, std::make_pair (0U, 0U));
}
- else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != nullptr)
{
// the FE_Nothing has no degrees of freedom, so there are no
// equivalencies to be recorded
typedef FE_DGP<dim,spacedim> FEDGP;
AssertThrow ((x_source_fe.get_name().find ("FE_DGP<") == 0)
||
- (dynamic_cast<const FEDGP *>(&x_source_fe) != 0),
+ (dynamic_cast<const FEDGP *>(&x_source_fe) != nullptr),
typename FE::
ExcInterpolationNotImplemented());
typedef FE_DGP<dim,spacedim> FEDGP;
AssertThrow ((x_source_fe.get_name().find ("FE_DGP<") == 0)
||
- (dynamic_cast<const FEDGP *>(&x_source_fe) != 0),
+ (dynamic_cast<const FEDGP *>(&x_source_fe) != nullptr),
typename FE::
ExcInterpolationNotImplemented());
hp_vertex_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
{
// there are no such constraints for DGP elements at all
- if (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != nullptr)
return
std::vector<std::pair<unsigned int, unsigned int> > ();
else
hp_line_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
{
// there are no such constraints for DGP elements at all
- if (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != nullptr)
return
std::vector<std::pair<unsigned int, unsigned int> > ();
else
hp_quad_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
{
// there are no such constraints for DGP elements at all
- if (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != nullptr)
return
std::vector<std::pair<unsigned int, unsigned int> > ();
else
{
// check whether both are discontinuous elements, see the description of
// FiniteElementDomination::Domination
- if (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != nullptr)
return FiniteElementDomination::no_requirements;
Assert (false, ExcNotImplemented());
(void)interpolation_matrix;
AssertThrow ((x_source_fe.get_name().find ("FE_DGPMonomial<") == 0)
||
- (dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != 0),
+ (dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != nullptr),
typename FiniteElement<dim>::
ExcInterpolationNotImplemented());
(void)interpolation_matrix;
AssertThrow ((x_source_fe.get_name().find ("FE_DGPMonomial<") == 0)
||
- (dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != 0),
+ (dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != nullptr),
typename FiniteElement<dim>::
ExcInterpolationNotImplemented());
{
// there are no such constraints for DGPMonomial
// elements at all
- if (dynamic_cast<const FE_DGPMonomial<dim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGPMonomial<dim>*>(&fe_other) != nullptr)
return
std::vector<std::pair<unsigned int, unsigned int> > ();
else
{
// there are no such constraints for DGPMonomial
// elements at all
- if (dynamic_cast<const FE_DGPMonomial<dim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGPMonomial<dim>*>(&fe_other) != nullptr)
return
std::vector<std::pair<unsigned int, unsigned int> > ();
else
{
// there are no such constraints for DGPMonomial
// elements at all
- if (dynamic_cast<const FE_DGPMonomial<dim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGPMonomial<dim>*>(&fe_other) != nullptr)
return
std::vector<std::pair<unsigned int, unsigned int> > ();
else
// elements, see
// the description of
// FiniteElementDomination::Domination
- if (dynamic_cast<const FE_DGPMonomial<dim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGPMonomial<dim>*>(&fe_other) != nullptr)
return FiniteElementDomination::no_requirements;
Assert (false, ExcNotImplemented());
typedef FiniteElement<dim,spacedim> FEE;
AssertThrow ((x_source_fe.get_name().find ("FE_DGPNonparametric<") == 0)
||
- (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&x_source_fe) != 0),
+ (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&x_source_fe) != nullptr),
typename FEE::
ExcInterpolationNotImplemented());
typedef FiniteElement<dim,spacedim> FEE;
AssertThrow ((x_source_fe.get_name().find ("FE_DGPNonparametric<") == 0)
||
- (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&x_source_fe) != 0),
+ (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&x_source_fe) != nullptr),
typename FEE::
ExcInterpolationNotImplemented());
{
// there are no such constraints for DGPNonparametric
// elements at all
- if (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&fe_other) != nullptr)
return
std::vector<std::pair<unsigned int, unsigned int> > ();
else
{
// there are no such constraints for DGPNonparametric
// elements at all
- if (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&fe_other) != nullptr)
return
std::vector<std::pair<unsigned int, unsigned int> > ();
else
{
// there are no such constraints for DGPNonparametric
// elements at all
- if (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&fe_other) != nullptr)
return
std::vector<std::pair<unsigned int, unsigned int> > ();
else
// check whether both are discontinuous
// elements, see the description of
// FiniteElementDomination::Domination
- if (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&fe_other) != nullptr)
return FiniteElementDomination::no_requirements;
Assert (false, ExcNotImplemented());
// source FE is also a
// DGQ element
typedef FiniteElement<dim, spacedim> FE;
- AssertThrow ((dynamic_cast<const FE_DGQ<dim, spacedim>*>(&x_source_fe) != 0),
+ AssertThrow ((dynamic_cast<const FE_DGQ<dim, spacedim>*>(&x_source_fe) != nullptr),
typename FE::ExcInterpolationNotImplemented() );
// ok, source is a Q element, so
// much we need to do here.
(void)interpolation_matrix;
typedef FiniteElement<dim,spacedim> FE;
- AssertThrow ((dynamic_cast<const FE_DGQ<dim, spacedim>*>(&x_source_fe) != 0),
+ AssertThrow ((dynamic_cast<const FE_DGQ<dim, spacedim>*>(&x_source_fe) != nullptr),
typename FE::ExcInterpolationNotImplemented());
Assert (interpolation_matrix.m() == 0,
// much we need to do here.
(void)interpolation_matrix;
typedef FiniteElement<dim, spacedim> FE;
- AssertThrow ((dynamic_cast<const FE_DGQ<dim, spacedim>*>(&x_source_fe) != 0),
+ AssertThrow ((dynamic_cast<const FE_DGQ<dim, spacedim>*>(&x_source_fe) != nullptr),
typename FE::ExcInterpolationNotImplemented());
Assert (interpolation_matrix.m() == 0,
{
// start from fe=1 as 0th is always non-enriched FE.
for (unsigned int fe=1; fe < fes.size(); fe++)
- if (dynamic_cast<const FE_Nothing<dim>*>(fes[fe]) == 0)
+ if (dynamic_cast<const FE_Nothing<dim>*>(fes[fe]) == nullptr)
// this is not FE_Nothing => there will be enrichment
return true;
:
FE_Enriched<dim,spacedim>(fe_base,
FE_Nothing<dim,spacedim>(fe_base.n_components(),true),
- NULL)
+ nullptr)
{
}
const UpdateFlags flags,
const Quadrature<dim_1> &quadrature) const
{
- Assert ((dynamic_cast<typename FESystem<dim,spacedim>::InternalData *> (fes_data.get()) != NULL),
+ Assert ((dynamic_cast<typename FESystem<dim,spacedim>::InternalData *> (fes_data.get()) != nullptr),
ExcInternalError());
typename FESystem<dim,spacedim>::InternalData *data_fesystem =
static_cast<typename FESystem<dim,spacedim>::InternalData *> (fes_data.get());
internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data
) const
{
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != NULL,
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr,
ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data
) const
{
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != NULL,
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr,
ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data
) const
{
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != NULL,
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr,
ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
fe_data.enrichment[base_no].size()));
for (unsigned int m=0; m < base_no_mult_local_enriched_dofs[base_no].size(); m++)
{
- Assert (enrichments[base_no-1][m](cell) !=NULL,
+ Assert (enrichments[base_no-1][m](cell) !=nullptr,
ExcMessage("The pointer to the enrichment function is NULL"));
Assert (enrichments[base_no-1][m](cell)->n_components == 1,
Assert (std::fabs(sum-1) < eps, ExcInternalError());
}
}
- else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != nullptr)
{
// nothing to do here, the FE_Nothing has no degrees of freedom anyway
}
}
}
}
- else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != nullptr)
{
// nothing to do here, the FE_Nothing has no degrees of freedom anyway
}
return identities;
}
- else if (dynamic_cast<const FE_Nothing<dim>*> (&fe_other) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*> (&fe_other) != nullptr)
{
// the FE_Nothing has no
// degrees of freedom, so there
return identities;
}
- else if (dynamic_cast<const FE_Nothing<dim>*> (&fe_other) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*> (&fe_other) != nullptr)
{
// the FE_Nothing has no
// degrees of freedom, so there
typedef FiniteElement<dim> FEL;
AssertThrow ((source.get_name ().find ("FE_Nedelec<") == 0) ||
- (dynamic_cast<const FEN *> (&source) != 0),
+ (dynamic_cast<const FEN *> (&source) != nullptr),
typename FEL::ExcInterpolationNotImplemented());
Assert (interpolation_matrix.m () == source.dofs_per_face,
ExcDimensionMismatch (interpolation_matrix.m (),
typedef FiniteElement<dim> FEL;
AssertThrow ((source.get_name ().find ("FE_Nedelec<") == 0) ||
- (dynamic_cast<const FEN *> (&source) != 0),
+ (dynamic_cast<const FEN *> (&source) != nullptr),
typename FEL::ExcInterpolationNotImplemented ());
Assert (interpolation_matrix.m () == source.dofs_per_face,
ExcDimensionMismatch (interpolation_matrix.m (),
return FiniteElementDomination::no_requirements;
}
// if it does and the other is FE_Nothing, either can dominate
- else if (dynamic_cast<const FE_Nothing<dim>*>(&fe) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*>(&fe) != nullptr)
{
return FiniteElementDomination::either_element_can_dominate;
}
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
// transform gradients and higher derivatives. there is nothing to do
// assert that the following dynamics
// cast is really well-defined.
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
// transform gradients and higher derivatives. there is nothing to do
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
// transform gradients and higher derivatives. there is nothing to do
const FiniteElement<2,3>::InternalDataBase &fe_internal,
dealii::internal::FEValues::FiniteElementRelatedData<2,3> &output_data) const
{
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
// transform gradients and higher derivatives. there is nothing to do
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0,
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr,
ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0,
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr,
ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0,
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr,
ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
Assert (std::fabs(sum-1) < eps, ExcInternalError());
}
}
- else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != nullptr)
{
// nothing to do here, the FE_Nothing has no degrees of freedom anyway
}
// if the other one is an FE_Nothing. in the first case, there should be
// exactly one single DoF of each FE at a vertex, and they should have
// identical value
- if (dynamic_cast<const FE_Q_Base<PolynomialType,dim,spacedim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_Q_Base<PolynomialType,dim,spacedim>*>(&fe_other) != nullptr)
{
return
std::vector<std::pair<unsigned int, unsigned int> >
(1, std::make_pair (0U, 0U));
}
- else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != nullptr)
{
// the FE_Nothing has no degrees of freedom, so there are no
// equivalencies to be recorded
return identities;
}
- else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != nullptr)
{
// the FE_Nothing has no degrees of freedom, so there are no
// equivalencies to be recorded
return identities;
}
- else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != nullptr)
{
// the FE_Nothing has no degrees of freedom, so there are no
// equivalencies to be recorded
return FiniteElementDomination::no_requirements;
}
}
- else if ((dynamic_cast<const FE_DGQ<dim,spacedim>*>(&fe_other) != 0)
+ else if ((dynamic_cast<const FE_DGQ<dim,spacedim>*>(&fe_other) != nullptr)
||
- (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != 0))
+ (dynamic_cast<const FE_DGP<dim,spacedim>*>(&fe_other) != nullptr))
{
// there are no requirements between continuous and
// discontinuous elements
Assert(false, ExcInternalError());
}
- Assert(q_fine.get() != NULL, ExcInternalError());
+ Assert(q_fine.get() != nullptr, ExcInternalError());
const unsigned int nq = q_fine->size();
// loop over all possible refinement cases
AssertThrow ((x_source_fe.get_name().find ("FE_Q_Bubbles<") == 0)
||
- (dynamic_cast<const FEQBUBBLES *>(&x_source_fe) != 0)
+ (dynamic_cast<const FEQBUBBLES *>(&x_source_fe) != nullptr)
,
typename FEL::
ExcInterpolationNotImplemented());
AssertThrow ((x_source_fe.get_name().find ("FE_Q_DG0<") == 0)
||
- (dynamic_cast<const FEQDG0 *>(&x_source_fe) != 0),
+ (dynamic_cast<const FEQDG0 *>(&x_source_fe) != nullptr),
typename FEL::
ExcInterpolationNotImplemented());
// single DoF of each FE at a
// vertex, and they should have
// identical value
- if (dynamic_cast<const FE_Q_Hierarchical<dim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_Q_Hierarchical<dim>*>(&fe_other) != nullptr)
{
return
std::vector<std::pair<unsigned int, unsigned int> >
(1, std::make_pair (0U, 0U));
}
- else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != nullptr)
{
// the FE_Nothing has no
// degrees of freedom, so there
// these identities if both FEs are
// FE_Q_Hierarchicals or if the other
// one is an FE_Nothing.
- if (dynamic_cast<const FE_Q_Hierarchical<dim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_Q_Hierarchical<dim>*>(&fe_other) != nullptr)
{
const unsigned int &this_dpl = this->dofs_per_line;
const unsigned int &other_dpl = fe_other.dofs_per_line;
return res;
}
- else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != nullptr)
{
// the FE_Nothing has no
// degrees of freedom, so there
// these identities if both FEs are
// FE_Q_Hierarchicals or if the other
// one is an FE_Nothing.
- if (dynamic_cast<const FE_Q_Hierarchical<dim>*>(&fe_other) != 0)
+ if (dynamic_cast<const FE_Q_Hierarchical<dim>*>(&fe_other) != nullptr)
{
const unsigned int &this_dpq = this->dofs_per_quad;
const unsigned int &other_dpq = fe_other.dofs_per_quad;
return res;
}
- else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim>*>(&fe_other) != nullptr)
{
// the FE_Nothing has no
// degrees of freedom, so there
typedef FiniteElement<dim> FEL;
AssertThrow ((x_source_fe.get_name().find ("FE_Q_Hierarchical<") == 0)
||
- (dynamic_cast<const FEQHierarchical *>(&x_source_fe) != 0),
+ (dynamic_cast<const FEQHierarchical *>(&x_source_fe) != nullptr),
typename FEL::
ExcInterpolationNotImplemented());
typedef FiniteElement<dim> FEL;
AssertThrow ((x_source_fe.get_name().find ("FE_Q_Hierarchical<") == 0)
||
- (dynamic_cast<const FEQHierarchical *>(&x_source_fe) != 0),
+ (dynamic_cast<const FEQHierarchical *>(&x_source_fe) != nullptr),
typename FEL::
ExcInterpolationNotImplemented());
// FE_RaviartThomasNodals. in that case, no
// dofs are assigned on the vertex, so we
// shouldn't be getting here at all.
- if (dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&fe_other)!=0)
+ if (dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&fe_other)!=nullptr)
return std::vector<std::pair<unsigned int, unsigned int> > ();
else
{
// RaviartThomasNodal element
AssertThrow ((x_source_fe.get_name().find ("FE_RaviartThomasNodal<") == 0)
||
- (dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&x_source_fe) != 0),
+ (dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&x_source_fe) != nullptr),
typename FiniteElement<dim>::
ExcInterpolationNotImplemented());
// RaviartThomasNodal element
AssertThrow ((x_source_fe.get_name().find ("FE_RaviartThomasNodal<") == 0)
||
- (dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&x_source_fe) != 0),
+ (dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&x_source_fe) != nullptr),
typename FiniteElement<dim>::
ExcInterpolationNotImplemented());
if (base_fe_datas[i])
{
delete base_fe_datas[i];
- base_fe_datas[i] = 0;
+ base_fe_datas[i] = nullptr;
}
}
typedef FiniteElement<dim,spacedim> FEL;
AssertThrow ((x_source_fe.get_name().find ("FESystem<") == 0)
||
- (dynamic_cast<const FESystem<dim,spacedim>*>(&x_source_fe) != 0),
+ (dynamic_cast<const FESystem<dim,spacedim>*>(&x_source_fe) != nullptr),
typename FEL::
ExcInterpolationNotImplemented());
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&fe_internal) != nullptr, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
// Either dim_1==dim
// fill_fe_face_values needs argument Quadrature<dim-1> for both cases
// dim_1==dim-1 and dim_1=dim. Hence the following workaround
- const Quadrature<dim> *cell_quadrature = 0;
- const Quadrature<dim-1> *face_quadrature = 0;
+ const Quadrature<dim> *cell_quadrature = nullptr;
+ const Quadrature<dim-1> *face_quadrature = nullptr;
const unsigned int n_q_points = quadrature.size();
// static cast to the common base class of quadrature being either
if (face_no==invalid_face_number)
{
Assert(dim_1==dim, ExcDimensionMismatch(dim_1,dim));
- Assert (dynamic_cast<const Quadrature<dim> *>(quadrature_base_pointer) != 0,
+ Assert (dynamic_cast<const Quadrature<dim> *>(quadrature_base_pointer) != nullptr,
ExcInternalError());
cell_quadrature
else
{
Assert(dim_1==dim-1, ExcDimensionMismatch(dim_1,dim-1));
- Assert (dynamic_cast<const Quadrature<dim-1> *>(quadrature_base_pointer) != 0,
+ Assert (dynamic_cast<const Quadrature<dim-1> *>(quadrature_base_pointer) != nullptr,
ExcInternalError());
face_quadrature
typedef FiniteElement<dim,spacedim> FEL;
AssertThrow ((x_source_fe.get_name().find ("FE_System<") == 0)
||
- (dynamic_cast<const FESystem<dim,spacedim>*>(&x_source_fe) != 0),
+ (dynamic_cast<const FESystem<dim,spacedim>*>(&x_source_fe) != nullptr),
typename FEL::
ExcInterpolationNotImplemented());
typedef FiniteElement<dim,spacedim> FEL;
AssertThrow ((x_source_fe.get_name().find ("FE_System<") == 0)
||
- (dynamic_cast<const FESystem<dim,spacedim>*>(&x_source_fe) != 0),
+ (dynamic_cast<const FESystem<dim,spacedim>*>(&x_source_fe) != nullptr),
typename FEL::
ExcInterpolationNotImplemented());
FEFactory<FE>::get (const Quadrature<1> &) const
{
Assert(false, ExcNotImplemented());
- return 0;
+ return nullptr;
}
// Specializations for FE_Q.
// everything went ok. so
// generate the composed
// element
- FiniteElement<dim,spacedim> *system_element = 0;
+ FiniteElement<dim,spacedim> *system_element = nullptr;
// uses new FESystem constructor
// which is independent of
// make some compilers happy that
// do not realize that we can't get
// here after throwing
- return 0;
+ return nullptr;
}
AssertThrow(false, ExcInvalidFEName(parameter_name
+ std::string(" at ")
+ errline));
- return 0;
+ return nullptr;
}
}
= (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof2.get_tria()));
- Assert (tr != 0, ExcInternalError());
+ Assert (tr != nullptr, ExcInternalError());
typename DoFHandler<dim,spacedim>::cell_iterator
cell=dof2.begin(0),
= (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof2.get_tria()));
- Assert (tr != 0, ExcInternalError());
+ Assert (tr != nullptr, ExcInternalError());
// collect in a set all trees this
// process has to compute cells on
= (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof2.get_tria()));
- Assert (tr != 0,
+ Assert (tr != nullptr,
ExcMessage ("Extrapolate in parallel only works for parallel distributed triangulations!"));
communicator = tr->get_communicator ();
{
const parallel::distributed::Triangulation<dim,spacedim> *parallel_tria =
dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&dh.get_tria());
- Assert (parallel_tria !=0, ExcNotImplemented());
+ Assert (parallel_tria !=nullptr, ExcNotImplemented());
const IndexSet locally_owned_dofs = dh.locally_owned_dofs();
vector.reinit(locally_owned_dofs, parallel_tria->get_communicator());
{
const parallel::distributed::Triangulation<dim,spacedim> *parallel_tria =
dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&dh.get_tria());
- Assert (parallel_tria !=0, ExcNotImplemented());
+ Assert (parallel_tria !=nullptr, ExcNotImplemented());
const IndexSet locally_owned_dofs = dh.locally_owned_dofs();
vector.reinit(locally_owned_dofs, parallel_tria->get_communicator());
{
const parallel::distributed::Triangulation<dim,spacedim> *parallel_tria =
dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&dh.get_tria());
- Assert (parallel_tria !=0, ExcNotImplemented());
+ Assert (parallel_tria !=nullptr, ExcNotImplemented());
const IndexSet locally_owned_dofs = dh.locally_owned_dofs();
vector.reinit(locally_owned_dofs, parallel_tria->get_communicator());
{
const parallel::distributed::Triangulation<dim,spacedim> *parallel_tria =
dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&dh.get_tria());
- Assert(parallel_tria !=0, ExcNotImplemented());
+ Assert(parallel_tria !=nullptr, ExcNotImplemented());
const IndexSet locally_owned_dofs = dh.locally_owned_dofs();
IndexSet locally_relevant_dofs;
DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs);
{
const parallel::distributed::Triangulation<dim,spacedim> *parallel_tria =
dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&dh.get_tria());
- Assert (parallel_tria !=0, ExcNotImplemented());
+ Assert (parallel_tria !=nullptr, ExcNotImplemented());
const IndexSet locally_owned_dofs = dh.locally_owned_dofs();
IndexSet locally_relevant_dofs;
DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs);
{
const parallel::distributed::Triangulation<dim,spacedim> *parallel_tria =
dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&dh.get_tria());
- Assert (parallel_tria !=0, ExcNotImplemented());
+ Assert (parallel_tria !=nullptr, ExcNotImplemented());
const IndexSet locally_owned_dofs = dh.locally_owned_dofs();
IndexSet locally_relevant_dofs;
DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs);
OutVector u3;
internal::reinit_distributed(dof2, u3);
- if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&dof2.get_tria()) != 0)
+ if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&dof2.get_tria()) != nullptr)
{
interpolate(dof1, u1, dof2, constraints, u3);
// matrix for this particular
// pair of elements is already
// there
- if (interpolation_matrices[&cell1->get_fe()][&cell2->get_fe()].get() == 0)
+ if (interpolation_matrices[&cell1->get_fe()][&cell2->get_fe()].get() == nullptr)
{
std::shared_ptr<FullMatrix<double> >
interpolation_matrix (new FullMatrix<double> (dofs_per_cell2,
// make sure back_interpolation
// matrix is available
- if (interpolation_matrices[&cell->get_fe()] == 0)
+ if (interpolation_matrices[&cell->get_fe()] == nullptr)
{
interpolation_matrices[&cell->get_fe()] =
std::shared_ptr<FullMatrix<double> >
{
fe_q.get_subface_interpolation_matrix (source_fe->fe_q, subface, interpolation_matrix);
}
- else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != 0)
+ else if (dynamic_cast<const FE_Nothing<dim> *>(&x_source_fe) != nullptr)
{
// nothing to do here, the FE_Nothing has no degrees of freedom anyway
}
template <int dim, int spacedim>
Scalar<dim,spacedim>::Scalar ()
:
- fe_values (NULL),
+ fe_values (nullptr),
component (numbers::invalid_unsigned_int)
{}
template <int dim, int spacedim>
Vector<dim,spacedim>::Vector ()
:
- fe_values (NULL),
+ fe_values (nullptr),
first_vector_component (numbers::invalid_unsigned_int)
{}
template <int dim, int spacedim>
SymmetricTensor<2, dim, spacedim>::SymmetricTensor()
:
- fe_values(NULL),
+ fe_values(nullptr),
first_tensor_component(numbers::invalid_unsigned_int)
{}
template <int dim, int spacedim>
Tensor<2, dim, spacedim>::Tensor()
:
- fe_values(NULL),
+ fe_values(nullptr),
first_tensor_component(numbers::invalid_unsigned_int)
{}
{
Assert (fe_values->update_flags & update_values,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_values")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert (fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert (fe_values->update_flags & update_hessians,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_hessians")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert (fe_values->update_flags & update_hessians,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_hessians")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert (fe_values->update_flags & update_3rd_derivatives,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_3rd_derivatives")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert (fe_values->update_flags & update_values,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_values")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert (fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert (fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert (fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert (fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
- Assert (fe_values->present_cell.get () != 0,
+ Assert (fe_values->present_cell.get () != nullptr,
ExcMessage ("FEValues object is not reinited to any cell"));
AssertDimension (fe_function.size (),
fe_values->present_cell->n_dofs_for_dof_handler ());
{
Assert (fe_values->update_flags & update_hessians,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_hessians")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_hessians")));
Assert (laplacians.size() == fe_values->n_quadrature_points,
ExcDimensionMismatch(laplacians.size(), fe_values->n_quadrature_points));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
Assert (fe_function.size() == fe_values->present_cell->n_dofs_for_dof_handler(),
ExcDimensionMismatch(fe_function.size(),
{
Assert (fe_values->update_flags & update_3rd_derivatives,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_3rd_derivatives")));
- Assert (fe_values->present_cell.get() != 0,
+ Assert (fe_values->present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert(fe_values->update_flags & update_values,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_values")));
- Assert(fe_values->present_cell.get() != 0,
+ Assert(fe_values->present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
AssertDimension(fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
- Assert(fe_values->present_cell.get() != 0,
+ Assert(fe_values->present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
AssertDimension(fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert(fe_values->update_flags & update_values,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_values")));
- Assert(fe_values->present_cell.get() != 0,
+ Assert(fe_values->present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
AssertDimension(fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
{
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
- Assert(fe_values->present_cell.get() != 0,
+ Assert(fe_values->present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
AssertDimension(fe_function.size(),
fe_values->present_cell->n_dofs_for_dof_handler());
Assert (this->update_flags & update_values,
ExcAccessToUninitializedField("update_values"));
AssertDimension (fe->n_components(), 1);
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(),
present_cell->n_dofs_for_dof_handler());
std::vector<Vector<typename InputVector::value_type> > &values) const
{
typedef typename InputVector::value_type Number;
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
Assert (this->update_flags & update_values,
Assert (this->update_flags & update_gradients,
ExcAccessToUninitializedField("update_gradients"));
AssertDimension (fe->n_components(), 1);
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
typedef typename InputVector::value_type Number;
Assert (this->update_flags & update_gradients,
ExcAccessToUninitializedField("update_gradients"));
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
AssertDimension (fe->n_components(), 1);
Assert (this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
typedef typename InputVector::value_type Number;
Assert (this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
Assert (this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
AssertDimension (fe->n_components(), 1);
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
std::vector<Vector<typename InputVector::value_type> > &laplacians) const
{
typedef typename InputVector::value_type Number;
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
Assert (this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
AssertDimension (fe->n_components(), 1);
Assert (this->update_flags & update_3rd_derivatives,
ExcAccessToUninitializedField("update_3rd_derivatives"));
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
typedef typename InputVector::value_type Number;
Assert (this->update_flags & update_3rd_derivatives,
ExcAccessToUninitializedField("update_3rd_derivatives"));
- Assert (present_cell.get() != 0,
+ Assert (present_cell.get() != nullptr,
ExcMessage ("FEValues object is not reinit'ed to any cell"));
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
{
// if there is no present cell, then we shouldn't be
// connected via a signal to a triangulation
- Assert (present_cell.get() != 0, ExcInternalError());
+ Assert (present_cell.get() != nullptr, ExcInternalError());
// so delete the present cell and
// disconnect from the signal we have with
FEValuesBase< dim, spacedim >::
maybe_invalidate_previous_present_cell (const typename Triangulation<dim,spacedim>::cell_iterator &cell)
{
- if (present_cell.get() != 0)
+ if (present_cell.get() != nullptr)
{
if (&cell->get_triangulation() !=
&present_cell->operator typename Triangulation<dim,spacedim>::cell_iterator()
}
// case that there has not been any cell before
- if (this->present_cell.get() == 0)
+ if (this->present_cell.get() == nullptr)
cell_similarity = CellSimilarity::none;
else
// in MappingQ, data can have been modified during the last call. Then, we
{
// convert data object to internal data for this class. fails with
// an exception if that is not possible
- Assert (dynamic_cast<const InternalData *> (&internal_data) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&internal_data) != nullptr, ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (internal_data);
std::vector<Tensor<1,dim> > dummy;
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<const InternalData *> (&internal_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&internal_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (internal_data);
{
// convert data object to internal data for this class. fails with
// an exception if that is not possible
- Assert (dynamic_cast<const InternalData *> (&internal_data) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&internal_data) != nullptr, ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (internal_data);
compute_fill (cell, face_no, subface_no, CellSimilarity::none,
const ArrayView<Tensor<1,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (mapping_data);
const ArrayView<Tensor<2,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &>(mapping_data);
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &>(mapping_data);
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &>(mapping_data);
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &>(mapping_data);
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<const InternalData *> (&internal_data) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&internal_data) != nullptr, ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (internal_data);
const unsigned int n_q_points=quadrature.size();
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<const InternalData *> (&internal_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&internal_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (internal_data);
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<const InternalData *> (&internal_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&internal_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (internal_data);
const ArrayView<Tensor<rank,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::InternalData
&data = static_cast<const typename MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::InternalData &>(mapping_data);
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::InternalData
&data = static_cast<const typename MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::InternalData &>(mapping_data);
const ArrayView<Tensor<3,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &>(mapping_data);
(const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const typename MappingFEField<dim, spacedim,VectorType,DoFHandlerType>::InternalData &data) const
{
- Assert(euler_dof_handler != 0, ExcMessage("euler_dof_handler is empty"));
+ Assert(euler_dof_handler != nullptr, ExcMessage("euler_dof_handler is empty"));
typename DoFHandlerType::cell_iterator dof_cell(*cell, euler_dof_handler);
Assert (dof_cell->active() == true, ExcInactiveCell());
internal::FEValues::MappingRelatedData<dim,spacedim> &output_data) const
{
// ensure that the following static_cast is really correct:
- Assert (dynamic_cast<const InternalData *>(&internal_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&internal_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &>(internal_data);
internal::FEValues::MappingRelatedData<dim,spacedim> &output_data) const
{
// ensure that the following cast is really correct:
- Assert ((dynamic_cast<const InternalData *>(&internal_data) != 0),
+ Assert ((dynamic_cast<const InternalData *>(&internal_data) != nullptr),
ExcInternalError());
const InternalData &data
= static_cast<const InternalData &>(internal_data);
internal::FEValues::MappingRelatedData<dim,spacedim> &output_data) const
{
// ensure that the following cast is really correct:
- Assert ((dynamic_cast<const InternalData *>(&internal_data) != 0),
+ Assert ((dynamic_cast<const InternalData *>(&internal_data) != nullptr),
ExcInternalError());
const InternalData &data
= static_cast<const InternalData &>(internal_data);
const ArrayView<Tensor<rank,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingManifold<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingManifold<dim,spacedim>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingManifold<dim,spacedim>::InternalData
&data = static_cast<const typename MappingManifold<dim,spacedim>::InternalData &>(mapping_data);
const ArrayView<Tensor<rank,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingManifold<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingManifold<dim,spacedim>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingManifold<dim,spacedim>::InternalData
&data = static_cast<const typename MappingManifold<dim,spacedim>::InternalData &>(mapping_data);
const ArrayView<Tensor<3,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingManifold<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingManifold<dim,spacedim>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingManifold<dim,spacedim>::InternalData
&data = static_cast<const typename MappingManifold<dim,spacedim>::InternalData &>(mapping_data);
const ArrayView<Tensor<rank+1, spacedim> > &output)
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingManifold<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingManifold<dim,spacedim>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingManifold<dim,spacedim>::InternalData
&data = static_cast<const typename MappingManifold<dim,spacedim>::InternalData &>(mapping_data);
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &>(mapping_data);
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<const InternalData *> (&internal_data) != 0, ExcInternalError());
+ Assert (dynamic_cast<const InternalData *> (&internal_data) != nullptr, ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (internal_data);
// check whether this cell needs the full mapping or can be treated by a
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<const InternalData *> (&internal_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&internal_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (internal_data);
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<const InternalData *> (&internal_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&internal_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &> (internal_data);
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
- != 0),
+ != nullptr),
ExcInternalError());
const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data);
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
- != 0),
+ != nullptr),
ExcInternalError());
const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data);
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
- != 0),
+ != nullptr),
ExcInternalError());
const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data);
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
- != 0),
+ != nullptr),
ExcInternalError());
const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data);
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
- != 0),
+ != nullptr),
ExcInternalError());
const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data);
:
polynomial_degree(p),
line_support_points(this->polynomial_degree+1),
- fe_q(dim == 3 ? new FE_Q<dim>(this->polynomial_degree) : 0),
+ fe_q(dim == 3 ? new FE_Q<dim>(this->polynomial_degree) : nullptr),
support_point_weights_perimeter_to_interior (compute_support_point_weights_perimeter_to_interior(this->polynomial_degree, dim)),
support_point_weights_cell (compute_support_point_weights_cell<dim>(this->polynomial_degree))
{
:
polynomial_degree(mapping.polynomial_degree),
line_support_points(mapping.line_support_points),
- fe_q(dim == 3 ? new FE_Q<dim>(*mapping.fe_q) : 0),
+ fe_q(dim == 3 ? new FE_Q<dim>(*mapping.fe_q) : nullptr),
support_point_weights_perimeter_to_interior (mapping.support_point_weights_perimeter_to_interior),
support_point_weights_cell (mapping.support_point_weights_cell)
{}
internal::FEValues::MappingRelatedData<dim,spacedim> &output_data) const
{
// ensure that the following static_cast is really correct:
- Assert (dynamic_cast<const InternalData *>(&internal_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&internal_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &>(internal_data);
internal::FEValues::MappingRelatedData<dim,spacedim> &output_data) const
{
// ensure that the following cast is really correct:
- Assert ((dynamic_cast<const InternalData *>(&internal_data) != 0),
+ Assert ((dynamic_cast<const InternalData *>(&internal_data) != nullptr),
ExcInternalError());
const InternalData &data
= static_cast<const InternalData &>(internal_data);
internal::FEValues::MappingRelatedData<dim,spacedim> &output_data) const
{
// ensure that the following cast is really correct:
- Assert ((dynamic_cast<const InternalData *>(&internal_data) != 0),
+ Assert ((dynamic_cast<const InternalData *>(&internal_data) != nullptr),
ExcInternalError());
const InternalData &data
= static_cast<const InternalData &>(internal_data);
const ArrayView<Tensor<rank,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingQGeneric<dim,spacedim>::InternalData
&data = static_cast<const typename MappingQGeneric<dim,spacedim>::InternalData &>(mapping_data);
const ArrayView<Tensor<rank,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingQGeneric<dim,spacedim>::InternalData
&data = static_cast<const typename MappingQGeneric<dim,spacedim>::InternalData &>(mapping_data);
const ArrayView<Tensor<3,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingQGeneric<dim,spacedim>::InternalData
&data = static_cast<const typename MappingQGeneric<dim,spacedim>::InternalData &>(mapping_data);
const ArrayView<Tensor<rank+1, spacedim> > &output)
{
AssertDimension (input.size(), output.size());
- Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+ Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != nullptr),
ExcInternalError());
const typename MappingQGeneric<dim,spacedim>::InternalData
&data = static_cast<const typename MappingQGeneric<dim,spacedim>::InternalData &>(mapping_data);
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
ExcInternalError());
const InternalData &data = static_cast<const InternalData &>(mapping_data);
// the triangulation if no manifold is assigned).
const Boundary<3,3> *boundary =
dynamic_cast<const Boundary<3,3> *>(&face->get_manifold());
- if (boundary != NULL &&
+ if (boundary != nullptr &&
std::string(typeid(*boundary).name()).find("StraightBoundary") ==
std::string::npos)
{
Assert (GridTools::have_same_coarse_mesh (triangulation_1, triangulation_2),
ExcMessage ("The two input triangulations are not derived from "
"the same coarse mesh as required."));
- Assert ((dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&triangulation_1) == 0)
+ Assert ((dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&triangulation_1) == nullptr)
&&
- (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&triangulation_2) == 0),
+ (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&triangulation_2) == nullptr),
ExcMessage ("The source triangulations for this function must both "
"be available entirely locally, and not be distributed "
"triangulations."));
dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim1> *>(&in_tria);
(void)pt;
- Assert (pt == NULL,
+ Assert (pt == nullptr,
ExcMessage("Cannot use this function on parallel::distributed::Triangulation."));
std::vector<Point<spacedim2> > v;
{
Assert ((dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&volume_mesh.get_triangulation())
- == 0),
+ == nullptr),
ExcNotImplemented());
// This function works using the following assumption:
template <int dim, int spacedim>
GridIn<dim, spacedim>::GridIn () :
- tria(0, typeid(*this).name()), default_format(ucd)
+ tria(nullptr, typeid(*this).name()), default_format(ucd)
{}
template<int dim, int spacedim>
void GridIn<dim, spacedim>::read_unv(std::istream &in)
{
- Assert(tria != 0, ExcNoTriangulationSelected());
+ Assert(tria != nullptr, ExcNoTriangulationSelected());
Assert((dim == 2)||(dim == 3), ExcNotImplemented());
AssertThrow(in, ExcIO());
void GridIn<dim, spacedim>::read_ucd (std::istream &in,
const bool apply_all_indicators_to_manifolds)
{
- Assert (tria != 0, ExcNoTriangulationSelected());
+ Assert (tria != nullptr, ExcNoTriangulationSelected());
AssertThrow (in, ExcIO());
// skip comments at start of file
void GridIn<dim, spacedim>::read_abaqus (std::istream &in,
const bool apply_all_indicators_to_manifolds)
{
- Assert (tria != 0, ExcNoTriangulationSelected());
+ Assert (tria != nullptr, ExcNoTriangulationSelected());
Assert (dim==2 || dim==3, ExcNotImplemented());
AssertThrow (in, ExcIO());
template <int dim, int spacedim>
void GridIn<dim, spacedim>::read_dbmesh (std::istream &in)
{
- Assert (tria != 0, ExcNoTriangulationSelected());
+ Assert (tria != nullptr, ExcNoTriangulationSelected());
Assert (dim==2, ExcNotImplemented());
AssertThrow (in, ExcIO());
template <>
void GridIn<2>::read_xda (std::istream &in)
{
- Assert (tria != 0, ExcNoTriangulationSelected());
+ Assert (tria != nullptr, ExcNoTriangulationSelected());
AssertThrow (in, ExcIO());
std::string line;
template <>
void GridIn<3>::read_xda (std::istream &in)
{
- Assert (tria != 0, ExcNoTriangulationSelected());
+ Assert (tria != nullptr, ExcNoTriangulationSelected());
AssertThrow (in, ExcIO());
static const unsigned int xda_to_dealII_map[] = {0,1,5,4,3,2,6,7};
template <int dim, int spacedim>
void GridIn<dim, spacedim>::read_msh (std::istream &in)
{
- Assert (tria != 0, ExcNoTriangulationSelected());
+ Assert (tria != nullptr, ExcNoTriangulationSelected());
AssertThrow (in, ExcIO());
unsigned int n_vertices;
{
const unsigned int dim=2;
const unsigned int spacedim=2;
- Assert (tria != 0, ExcNoTriangulationSelected());
+ Assert (tria != nullptr, ExcNoTriangulationSelected());
AssertThrow (in, ExcIO());
// skip comments at start of file
// block this to have local
// variables destroyed after
// use
- std::time_t time1= std::time (0);
+ std::time_t time1= std::time (nullptr);
std::tm *time = std::localtime(&time1);
out << "# This file was generated by the deal.II library." << '\n'
<< "# Date = "
if (true)
{
// block this to have local variables destroyed after use
- const std::time_t time1 = std::time (0);
+ const std::time_t time1 = std::time (nullptr);
const std::tm *time = std::localtime (&time1);
out << "\n#"
// quadrature formula which will be
// used to probe boundary points at
// curved faces
- Quadrature<dim> *q_projector=0;
+ Quadrature<dim> *q_projector=nullptr;
std::vector<Point<dim-1> > boundary_points;
- if (mapping!=0)
+ if (mapping!=nullptr)
{
boundary_points.resize(n_points);
boundary_points[0][0]=0;
if (gnuplot_flags.write_cell_numbers)
out << "# cell " << cell << '\n';
- if (mapping==0 ||
+ if (mapping==nullptr ||
(!cell->at_boundary() && !gnuplot_flags.curved_inner_cells))
{
// write out the four sides
}
}
- if (q_projector != 0)
+ if (q_projector != nullptr)
delete q_projector;
// make sure everything now gets to
// quadrature formula which will be
// used to probe boundary points at
// curved faces
- Quadrature<dim> *q_projector=0;
+ Quadrature<dim> *q_projector=nullptr;
std::vector<Point<1> > boundary_points;
- if (mapping!=0)
+ if (mapping!=nullptr)
{
boundary_points.resize(n_points);
boundary_points[0][0]=0;
if (gnuplot_flags.write_cell_numbers)
out << "# cell " << cell << '\n';
- if (mapping==0 || n_points==2 ||
+ if (mapping==nullptr || n_points==2 ||
(!cell->has_boundary_lines() && !gnuplot_flags.curved_inner_cells))
{
// front face
}
}
- if (q_projector != 0)
+ if (q_projector != nullptr)
delete q_projector;
// treat all other
// lines
if (!line->has_children() &&
- (mapping==0 || !line->at_boundary()))
+ (mapping==nullptr || !line->at_boundary()))
// one would expect
// make_pair(line->vertex(0),
// line->vertex(1))
// to the list consisting of
// pieces of the boundary
// lines
- if (mapping!=0)
+ if (mapping!=nullptr)
{
// to do so, first
// generate a sequence of
{
// curved boundary output
// presently not supported
- Assert (mapping == 0, ExcNotImplemented());
+ Assert (mapping == nullptr, ExcNotImplemented());
typename dealii::Triangulation<dim, spacedim>::active_cell_iterator
cell=tria.begin_active(),
// block this to have local
// variables destroyed after
// use
- std::time_t time1= std::time (0);
+ std::time_t time1= std::time (nullptr);
std::tm *time = std::localtime(&time1);
out << "%!PS-Adobe-2.0 EPSF-1.2" << '\n'
<< "%%Title: deal.II Output" << '\n'
{
// get the degree of the mapping if possible. if not, just assume 1
const unsigned int mapping_degree
- = (dynamic_cast<const MappingQ<dim,spacedim>*>(&mapping) != 0 ?
+ = (dynamic_cast<const MappingQ<dim,spacedim>*>(&mapping) != nullptr ?
dynamic_cast<const MappingQ<dim,spacedim>*>(&mapping)->get_degree() :
1);
{
Assert ((dynamic_cast<parallel::distributed::Triangulation<dim,spacedim>*>
(&triangulation)
- == 0),
+ == nullptr),
ExcMessage ("Objects of type parallel::distributed::Triangulation "
"are already partitioned implicitly and can not be "
"partitioned again explicitly."));
{
Assert ((dynamic_cast<parallel::distributed::Triangulation<dim,spacedim>*>
(&triangulation)
- == 0),
+ == nullptr),
ExcMessage ("Objects of type parallel::distributed::Triangulation "
"are already partitioned implicitly and can not be "
"partitioned again explicitly."));
{
Assert ((dynamic_cast<parallel::distributed::Triangulation<dim,spacedim>*>
(&triangulation)
- == 0),
+ == nullptr),
ExcMessage ("Objects of type parallel::distributed::Triangulation "
"are already partitioned implicitly and can not be "
"partitioned again explicitly."));
Iterator::AccessorType::space_dimension>
*manifold = (respect_manifold ?
&object->get_boundary() :
- 0);
+ nullptr);
const unsigned int structdim = Iterator::AccessorType::structure_dimension;
const unsigned int spacedim = Iterator::AccessorType::space_dimension;
template <class MeshType>
InterGridMap<MeshType>::InterGridMap ()
:
- source_grid(0, typeid(*this).name()),
- destination_grid(0, typeid(*this).name())
+ source_grid(nullptr, typeid(*this).name()),
+ destination_grid(nullptr, typeid(*this).name())
{}
void InterGridMap<MeshType>::clear ()
{
mapping.clear ();
- source_grid = 0;
- destination_grid = 0;
+ source_grid = nullptr;
+ destination_grid = nullptr;
}
if (owns_pointers == true)
{
const Function<chartdim> *pf = push_forward_function;
- push_forward_function = 0;
+ push_forward_function = nullptr;
delete pf;
const Function<spacedim> *pb = pull_back_function;
- pull_back_function = 0;
+ pull_back_function = nullptr;
delete pb;
}
}
case RefinementCase<dim>::cut_x:
{
const typename Triangulation<dim,spacedim>::raw_line_iterator
- *lines = NULL;
- const unsigned int *line_indices = NULL;
- const bool *line_orientation = NULL;
- const int *quad_indices = NULL;
+ *lines = nullptr;
+ const unsigned int *line_indices = nullptr;
+ const bool *line_orientation = nullptr;
+ const int *quad_indices = nullptr;
//////////////////////////////
//
case RefinementCase<dim>::cut_y:
{
const typename Triangulation<dim,spacedim>::raw_line_iterator
- *lines = NULL;
- const unsigned int *line_indices = NULL;
- const bool *line_orientation = NULL;
- const int *quad_indices = NULL;
+ *lines = nullptr;
+ const unsigned int *line_indices = nullptr;
+ const bool *line_orientation = nullptr;
+ const int *quad_indices = nullptr;
//////////////////////////////
//
case RefinementCase<dim>::cut_z:
{
const typename Triangulation<dim,spacedim>::raw_line_iterator
- *lines = NULL;
- const unsigned int *line_indices = NULL;
- const bool *line_orientation = NULL;
- const int *quad_indices = NULL;
+ *lines = nullptr;
+ const unsigned int *line_indices = nullptr;
+ const bool *line_orientation = nullptr;
+ const int *quad_indices = nullptr;
//////////////////////////////
//
case RefinementCase<dim>::cut_xy:
{
const typename Triangulation<dim,spacedim>::raw_line_iterator
- *lines = NULL;
- const unsigned int *line_indices = NULL;
- const bool *line_orientation = NULL;
- const int *quad_indices = NULL;
+ *lines = nullptr;
+ const unsigned int *line_indices = nullptr;
+ const bool *line_orientation = nullptr;
+ const int *quad_indices = nullptr;
//////////////////////////////
//
case RefinementCase<dim>::cut_xz:
{
const typename Triangulation<dim,spacedim>::raw_line_iterator
- *lines = NULL;
- const unsigned int *line_indices = NULL;
- const bool *line_orientation = NULL;
- const int *quad_indices = NULL;
+ *lines = nullptr;
+ const unsigned int *line_indices = nullptr;
+ const bool *line_orientation = nullptr;
+ const int *quad_indices = nullptr;
//////////////////////////////
//
case RefinementCase<dim>::cut_yz:
{
const typename Triangulation<dim,spacedim>::raw_line_iterator
- *lines = NULL;
- const unsigned int *line_indices = NULL;
- const bool *line_orientation = NULL;
- const int *quad_indices = NULL;
+ *lines = nullptr;
+ const unsigned int *line_indices = nullptr;
+ const bool *line_orientation = nullptr;
+ const int *quad_indices = nullptr;
//////////////////////////////
//
case RefinementCase<dim>::cut_xyz:
{
const typename Triangulation<dim,spacedim>::raw_line_iterator
- *lines = NULL;
- const unsigned int *vertex_indices = NULL;
- const unsigned int *line_indices = NULL;
- const bool *line_orientation = NULL;
- const int *quad_indices = NULL;
+ *lines = nullptr;
+ const unsigned int *vertex_indices = nullptr;
+ const unsigned int *line_indices = nullptr;
+ const bool *line_orientation = nullptr;
+ const int *quad_indices = nullptr;
//////////////////////////////
//
if (levels[i])
{
delete levels[i];
- levels[i] = 0;
+ levels[i] = nullptr;
}
levels.clear ();
// this object makes sense
Assert ((dim == 1)
||
- (vertex_to_boundary_id_map_1d == 0),
+ (vertex_to_boundary_id_map_1d == nullptr),
ExcInternalError());
// the vertex_to_manifold_id_map_1d field should be also unused
// except in 1d. check this as well
Assert ((dim == 1)
||
- (vertex_to_manifold_id_map_1d == 0),
+ (vertex_to_manifold_id_map_1d == nullptr),
ExcInternalError());
}
{
const Boundary<dim, spacedim> *man =
dynamic_cast<const Boundary<dim, spacedim> *>(&get_manifold(m_number));
- Assert(man != NULL,
+ Assert(man != nullptr,
ExcMessage("You tried to get a Boundary, but I only have a Manifold."));
return *man;
{
Assert ((vertices.size() == 0) &&
(levels.size () == 0) &&
- (faces == NULL),
+ (faces == nullptr),
ExcTriangulationNotEmpty(vertices.size(), levels.size()));
Assert ((other_tria.levels.size() != 0) &&
(other_tria.vertices.size() != 0) &&
- (dim == 1 || other_tria.faces != NULL),
+ (dim == 1 || other_tria.faces != nullptr),
ExcMessage("When calling Triangulation::copy_triangulation(), "
"the target triangulation must be empty but the source "
"triangulation (the argument to this function) must contain "
{
Assert ((vertices.size() == 0) &&
(levels.size () == 0) &&
- (faces == NULL),
+ (faces == nullptr),
ExcTriangulationNotEmpty(vertices.size(), levels.size()));
// check that no forbidden arrays
// are used
void *get_user_pointer (const TriaIterator<InvalidAccessor<structdim,dim,spacedim> > &)
{
Assert (false, ExcInternalError());
- return 0;
+ return nullptr;
}
template <int dim, int spacedim>
void Triangulation<dim, spacedim>::save_user_pointers_line (std::vector<void *> &v) const
{
- v.resize (n_lines(), 0);
+ v.resize (n_lines(), nullptr);
std::vector<void *>::iterator i = v.begin();
line_iterator line = begin_line(),
endl = end_line();
template <int dim, int spacedim>
void Triangulation<dim, spacedim>::save_user_pointers_quad (std::vector<void *> &v) const
{
- v.resize (n_quads(), 0);
+ v.resize (n_quads(), nullptr);
if (dim >= 2)
{
template <int dim, int spacedim>
void Triangulation<dim, spacedim>::save_user_pointers_hex (std::vector<void *> &v) const
{
- v.resize (n_hexs(), 0);
+ v.resize (n_hexs(), nullptr);
if (dim >= 3)
{
get_line_support_points (const unsigned int n_intermediate_points) const
{
if (points.size() <= n_intermediate_points ||
- points[n_intermediate_points].get() == 0)
+ points[n_intermediate_points].get() == nullptr)
{
Threads::Mutex::ScopedLock lock(mutex);
if (points.size() <= n_intermediate_points)
points.resize(n_intermediate_points+1);
// another thread might have created points in the meantime
- if (points[n_intermediate_points].get() == 0)
+ if (points[n_intermediate_points].get() == nullptr)
{
std::shared_ptr<QGaussLobatto<1> >
quadrature (new QGaussLobatto<1>(n_intermediate_points+2));
// see if we need to fill this
// entry, or whether it already
// exists
- if (identities.get() == 0)
+ if (identities.get() == nullptr)
{
switch (structdim)
{
typedef DoFHandler<dim,spacedim> BaseClass;
- Assert (dof_handler.finite_elements != 0,
+ Assert (dof_handler.finite_elements != nullptr,
typename BaseClass::ExcNoFESelected());
Assert (dof_handler.finite_elements->size() > 0,
typename BaseClass::ExcNoFESelected());
typedef DoFHandler<dim,spacedim> BaseClass;
- Assert (dof_handler.finite_elements != 0,
+ Assert (dof_handler.finite_elements != nullptr,
typename BaseClass::ExcNoFESelected());
Assert (dof_handler.finite_elements->size() > 0,
typename BaseClass::ExcNoFESelected());
typedef DoFHandler<dim,spacedim> BaseClass;
- Assert (dof_handler.finite_elements != 0,
+ Assert (dof_handler.finite_elements != nullptr,
typename BaseClass::ExcNoFESelected());
Assert (dof_handler.finite_elements->size() > 0,
typename BaseClass::ExcNoFESelected());
DoFHandler<dim,spacedim>::DoFHandler (const Triangulation<dim,spacedim> &tria)
:
tria(&tria, typeid(*this).name()),
- faces (NULL)
+ faces (nullptr)
{
Assert ((dynamic_cast<const parallel::distributed::Triangulation< dim, spacedim >*>
(&tria)
- == 0),
+ == nullptr),
ExcMessage ("The given triangulation is parallel distributed but "
"this class does not currently support this."));
template <>
types::global_dof_index DoFHandler<1>::n_boundary_dofs () const
{
- Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (finite_elements != nullptr, ExcNoFESelected());
DoFHandler<1,1>::cell_iterator cell;
types::global_dof_index n = 0;
template <typename number>
types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::map<types::boundary_id, const Function<1,number>*> &boundary_ids) const
{
- Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (finite_elements != nullptr, ExcNoFESelected());
// check that only boundary
// indicators 0 and 1 are allowed
template <>
types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_ids) const
{
- Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (finite_elements != nullptr, ExcNoFESelected());
// check that only boundary
// indicators 0 and 1 are allowed
template<int dim, int spacedim>
types::global_dof_index DoFHandler<dim,spacedim>::n_boundary_dofs () const
{
- Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (finite_elements != nullptr, ExcNoFESelected());
std::set<types::global_dof_index> boundary_dofs;
std::vector<types::global_dof_index> dofs_on_face;
types::global_dof_index
DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_ids) const
{
- Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (finite_elements != nullptr, ExcNoFESelected());
Assert (boundary_ids.find (numbers::internal_face_boundary_id) == boundary_ids.end(),
ExcInvalidBoundaryIndicator());
if (dynamic_cast<const parallel::shared::Triangulation< dim, spacedim >*>
(&this->get_triangulation())
- == 0)
+ == nullptr)
{
number_cache.locally_owned_dofs
= IndexSet (number_cache.n_global_dofs);
void DoFHandler<dim,spacedim>::clear ()
{
// release lock to old fe
- finite_elements = 0;
+ finite_elements = nullptr;
// release memory
clear_space ();
unsigned int
DoFHandler<dim, spacedim>::max_couplings_between_dofs () const
{
- Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (finite_elements != nullptr, ExcNoFESelected());
return dealii::internal::hp::DoFHandler::Implementation::max_couplings_between_dofs (*this);
}
unsigned int
DoFHandler<dim,spacedim>::max_couplings_between_boundary_dofs () const
{
- Assert (finite_elements != 0, ExcNoFESelected());
+ Assert (finite_elements != nullptr, ExcNoFESelected());
switch (dim)
{
// (besides, we would trip over
// an assertion in
// set_active_fe_index)
- if (finite_elements != 0)
+ if (finite_elements != nullptr)
{
cell_iterator cell = begin(),
endc = end ();
delete levels[i];
levels.resize (0);
delete faces;
- faces = NULL;
+ faces = nullptr;
{
std::vector<types::global_dof_index> tmp;
// already have an object for
// this particular combination
// of indices
- if (fe_values_table(present_fe_values_index).get() == 0)
+ if (fe_values_table(present_fe_values_index).get() == nullptr)
fe_values_table(present_fe_values_index)
=
std::shared_ptr<FEValuesType>
matrix(e.matrix)
{
Entry &e2 = const_cast<Entry &>(e);
- e2.matrix = 0;
+ e2.matrix = nullptr;
}
for (size_type j=0; j<columns; ++j)
{
SparsityPatternBase *sp = sub_objects[i][j];
- sub_objects[i][j] = 0;
+ sub_objects[i][j] = nullptr;
delete sp;
};
sub_objects.reinit (0,0);
void
ChunkSparsityPattern::print (std::ostream &out) const
{
- Assert ((sparsity_pattern.rowstart!=0) && (sparsity_pattern.colnums!=0),
+ Assert ((sparsity_pattern.rowstart!=nullptr) && (sparsity_pattern.colnums!=nullptr),
ExcEmptyObject());
AssertThrow (out, ExcIO());
void
ChunkSparsityPattern::print_gnuplot (std::ostream &out) const
{
- Assert ((sparsity_pattern.rowstart!=0) &&
- (sparsity_pattern.colnums!=0), ExcEmptyObject());
+ Assert ((sparsity_pattern.rowstart!=nullptr) &&
+ (sparsity_pattern.colnums!=nullptr), ExcEmptyObject());
AssertThrow (out, ExcIO());
{
const ConstraintLine::Entries *other_line
= other_constraints.get_constraint_entries (line->entries[i].first);
- Assert (other_line != 0,
+ Assert (other_line != nullptr,
ExcInternalError());
const double weight = line->entries[i].second;
line_ptr = get_constraint_entries(indices[i]);
// if the index is constraint, the constraints indices are added to the
// indices vector
- if (line_ptr!=NULL)
+ if (line_ptr!=nullptr)
{
const unsigned int line_size = line_ptr->size();
for (unsigned int j=0; j<line_size; ++j)
// statically allocated description of the current error message.
const char *petsc_message;
const PetscErrorCode ierr = PetscErrorMessage (error_code, &petsc_message,
- /*specific=*/NULL);
- if (ierr == 0 && petsc_message != NULL)
+ /*specific=*/nullptr);
+ if (ierr == 0 && petsc_message != nullptr)
{
out << "The description of the error provided by PETSc is \""
<< petsc_message
PreconditionLU<number>::initialize(const LAPACKFullMatrix<number> &M)
{
matrix = &M;
- mem = 0;
+ mem = nullptr;
}
PreconditionLU<number>::vmult(BlockVector<number> &dst,
const BlockVector<number> &src) const
{
- Assert(mem != 0, ExcNotInitialized());
+ Assert(mem != nullptr, ExcNotInitialized());
Vector<number> *aux = mem->alloc();
*aux = src;
matrix->apply_lu_factorization(*aux, false);
PreconditionLU<number>::Tvmult(BlockVector<number> &dst,
const BlockVector<number> &src) const
{
- Assert(mem != 0, ExcNotInitialized());
+ Assert(mem != nullptr, ExcNotInitialized());
Vector<number> *aux = mem->alloc();
*aux = src;
matrix->apply_lu_factorization(*aux, true);
MatrixBase::MatrixBase ()
:
- matrix (NULL),
+ matrix (nullptr),
last_action (VectorOperation::unknown)
{}
const int m=0, n=0, n_nonzero_per_row=0;
const PetscErrorCode ierr = MatCreateSeqAIJ(PETSC_COMM_SELF, m, n,
n_nonzero_per_row,
- 0, &matrix);
+ nullptr, &matrix);
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
// a given PETSc Vec* object without allocating new memory
// and without taking ownership of the Vec*
- VectorBase *x = 0;
- VectorBase *y = 0;
+ VectorBase *x = nullptr;
+ VectorBase *y = nullptr;
// because we do not know,
// if dst and src are sequential
// or distributed vectors,
const int m=0, n=0, n_nonzero_per_row=0;
const PetscErrorCode ierr
= MatCreateSeqAIJ(PETSC_COMM_SELF, m, n, n_nonzero_per_row,
- 0, &matrix);
+ nullptr, &matrix);
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
(communicator,
local_rows, local_columns,
m, n,
- n_nonzero_per_row, 0,
- n_offdiag_nonzero_per_row, 0,
+ n_nonzero_per_row, nullptr,
+ n_offdiag_nonzero_per_row, nullptr,
&matrix);
set_matrix_option (matrix, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);
#endif
m, n,
0, &int_row_lengths[0],
0,
- offdiag_row_lengths.size() ? &int_offdiag_row_lengths[0] : 0,
+ offdiag_row_lengths.size() ? &int_offdiag_row_lengths[0] : nullptr,
&matrix);
//TODO: Sometimes the actual number of nonzero entries allocated is greater than the number of nonzero entries, which petsc will complain about unless explicitly disabled with MatSetOption. There is probably a way to prevent a different number nonzero elements being allocated in the first place. (See also previous TODO).
ierr = MatMPIAIJSetPreallocationCSR (matrix,
&rowstart_in_window[0],
&colnums_in_window[0],
- 0);
+ nullptr);
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
else
ierr = MatMPIAIJSetPreallocationCSR (matrix,
&i,
&i,
- 0);
+ nullptr);
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
compress (dealii::VectorOperation::insert);
ierr = MatMPIAIJSetPreallocationCSR (matrix,
&rowstart_in_window[0],
&colnums_in_window[0],
- 0);
+ nullptr);
AssertThrow (ierr == 0, ExcPETScError(ierr));
#if DEAL_II_PETSC_VERSION_LT(2,3,3)
?
(const PetscInt *)(&(ghostindices[0]))
:
- 0);
+ nullptr);
PetscErrorCode ierr = VecCreateGhost(communicator,
local_size,
{
PreconditionerBase::PreconditionerBase ()
:
- pc(NULL), matrix(NULL)
+ pc(nullptr), matrix(nullptr)
{}
PreconditionerBase::~PreconditionerBase ()
void
PreconditionerBase::clear ()
{
- matrix = NULL;
+ matrix = nullptr;
- if (pc!=NULL)
+ if (pc!=nullptr)
{
#if DEAL_II_PETSC_VERSION_LT(3,2,0)
PetscErrorCode ierr = PCDestroy(pc);
#else
PetscErrorCode ierr = PCDestroy(&pc);
#endif
- pc = NULL;
+ pc = nullptr;
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
}
PreconditionerBase::vmult (VectorBase &dst,
const VectorBase &src) const
{
- AssertThrow (pc != NULL, StandardExceptions::ExcInvalidState ());
+ AssertThrow (pc != nullptr, StandardExceptions::ExcInvalidState ());
const PetscErrorCode ierr = PCApply(pc, src, dst);
AssertThrow (ierr == 0, ExcPETScError(ierr));
{
// only allow the creation of the
// preconditioner once
- AssertThrow (pc == NULL, StandardExceptions::ExcInvalidState ());
+ AssertThrow (pc == nullptr, StandardExceptions::ExcInvalidState ());
MPI_Comm comm;
// this ugly cast is necessary because the
void
PreconditionJacobi::initialize()
{
- AssertThrow (pc != NULL, StandardExceptions::ExcInvalidState ());
+ AssertThrow (pc != nullptr, StandardExceptions::ExcInvalidState ());
PetscErrorCode ierr = PCSetType (pc, const_cast<char *>(PCJACOBI));
AssertThrow (ierr == 0, ExcPETScError(ierr));
// first create a solver object if this
// is necessary
- if (solver_data.get() == 0)
+ if (solver_data.get() == nullptr)
{
solver_data.reset (new SolverData());
// make sure the preconditioner has an associated matrix set
const Mat B = preconditioner;
- AssertThrow (B != NULL,
+ AssertThrow (B != nullptr,
ExcMessage("PETSc preconditioner should have an"
"associated matrix set to be used in solver."));
{
const int m=0, n=0, n_nonzero_per_row=0;
const PetscErrorCode ierr = MatCreateSeqAIJ(PETSC_COMM_SELF, m, n,
- n_nonzero_per_row, 0, &matrix);
+ n_nonzero_per_row, nullptr, &matrix);
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
// for all rows globally
const PetscErrorCode ierr = MatCreateSeqAIJ(PETSC_COMM_SELF, m, n,
n_nonzero_per_row,
- 0, &matrix);
+ nullptr, &matrix);
AssertThrow (ierr == 0, ExcPETScError(ierr));
// set symmetric flag, if so requested
// if the vector is local, then
// simply access the element we
// are interested in
- if (dynamic_cast<const PETScWrappers::Vector *>(&vector) != 0)
+ if (dynamic_cast<const PETScWrappers::Vector *>(&vector) != nullptr)
{
PetscInt idx = index;
PetscScalar value;
}
// else see if we are dealing
// with a parallel vector
- else if (dynamic_cast<const PETScWrappers::MPI::Vector *>(&vector) != 0)
+ else if (dynamic_cast<const PETScWrappers::MPI::Vector *>(&vector) != nullptr)
{
// there is the possibility
// that the vector has
VectorBase::VectorBase ()
:
- vector (NULL),
+ vector (nullptr),
ghosted(false),
last_action (::dealii::VectorOperation::unknown),
attained_ownership(true)
{
// We can only use our more efficient
// routine in the serial case.
- if (dynamic_cast<const PETScWrappers::MPI::Vector *>(this) != 0)
+ if (dynamic_cast<const PETScWrappers::MPI::Vector *>(this) != nullptr)
{
PetscScalar sum;
const PetscErrorCode ierr = VecSum(vector, &sum);
SolverBase::~SolverBase ()
{
- if (eps != NULL)
+ if (eps != nullptr)
{
// Destroy the solver object.
#if DEAL_II_PETSC_VERSION_LT(3,2,0)
TransformationBase::~TransformationBase ()
{
- if (st!=NULL)
+ if (st!=nullptr)
{
const PetscErrorCode ierr = STDestroy(&st);
AssertThrow (ierr == 0, SolverBase::ExcSLEPcError(ierr));
:
_m (0),
_n (0),
- symbolic_decomposition (0),
- numeric_decomposition (0),
+ symbolic_decomposition (nullptr),
+ numeric_decomposition (nullptr),
control (UMFPACK_CONTROL)
{
umfpack_dl_defaults (&control[0]);
SparseDirectUMFPACK::clear ()
{
// delete objects that haven't been deleted yet
- if (symbolic_decomposition != 0)
+ if (symbolic_decomposition != nullptr)
{
umfpack_dl_free_symbolic (&symbolic_decomposition);
- symbolic_decomposition = 0;
+ symbolic_decomposition = nullptr;
}
- if (numeric_decomposition != 0)
+ if (numeric_decomposition != nullptr)
{
umfpack_dl_free_numeric (&numeric_decomposition);
- numeric_decomposition = 0;
+ numeric_decomposition = nullptr;
}
{
status = umfpack_dl_symbolic (N, N,
&Ap[0], &Ai[0], &Ax[0],
&symbolic_decomposition,
- &control[0], 0);
+ &control[0], nullptr);
AssertThrow (status == UMFPACK_OK,
ExcUMFPACKError("umfpack_dl_symbolic", status));
status = umfpack_dl_numeric (&Ap[0], &Ai[0], &Ax[0],
symbolic_decomposition,
&numeric_decomposition,
- &control[0], 0);
+ &control[0], nullptr);
AssertThrow (status == UMFPACK_OK,
ExcUMFPACKError("umfpack_dl_numeric", status));
&Ap[0], &Ai[0], &Ax[0],
rhs_and_solution.begin(), rhs.begin(),
numeric_decomposition,
- &control[0], 0);
+ &control[0], nullptr);
AssertThrow (status == UMFPACK_OK, ExcUMFPACKError("umfpack_dl_solve", status));
}
:
max_dim(0),
max_vec_len(0),
- rowstart(0),
- colnums(0),
+ rowstart(nullptr),
+ colnums(nullptr),
compressed(false),
store_diagonal_first_in_row(false)
{
Subscriptor(),
max_dim(0),
max_vec_len(0),
- rowstart(0),
- colnums(0),
+ rowstart(nullptr),
+ colnums(nullptr),
compressed(false),
store_diagonal_first_in_row(false)
{
:
max_dim(0),
max_vec_len(0),
- rowstart(0),
- colnums(0),
+ rowstart(nullptr),
+ colnums(nullptr),
compressed(false),
store_diagonal_first_in_row(m == n)
{
:
max_dim(0),
max_vec_len(0),
- rowstart(0),
- colnums(0),
+ rowstart(nullptr),
+ colnums(nullptr),
store_diagonal_first_in_row(m == n)
{
reinit (m, n, row_lengths);
:
max_dim(0),
max_vec_len(0),
- rowstart(0),
- colnums(0)
+ rowstart(nullptr),
+ colnums(nullptr)
{
reinit (m, m, max_per_row);
}
:
max_dim(0),
max_vec_len(0),
- rowstart(0),
- colnums(0)
+ rowstart(nullptr),
+ colnums(nullptr)
{
reinit (m, m, row_lengths);
}
:
max_dim(0),
max_vec_len(0),
- rowstart(0),
- colnums(0)
+ rowstart(nullptr),
+ colnums(nullptr)
{
Assert (original.rows==original.cols, ExcNotQuadratic());
Assert (original.is_compressed(), ExcNotCompressed());
SparsityPattern::~SparsityPattern ()
{
- if (rowstart != 0) delete[] rowstart;
- if (colnums != 0) delete[] colnums;
+ if (rowstart != nullptr) delete[] rowstart;
+ if (colnums != nullptr) delete[] colnums;
}
{
if (rowstart) delete[] rowstart;
if (colnums) delete[] colnums;
- rowstart = 0;
- colnums = 0;
+ rowstart = nullptr;
+ colnums = nullptr;
max_vec_len = max_dim = rows = cols = 0;
// if dimension is zero: ignore max_per_row
max_row_length = 0;
if (colnums)
{
delete[] colnums;
- colnums = 0;
+ colnums = nullptr;
}
max_vec_len = vec_len;
if (rowstart)
{
delete[] rowstart;
- rowstart = 0;
+ rowstart = nullptr;
}
max_dim = rows;
if (colnums)
{
delete[] colnums;
- colnums = 0;
+ colnums = nullptr;
}
max_vec_len = vec_len;
void
SparsityPattern::compress ()
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
// do nothing if already compressed
if (compressed)
// and freeing memory was not present in the original implementation and I
// don't know at how many places I missed something in adding it, so I try
// to be cautious. wb)
- if ((rowstart==0) || (rows==0) || (cols==0))
+ if ((rowstart==nullptr) || (rows==0) || (cols==0))
{
- Assert (rowstart==0, ExcInternalError());
+ Assert (rowstart==nullptr, ExcInternalError());
Assert (rows==0, ExcInternalError());
Assert (cols==0, ExcInternalError());
- Assert (colnums==0, ExcInternalError());
+ Assert (colnums==nullptr, ExcInternalError());
Assert (max_vec_len==0, ExcInternalError());
return true;
SparsityPattern::operator () (const size_type i,
const size_type j) const
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
Assert (i<rows, ExcIndexRange(i,0,rows));
Assert (j<cols, ExcIndexRange(j,0,cols));
Assert (compressed, ExcNotCompressed());
SparsityPattern::add (const size_type i,
const size_type j)
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
Assert (i<rows, ExcIndexRange(i,0,rows));
Assert (j<cols, ExcIndexRange(j,0,cols));
Assert (compressed==false, ExcMatrixIsCompressed());
bool
SparsityPattern::exists (const size_type i, const size_type j) const
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
Assert (i<rows, ExcIndexRange(i,0,rows));
Assert (j<cols, ExcIndexRange(j,0,cols));
SparsityPattern::size_type
SparsityPattern::row_position (const size_type i, const size_type j) const
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
Assert (i<rows, ExcIndexRange(i,0,rows));
Assert (j<cols, ExcIndexRange(j,0,cols));
void
SparsityPattern::symmetrize ()
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
Assert (compressed==false, ExcMatrixIsCompressed());
// Note that we only require a quadratic matrix here, no special treatment
// of diagonals
void
SparsityPattern::print (std::ostream &out) const
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
AssertThrow (out, ExcIO());
void
SparsityPattern::print_gnuplot (std::ostream &out) const
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
AssertThrow (out, ExcIO());
SparsityPattern::size_type
SparsityPattern::bandwidth () const
{
- Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert ((rowstart!=nullptr) && (colnums!=nullptr), ExcEmptyObject());
size_type b=0;
for (size_type i=0; i<rows; ++i)
for (size_type j=rowstart[i]; j<rowstart[i+1]; ++j)
// Use recursive if the number of partitions is less than or equal to 8
if (nparts <= 8)
ierr = METIS_PartGraphRecursive(&n, &ncon, &int_rowstart[0], &int_colnums[0],
- NULL, NULL, NULL,
- &nparts,NULL,NULL,&options[0],
+ nullptr, nullptr, nullptr,
+ &nparts,nullptr,nullptr,&options[0],
&dummy,&int_partition_indices[0]);
// Otherwise use kway
else
ierr = METIS_PartGraphKway(&n, &ncon, &int_rowstart[0], &int_colnums[0],
- NULL, NULL, NULL,
- &nparts,NULL,NULL,&options[0],
+ nullptr, nullptr, nullptr,
+ &nparts,nullptr,nullptr,&options[0],
&dummy,&int_partition_indices[0]);
// If metis returns normally, an error code METIS_OK=1 is returned from
const int nn = n();
int info;
- stev (&N, &nn, &*diagonal.begin(), &*right.begin(), 0, &one, 0, &info);
+ stev (&N, &nn, &*diagonal.begin(), &*right.begin(), nullptr, &one, nullptr, &info);
Assert(info == 0, ExcInternalError());
state = eigenvalues;
{
BlockType *p = new BlockType();
- Assert (this->sub_objects[r][c] == 0,
+ Assert (this->sub_objects[r][c] == nullptr,
ExcInternalError());
this->sub_objects[r][c] = p;
}
{
// If no communication pattern is given, create one. Otherwsie, use the
// one given.
- if (communication_pattern == NULL)
+ if (communication_pattern == nullptr)
{
// The first time import is called, a communication pattern is created.
// Check if the communication pattern already exists and if it can be
{
epetra_comm_pattern =
std::dynamic_pointer_cast<const CommunicationPattern> (communication_pattern);
- AssertThrow(epetra_comm_pattern != NULL,
+ AssertThrow(epetra_comm_pattern != nullptr,
ExcMessage(std::string("The communication pattern is not of type ") +
"LinearAlgebra::EpetraWrappers::CommunicationPattern."));
}
Vector &Vector::operator+= (const VectorSpaceVector<double> &V)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector *>(&V)!=NULL, ExcVectorTypeNotCompatible());
+ Assert(dynamic_cast<const Vector *>(&V)!=nullptr, ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
const Vector &down_V = dynamic_cast<const Vector &>(V);
double Vector::operator* (const VectorSpaceVector<double> &V) const
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector *>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector *>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
void Vector::add(const double a, const VectorSpaceVector<double> &V)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector *>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector *>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
const double b, const VectorSpaceVector<double> &W)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector *>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector *>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Check that casting will work.
- Assert(dynamic_cast<const Vector *>(&W)!=NULL,
+ Assert(dynamic_cast<const Vector *>(&W)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
const VectorSpaceVector<double> &V)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector *>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector *>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
*this *= s;
void Vector::scale(const VectorSpaceVector<double> &scaling_factors)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector *>(&scaling_factors)!=NULL,
+ Assert(dynamic_cast<const Vector *>(&scaling_factors)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast scaling_factors. If fails, throws an exception.
void Vector::equ(const double a, const VectorSpaceVector<double> &V)
{
// Check that casting will work.
- Assert(dynamic_cast<const Vector *>(&V)!=NULL,
+ Assert(dynamic_cast<const Vector *>(&V)!=nullptr,
ExcVectorTypeNotCompatible());
// Downcast V. If fails, throws an exception.
{
const Epetra_MpiComm *epetra_comm
= dynamic_cast<const Epetra_MpiComm *>(&(vector->Comm()));
- Assert (epetra_comm != 0, ExcInternalError());
+ Assert (epetra_comm != nullptr, ExcInternalError());
return epetra_comm->GetMpiComm();
}
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Chebyshev *ifpack = static_cast<Ifpack_Chebyshev *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
Ifpack_Preconditioner *ifpack = static_cast<Ifpack_Preconditioner *>
(preconditioner.get());
- Assert (ifpack != 0, ExcMessage ("Trilinos could not create this "
- "preconditioner"));
+ Assert (ifpack != nullptr, ExcMessage ("Trilinos could not create this "
+ "preconditioner"));
int ierr;
{
ML_Epetra::MultiLevelPreconditioner *multilevel_operator =
dynamic_cast<ML_Epetra::MultiLevelPreconditioner *> (preconditioner.get());
- Assert (multilevel_operator != 0,
+ Assert (multilevel_operator != nullptr,
ExcMessage ("Preconditioner setup failed."));
multilevel_operator->PrintUnused(0);
}
vector_distributor.reset (new Epetra_Map(static_cast<TrilinosWrappers::types::int_type>(n_rows),
0, communicator));
- if (trilinos_matrix.get() == 0)
+ if (trilinos_matrix.get() == nullptr)
trilinos_matrix.reset (new SparseMatrix());
trilinos_matrix->reinit (*vector_distributor, *vector_distributor,
// todo: find a way to read out ML's data
// sizes
- if (trilinos_matrix.get() != 0)
+ if (trilinos_matrix.get() != nullptr)
memory += trilinos_matrix->memory_consumption();
return memory;
}
vector_distributor.reset (new Epetra_Map(static_cast<TrilinosWrappers::types::int_type>(n_rows),
0, communicator));
- if (trilinos_matrix.get() == 0)
+ if (trilinos_matrix.get() == nullptr)
trilinos_matrix.reset (new SparseMatrix());
trilinos_matrix->reinit (*vector_distributor, *vector_distributor,
// todo: find a way to read out ML's data
// sizes
- if (trilinos_matrix.get() != 0)
+ if (trilinos_matrix.get() != nullptr)
memory += trilinos_matrix->memory_consumption();
return memory;
}
// get a representation of the present row
int ncols;
TrilinosWrappers::types::int_type colnums = matrix->n();
- if (value_cache.get() == 0)
+ if (value_cache.get() == nullptr)
{
value_cache.reset (new std::vector<TrilinosScalar> (matrix->n()));
colnum_cache.reset (new std::vector<size_type> (matrix->n()));
matrix->FillComplete(*column_space_map, matrix->RowMap());
}
- if (rhs.nonlocal_matrix.get() != 0)
+ if (rhs.nonlocal_matrix.get() != nullptr)
nonlocal_matrix.reset(new Epetra_CrsMatrix(Copy, rhs.nonlocal_matrix->Graph()));
}
relevant_rows.fill_index_vector(indices);
Epetra_Map relevant_map (TrilinosWrappers::types::int_type(-1),
TrilinosWrappers::types::int_type(relevant_rows.n_elements()),
- (indices.empty() ? 0 :
+ (indices.empty() ? nullptr :
reinterpret_cast<TrilinosWrappers::types::int_type *>(&indices[0])),
0, input_row_map.Comm());
if (relevant_map.SameAs(input_row_map))
}
Epetra_Map off_processor_map(-1, ghost_rows.size(),
- (ghost_rows.size()>0)?(&ghost_rows[0]):NULL,
+ (ghost_rows.size()>0)?(&ghost_rows[0]):nullptr,
0, input_row_map.Comm());
std::shared_ptr<Epetra_CrsGraph> graph;
if (input_row_map.Comm().NumProc() > 1)
{
graph.reset (new Epetra_CrsGraph (Copy, input_row_map,
- (n_entries_per_row.size()>0)?(&n_entries_per_row[0]):NULL,
+ (n_entries_per_row.size()>0)?(&n_entries_per_row[0]):nullptr,
exchange_data ? false : true));
if (have_ghost_rows == true)
nonlocal_graph.reset (new Epetra_CrsGraphMod (off_processor_map,
}
else
graph.reset (new Epetra_CrsGraph (Copy, input_row_map, input_col_map,
- (n_entries_per_row.size()>0)?(&n_entries_per_row[0]):NULL,
+ (n_entries_per_row.size()>0)?(&n_entries_per_row[0]):nullptr,
true));
// now insert the indices, select between the right matrix
graph->InsertGlobalIndices (global_row, row_length, &row_indices[0]);
else
{
- Assert(nonlocal_graph.get() != 0, ExcInternalError());
+ Assert(nonlocal_graph.get() != nullptr, ExcInternalError());
nonlocal_graph->InsertGlobalIndices (global_row, row_length,
&row_indices[0]);
}
}
// finalize nonlocal graph and create nonlocal matrix
- if (nonlocal_graph.get() != 0)
+ if (nonlocal_graph.get() != nullptr)
{
// must make sure the IndicesAreGlobal flag is set on all processors
// because some processors might not call InsertGlobalIndices (and
matrix.reset (new Epetra_FECrsMatrix
(Copy, sparsity_pattern.trilinos_sparsity_pattern(), false));
- if (sparsity_pattern.nonlocal_graph.get() != 0)
+ if (sparsity_pattern.nonlocal_graph.get() != nullptr)
nonlocal_matrix.reset (new Epetra_CrsMatrix(Copy, *sparsity_pattern.nonlocal_graph));
else
nonlocal_matrix.reset ();
matrix.reset (new Epetra_FECrsMatrix
(Copy, sparse_matrix.trilinos_sparsity_pattern(), false));
- if (sparse_matrix.nonlocal_matrix != 0)
+ if (sparse_matrix.nonlocal_matrix != nullptr)
nonlocal_matrix.reset (new Epetra_CrsMatrix
(Copy, sparse_matrix.nonlocal_matrix->Graph()));
else
{
// in case we do not copy values, just
// call the other function.
- if (use_this_sparsity == 0)
+ if (use_this_sparsity == nullptr)
reinit (row_parallel_partitioning, col_parallel_partitioning,
dealii_sparse_matrix.get_sparsity_pattern(),
communicator, false);
AssertDimension (col_parallel_partitioning.size(), dealii_sparse_matrix.n());
const ::dealii::SparsityPattern &sparsity_pattern =
- (use_this_sparsity!=0)? *use_this_sparsity :
+ (use_this_sparsity!=nullptr)? *use_this_sparsity :
dealii_sparse_matrix.get_sparsity_pattern();
- if (matrix.get() == 0 ||
+ if (matrix.get() == nullptr ||
m() != n_rows ||
n_nonzero_elements() != sparsity_pattern.n_nonzero_elements())
{
// flush buffers
int ierr;
- if (nonlocal_matrix.get() != 0 && mode == Add)
+ if (nonlocal_matrix.get() != nullptr && mode == Add)
{
// do only export in case of an add() operation, otherwise the owning
// processor must have set the correct entry
nonlocal_matrix->FillComplete(*column_space_map, matrix->RowMap());
- if (nonlocal_matrix_exporter.get() == 0)
+ if (nonlocal_matrix_exporter.get() == nullptr)
nonlocal_matrix_exporter.reset
(new Epetra_Export(nonlocal_matrix->RowMap(), matrix->RowMap()));
ierr = matrix->Export(*nonlocal_matrix, *nonlocal_matrix_exporter, mode);
col_value_ptr,
col_index_ptr);
}
- else if (nonlocal_matrix.get() != 0)
+ else if (nonlocal_matrix.get() != nullptr)
{
compressed = false;
// this is the case when we have explicitly set the off-processor rows
<< " has the following indices:" << std::endl;
std::vector<TrilinosWrappers::types::int_type> indices;
const Epetra_CrsGraph *graph =
- (nonlocal_matrix.get() != 0 &&
+ (nonlocal_matrix.get() != nullptr &&
matrix->RowMap().MyGID(static_cast<TrilinosWrappers::types::int_type>(row)) == false) ?
&nonlocal_matrix->Graph() : &matrix->Graph();
const int ierr = matrix->PutScalar(d);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
- if (nonlocal_matrix.get() != 0)
+ if (nonlocal_matrix.get() != nullptr)
nonlocal_matrix->PutScalar(d);
return *this;
int max_per_proc;
TrilinosWrappers::types::int_type N_input_vector = B_->invec_leng;
getrow_comm = B_->getrow->pre_comm;
- if ( getrow_comm != NULL)
+ if ( getrow_comm != nullptr)
for (TrilinosWrappers::types::int_type i = 0; i < getrow_comm->N_neighbors; i++)
for (TrilinosWrappers::types::int_type j = 0; j < getrow_comm->neighbors[i].N_send; j++)
AssertThrow (getrow_comm->neighbors[i].send_list[j] < N_input_vector,
ML_create_unique_col_id(N_input_vector, &(B_->getrow->loc_glob_map),
getrow_comm, &max_per_proc, B_->comm);
B_->getrow->use_loc_glob_map = ML_YES;
- if (A_->getrow->pre_comm != NULL)
+ if (A_->getrow->pre_comm != nullptr)
ML_exchange_rows( B_, &Btmp, A_->getrow->pre_comm);
else Btmp = B_;
// release temporary structures we needed
// for multiplication
ML_free(B_->getrow->loc_glob_map);
- B_->getrow->loc_glob_map = NULL;
+ B_->getrow->loc_glob_map = nullptr;
B_->getrow->use_loc_glob_map = ML_NO;
- if (A_->getrow->pre_comm != NULL)
+ if (A_->getrow->pre_comm != nullptr)
{
tptr = Btmp;
- while ( (tptr!= NULL) && (tptr->sub_matrix != B_))
+ while ( (tptr!= nullptr) && (tptr->sub_matrix != B_))
tptr = tptr->sub_matrix;
- if (tptr != NULL) tptr->sub_matrix = NULL;
+ if (tptr != nullptr) tptr->sub_matrix = nullptr;
ML_RECUR_CSR_MSRdata_Destroy(Btmp);
ML_Operator_Destroy(&Btmp);
}
// make correct data structures
- if (A_->getrow->post_comm != NULL)
+ if (A_->getrow->post_comm != nullptr)
ML_exchange_rows(Ctmp, &Ctmp2, A_->getrow->post_comm);
else
Ctmp2 = Ctmp;
ML_RECUR_CSR_MSRdata_Destroy (Ctmp);
ML_Operator_Destroy (&Ctmp);
- if (A_->getrow->post_comm != NULL)
+ if (A_->getrow->post_comm != nullptr)
{
ML_RECUR_CSR_MSRdata_Destroy(Ctmp2);
ML_Operator_Destroy (&Ctmp2);
const Epetra_MpiComm *mpi_comm
= dynamic_cast<const Epetra_MpiComm *>(&matrix->RangeMap().Comm());
- Assert(mpi_comm != 0, ExcInternalError());
+ Assert(mpi_comm != nullptr, ExcInternalError());
return mpi_comm->Comm();
#else
SparsityPattern::compress ()
{
int ierr;
- Assert (column_space_map.get() != 0, ExcInternalError());
- if (nonlocal_graph.get() != 0)
+ Assert (column_space_map.get() != nullptr, ExcInternalError());
+ if (nonlocal_graph.get() != nullptr)
{
if (nonlocal_graph->IndicesAreGlobal() == false &&
nonlocal_graph->RowMap().NumMyElements() > 0)
const Epetra_MpiComm *mpi_comm
= dynamic_cast<const Epetra_MpiComm *>(&graph->RangeMap().Comm());
- Assert (mpi_comm != 0, ExcInternalError());
+ Assert (mpi_comm != nullptr, ExcInternalError());
return mpi_comm->Comm();
#else
#if defined(DEBUG) && defined(DEAL_II_WITH_MPI)
const Epetra_MpiComm *comm_ptr
= dynamic_cast<const Epetra_MpiComm *>(&(vector->Comm()));
- Assert (comm_ptr != 0, ExcInternalError());
+ Assert (comm_ptr != nullptr, ExcInternalError());
const size_type n_elements_global
= Utilities::MPI::sum (owned_elements.n_elements(), comm_ptr->Comm());
#ifdef DEAL_II_WITH_MPI
const Epetra_MpiComm *my_comm = dynamic_cast<const Epetra_MpiComm *>(&vector->Comm());
const Epetra_MpiComm *v_comm = dynamic_cast<const Epetra_MpiComm *>(&v.vector->Comm());
- const bool same_communicators = my_comm != NULL && v_comm != NULL &&
+ const bool same_communicators = my_comm != nullptr && v_comm != nullptr &&
my_comm->DataPtr() == v_comm->DataPtr();
#else
const bool same_communicators = true;
#if defined(DEBUG) && defined(DEAL_II_WITH_MPI)
const Epetra_MpiComm *comm_ptr
= dynamic_cast<const Epetra_MpiComm *>(&(v.vector->Comm()));
- Assert (comm_ptr != 0, ExcInternalError());
+ Assert (comm_ptr != nullptr, ExcInternalError());
const size_type n_elements_global
= Utilities::MPI::sum (owned_elements.n_elements(), comm_ptr->Comm());
#if defined(DEBUG) && defined(DEAL_II_WITH_MPI)
const Epetra_MpiComm *comm_ptr
= dynamic_cast<const Epetra_MpiComm *>(&(vector->Comm()));
- Assert (comm_ptr != 0, ExcInternalError());
+ Assert (comm_ptr != nullptr, ExcInternalError());
const size_type n_elements_global
= Utilities::MPI::sum (owned_elements.n_elements(), comm_ptr->Comm());
#ifdef DEAL_II_WITH_MPI
const Epetra_MpiComm *my_comm = dynamic_cast<const Epetra_MpiComm *>(&vector->Comm());
const Epetra_MpiComm *v_comm = dynamic_cast<const Epetra_MpiComm *>(&v.vector->Comm());
- const bool same_communicators = my_comm != NULL && v_comm != NULL &&
+ const bool same_communicators = my_comm != nullptr && v_comm != nullptr &&
my_comm->DataPtr() == v_comm->DataPtr();
// Need to ask MPI whether the communicators are the same. We would like
// to use the following checks but currently we cannot make sure the
if (same_communicators && v.vector->Map().SameAs(vector->Map()))
{
*vector = *v.vector;
- if (v.nonlocal_vector.get() != 0)
+ if (v.nonlocal_vector.get() != nullptr)
nonlocal_vector.reset(new Epetra_MultiVector(v.nonlocal_vector->Map(), 1));
last_action = Zero;
}
owned_elements = v.owned_elements;
}
- if (v.nonlocal_vector.get() != 0)
+ if (v.nonlocal_vector.get() != nullptr)
nonlocal_vector.reset(new Epetra_MultiVector(v.nonlocal_vector->Map(), 1));
return *this;
#ifdef DEAL_II_WITH_MPI
const Epetra_MpiComm *my_comm = dynamic_cast<const Epetra_MpiComm *>(&vector->Comm());
const Epetra_MpiComm *v_comm = dynamic_cast<const Epetra_MpiComm *>(&v.vector->Comm());
- const bool same_communicators = my_comm != NULL && v_comm != NULL &&
+ const bool same_communicators = my_comm != nullptr && v_comm != nullptr &&
my_comm->DataPtr() == v_comm->DataPtr();
#else
const bool same_communicators = true;
VectorBase &
VectorBase::operator = (const VectorBase &v)
{
- Assert (vector.get() != 0,
+ Assert (vector.get() != nullptr,
ExcMessage("Vector is not constructed properly."));
if (local_range() != v.local_range())
double double_mode = mode;
const Epetra_MpiComm *comm_ptr
= dynamic_cast<const Epetra_MpiComm *>(&(vector_partitioner().Comm()));
- Assert (comm_ptr != 0, ExcInternalError());
+ Assert (comm_ptr != nullptr, ExcInternalError());
Utilities::MPI::MinMaxAvg result
= Utilities::MPI::min_max_avg (double_mode, comm_ptr->GetMpiComm());
Assert(result.max-result.min<1e-5,
// Now pass over the information about what we did last to the vector.
int ierr = 0;
- if (nonlocal_vector.get() == 0 || mode != Add)
+ if (nonlocal_vector.get() == nullptr || mode != Add)
ierr = vector->GlobalAssemble(mode);
else
{
// is zero on _all_ processors.
const Epetra_MpiComm *mpi_comm
= dynamic_cast<const Epetra_MpiComm *>(&vector->Map().Comm());
- Assert(mpi_comm != 0, ExcInternalError());
+ Assert(mpi_comm != nullptr, ExcInternalError());
unsigned int num_nonzero = Utilities::MPI::sum(flag, mpi_comm->Comm());
return num_nonzero == 0;
#else
{
double t = (*vector)[0][j];
- if (format != 0)
+ if (format != nullptr)
std::printf (format, t);
else
std::printf (" %5.2f", double(t));
const parallel::Triangulation<dim, spacedim> *ptria =
dynamic_cast<const parallel::Triangulation<dim, spacedim> *>
(&mg_dof.get_tria());
- const MPI_Comm mpi_communicator = ptria != 0 ? ptria->get_communicator() :
+ const MPI_Comm mpi_communicator = ptria != nullptr ? ptria->get_communicator() :
MPI_COMM_SELF;
perform_plain_copy =
Utilities::MPI::min(static_cast<int>(perform_plain_copy),
copy_indices_global_mine.clear();
copy_indices_level_mine.clear();
component_to_block_map.resize(0);
- mg_constrained_dofs = 0;
+ mg_constrained_dofs = nullptr;
}
const parallel::Triangulation<dim, spacedim> *ptria =
dynamic_cast<const parallel::Triangulation<dim, spacedim> *>
(&mg_dof.get_tria());
- const MPI_Comm mpi_communicator = ptria != 0 ? ptria->get_communicator() :
+ const MPI_Comm mpi_communicator = ptria != nullptr ? ptria->get_communicator() :
MPI_COMM_SELF;
IndexSet index_set(mg_dof.locally_owned_dofs().size());
copy_indices_global_mine.clear();
copy_indices_level_mine.clear();
component_to_block_map.resize(0);
- mg_constrained_dofs = 0;
+ mg_constrained_dofs = nullptr;
ghosted_global_vector.reinit(0);
ghosted_level_vector.resize(0, 0);
}
// impose boundary conditions
// but only in the column of
// the prolongation matrix
- if (mg_constrained_dofs != 0 && mg_constrained_dofs->have_boundary_indices())
+ if (mg_constrained_dofs != nullptr && mg_constrained_dofs->have_boundary_indices())
{
std::vector<types::global_dof_index> constrain_indices;
std::vector<std::vector<bool> > constraints_per_block (n_blocks);
const unsigned int block = fe.system_to_block_index(i).first;
if (selected[block])
{
- if (mg_constrained_dofs != 0)
+ if (mg_constrained_dofs != nullptr)
{
if (!mg_constrained_dofs->at_refinement_edge(level,level_dof_indices[i]))
temp_copy_indices[level_dof_indices[i] - mg_block_start[level][block]]
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
// we need to ignore if the DoF is on a refinement edge (hanging node)
- if (mg_constrained_dofs != 0
+ if (mg_constrained_dofs != nullptr
&& mg_constrained_dofs->at_refinement_edge(level, level_dof_indices[i]))
continue;
types::global_dof_index global_idx = globally_relevant.index_within_set(global_dof_indices[i]);
const dealii::parallel::distributed::Triangulation<dim,spacedim> *tria =
(dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&mg_dof.get_triangulation()));
- AssertThrow(send_data_temp.size()==0 || tria!=NULL, ExcMessage("parallel Multigrid only works with a distributed Triangulation!"));
+ AssertThrow(send_data_temp.size()==0 || tria!=nullptr, ExcMessage("parallel Multigrid only works with a distributed Triangulation!"));
#ifdef DEAL_II_WITH_MPI
if (tria)
}
else
{
- const int ierr = MPI_Isend(NULL, 0, MPI_BYTE, dest, 71,
+ const int ierr = MPI_Isend(nullptr, 0, MPI_BYTE, dest, 71,
tria->get_communicator(), &*requests.rbegin());
AssertThrowMPI(ierr);
}
if (len==0)
{
- ierr = MPI_Recv(NULL, 0, MPI_BYTE, status.MPI_SOURCE, status.MPI_TAG,
+ ierr = MPI_Recv(nullptr, 0, MPI_BYTE, status.MPI_SOURCE, status.MPI_TAG,
tria->get_communicator(), &status);
AssertThrowMPI(ierr);
continue;
// set Dirichlet boundary conditions (as a list of
// constrained DoFs) for the child
- if (mg_constrained_dofs != 0)
+ if (mg_constrained_dofs != nullptr)
for (unsigned int i=0; i<mg_dof.get_fe().dofs_per_cell; ++i)
if (mg_constrained_dofs->is_boundary_index(level,
local_dof_indices[elem_info.lexicographic_numbering[i]]))
&global_level_dof_indices_l0[start_index]);
dirichlet_indices[0].push_back(std::vector<unsigned short>());
- if (mg_constrained_dofs != 0)
+ if (mg_constrained_dofs != nullptr)
for (unsigned int i=0; i<mg_dof.get_fe().dofs_per_cell; ++i)
if (mg_constrained_dofs->is_boundary_index(0, local_dof_indices[elem_info.lexicographic_numbering[i]]))
dirichlet_indices[0].back().push_back(i);
const parallel::Triangulation<dim,dim> *ptria =
(dynamic_cast<const parallel::Triangulation<dim,dim>*> (&tria));
const MPI_Comm communicator =
- ptria != 0 ? ptria->get_communicator() : MPI_COMM_SELF;
+ ptria != nullptr ? ptria->get_communicator() : MPI_COMM_SELF;
reinit_ghosted_vector (mg_dof.locally_owned_mg_dofs(level),
ghosted_level_dofs, communicator,
= mg_dof.get_fe().get_prolongation_matrix (child,
cell->refinement_case());
- if (this->mg_constrained_dofs != 0 &&
+ if (this->mg_constrained_dofs != nullptr &&
this->mg_constrained_dofs->have_boundary_indices())
for (unsigned int j=0; j<dofs_per_cell; ++j)
if (this->mg_constrained_dofs->is_boundary_index(level, dof_indices_parent[j]))
template <typename number>
MGTransferBlock<number>::MGTransferBlock ()
:
- memory(0, typeid(*this).name())
+ memory(nullptr, typeid(*this).name())
{}
template <typename number>
MGTransferBlock<number>::~MGTransferBlock ()
{
- if (memory != 0) memory = 0;
+ if (memory != nullptr) memory = nullptr;
}
{
if (factors.size() != 0)
{
- Assert (memory != 0, ExcNotInitialized());
+ Assert (memory != nullptr, ExcNotInitialized());
Vector<number> *aux = memory->alloc();
aux->reinit(dst.block(this->mg_block[b]));
prolongation_matrices[from_level-1]->block(b,b).Tvmult (
const DataPostprocessor<DoFHandlerType::space_dimension> *postprocessor
= this->dof_data[dataset]->postprocessor;
- if (postprocessor != 0)
+ if (postprocessor != nullptr)
{
// we have to postprocess the data, so determine, which fields
// have to be updated
// Check consistency of redundant template parameter
Assert (dim==DoFHandlerType::dimension, ExcDimensionMismatch(dim, DoFHandlerType::dimension));
- Assert (this->triangulation != 0,
+ Assert (this->triangulation != nullptr,
Exceptions::DataOut::ExcNoTriangulationSelected());
const unsigned int n_subdivisions = (n_subdivisions_ != 0)
x_fe_values[i] = x_fe_values[j];
break;
}
- if (x_fe_values[i].get() == 0)
+ if (x_fe_values[i].get() == nullptr)
x_fe_values[i].reset(new dealii::hp::FEValues<dim,spacedim>
(this->mapping_collection,
*this->finite_elements[i],
x_fe_face_values[i] = x_fe_face_values[j];
break;
}
- if (x_fe_face_values[i].get() == 0)
+ if (x_fe_face_values[i].get() == nullptr)
x_fe_face_values[i].reset(new dealii::hp::FEFaceValues<dim,spacedim>
(this->mapping_collection,
*this->finite_elements[i],
x_fe_values[i] = x_fe_values[j];
break;
}
- if (x_fe_values[i].get() == 0)
+ if (x_fe_values[i].get() == nullptr)
x_fe_values[i].reset(new dealii::hp::FEValues<dim,spacedim>
(this->mapping_collection,
*this->finite_elements[i],
x_fe_face_values[i] = x_fe_face_values[j];
break;
}
- if (x_fe_face_values[i].get() == 0)
+ if (x_fe_face_values[i].get() == nullptr)
x_fe_face_values[i].reset(new dealii::hp::FEFaceValues<dim,spacedim>
(this->mapping_collection,
*this->finite_elements[i],
dof_handler (dofs, typeid(dealii::DataOut_DoFData<DoFHandlerType,DoFHandlerType::dimension,DoFHandlerType::space_dimension>).name()),
names(names_in),
data_component_interpretation (data_component_interpretation),
- postprocessor(0, typeid(*this).name()),
+ postprocessor(nullptr, typeid(*this).name()),
n_output_variables(names.size())
{
Assert (names.size() == data_component_interpretation.size(),
void
DataEntry<DoFHandlerType,VectorType>::clear ()
{
- vector = 0;
- this->dof_handler = 0;
+ vector = nullptr;
+ this->dof_handler = nullptr;
}
}
}
int patch_dim, int patch_space_dim>
DataOut_DoFData<DoFHandlerType,patch_dim,patch_space_dim>::DataOut_DoFData ()
:
- triangulation(0,typeid(*this).name()),
- dofs(0,typeid(*this).name())
+ triangulation(nullptr,typeid(*this).name()),
+ dofs(nullptr,typeid(*this).name())
{}
const DataVectorType type,
const std::vector<DataComponentInterpretation::DataComponentInterpretation> &data_component_interpretation)
{
- Assert (triangulation != 0,
+ Assert (triangulation != nullptr,
Exceptions::DataOut::ExcNoTriangulationSelected ());
const unsigned int n_components =
- dofs != 0 ? dofs->get_fe().n_components () : 1;
+ dofs != nullptr ? dofs->get_fe().n_components () : 1;
std::vector<std::string> names;
// if only one component or vector is cell vector: we only need one name
const DataVectorType type,
const std::vector<DataComponentInterpretation::DataComponentInterpretation> &data_component_interpretation_)
{
- Assert (triangulation != 0,
+ Assert (triangulation != nullptr,
Exceptions::DataOut::ExcNoTriangulationSelected ());
const std::vector<DataComponentInterpretation::DataComponentInterpretation> &
if (type == type_automatic)
{
// in the rare case that someone has a DGP(0) attached, we can not decide what she wants here:
- Assert((dofs == 0) || (triangulation->n_active_cells() != dofs->n_dofs()),
+ Assert((dofs == nullptr) || (triangulation->n_active_cells() != dofs->n_dofs()),
ExcMessage("Unable to determine the type of vector automatically because the number of DoFs "
"is equal to the number of cells. Please specify DataVectorType."));
break;
case type_dof_data:
- Assert (dofs != 0,
+ Assert (dofs != nullptr,
Exceptions::DataOut::ExcNoDoFHandlerSelected ());
Assert (vec.size() == dofs->n_dofs(),
Exceptions::DataOut::ExcInvalidVectorSize (vec.size(),
// things a bit simpler, we also don't need to deal with some of the other
// stuff and use a different constructor of DataEntry
- Assert (dofs != 0,
+ Assert (dofs != nullptr,
Exceptions::DataOut::ExcNoDoFHandlerSelected ());
Assert (vec.size() == dofs->n_dofs(),
// this is an extended version of the other functions where we pass a vector
// together with its DoFHandler. if we do, we know that we have
// type_dof_data, which makes things a bit simpler
- if (triangulation == 0)
+ if (triangulation == nullptr)
triangulation = SmartPointer<const Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> >(&dof_handler.get_triangulation(), typeid(*this).name());
Assert (&dof_handler.get_triangulation() == triangulation,
for (unsigned int i=0; i<cell_data.size(); ++i)
cell_data[i]->clear ();
- if (dofs != 0)
- dofs = 0;
+ if (dofs != nullptr)
+ dofs = nullptr;
}
dof_data.erase (dof_data.begin(), dof_data.end());
cell_data.erase (cell_data.begin(), cell_data.end());
- if (dofs != 0)
- dofs = 0;
+ if (dofs != nullptr)
+ dofs = nullptr;
// delete patches
std::vector<Patch> dummy;
finite_elements(this->dof_data.size());
for (unsigned int i=0; i<this->dof_data.size(); ++i)
{
- Assert (dof_data[i]->dof_handler != 0,
+ Assert (dof_data[i]->dof_handler != nullptr,
Exceptions::DataOut::ExcNoDoFHandlerSelected ());
// avoid creating too many finite elements and doing a lot of work on
const unsigned int n_components
= this_fe_patch_values.get_fe().n_components();
const DataPostprocessor<dim> *postprocessor=this->dof_data[dataset]->postprocessor;
- if (postprocessor != 0)
+ if (postprocessor != nullptr)
{
// we have to postprocess the data, so determine, which fields
// have to be updated
Assert (n_subdivisions >= 1,
Exceptions::DataOut::ExcInvalidNumberOfSubdivisions(n_subdivisions));
- Assert (this->triangulation != 0,
+ Assert (this->triangulation != nullptr,
Exceptions::DataOut::ExcNoTriangulationSelected());
this->validate_dataset_names();
const unsigned int n_components
= fe_patch_values.get_fe().n_components();
const DataPostprocessor<dim> *postprocessor=this->dof_data[dataset]->postprocessor;
- if (postprocessor != 0)
+ if (postprocessor != nullptr)
{
// we have to postprocess the
// data, so determine, which
// Check consistency of redundant
// template parameter
Assert (dim==dimension, ExcDimensionMismatch(dim, dimension));
- Assert (this->triangulation != 0,
+ Assert (this->triangulation != nullptr,
Exceptions::DataOut::ExcNoTriangulationSelected());
const unsigned int n_subdivisions = (nnnn_subdivisions != 0)
void DataOutStack<dim,spacedim,DoFHandlerType>::add_data_vector (const Vector<number> &vec,
const std::vector<std::string> &names)
{
- Assert (dof_handler != 0,
+ Assert (dof_handler != nullptr,
Exceptions::DataOut::ExcNoDoFHandlerSelected ());
// either cell data and one name,
// or dof data and n_components names
Assert (n_subdivisions >= 1,
Exceptions::DataOut::ExcInvalidNumberOfSubdivisions(n_subdivisions));
- Assert (dof_handler != 0,
+ Assert (dof_handler != nullptr,
Exceptions::DataOut::ExcNoDoFHandlerSelected());
this->validate_dataset_names();
void DataOutStack<dim,spacedim,DoFHandlerType>::finish_parameter_value ()
{
// release lock on dof handler
- dof_handler = 0;
+ dof_handler = nullptr;
for (typename std::vector<DataVector>::iterator i=dof_data.begin();
i!=dof_data.end(); ++i)
i->data.reinit (0);
#ifdef DEAL_II_WITH_P4EST
if (dynamic_cast<const parallel::distributed::Triangulation<1,spacedim>*>
(&dof_handler.get_triangulation())
- != 0)
+ != nullptr)
Assert ((subdomain_id_ == numbers::invalid_subdomain_id)
||
(subdomain_id_ ==
const types::subdomain_id subdomain_id
= ((dynamic_cast<const parallel::distributed::Triangulation<1,spacedim>*>
(&dof_handler.get_triangulation())
- != 0)
+ != nullptr)
?
dynamic_cast<const parallel::distributed::Triangulation<1,spacedim>&>
(dof_handler.get_triangulation()).locally_owned_subdomain()
Assert (component_mask.n_selected_components(n_components) > 0,
ExcInvalidComponentMask());
- Assert ((coefficient == 0) ||
+ Assert ((coefficient == nullptr) ||
(coefficient->n_components == n_components) ||
(coefficient->n_components == 1),
ExcInvalidCoefficient());
ExcDimensionMismatch(solutions[n]->size(),
dof_handler.n_dofs()));
- Assert ((coefficient == 0) ||
+ Assert ((coefficient == nullptr) ||
(coefficient->n_components == n_components) ||
(coefficient->n_components == 1),
ExcInvalidCoefficient());
// coefficient, then we fill it by unity once and for all and don't set it
// any more
Vector<double> coefficient_values (n_components);
- if (coefficient == 0)
+ if (coefficient == nullptr)
for (unsigned int c=0; c<n_components; ++c)
coefficient_values(c) = 1;
// if there is a coefficient, then evaluate it at the present
// position. if there is none, reuse the preset values.
- if (coefficient != 0)
+ if (coefficient != nullptr)
{
if (coefficient->n_components == 1)
{
::clear ()
{
cleared = true;
- dof_handler = 0;
+ dof_handler = nullptr;
have_dof_handler = false;
}
{
Assert ((dynamic_cast<const parallel::distributed::Triangulation<DoFHandlerType::dimension, DoFHandlerType::space_dimension>*>
(&dof_handler->get_tria())
- == 0),
+ == nullptr),
ExcMessage ("You are calling the dealii::SolutionTransfer class "
"with a DoF handler that is built on a "
"parallel::distributed::Triangulation. This will not "
// cell stayed as it was or was refined
if (indexptr)
{
- Assert (valuesptr == 0,
+ Assert (valuesptr == nullptr,
ExcInternalError());
const unsigned int old_fe_index =
// deleted
{
Assert (!cell->has_children(), ExcInternalError());
- Assert (indexptr == 0,
+ Assert (indexptr == nullptr,
ExcInternalError());
const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
// test we would have to
// store the fe_index of all
// cells
- const Vector<typename VectorType::value_type> *data = 0;
+ const Vector<typename VectorType::value_type> *data = nullptr;
const unsigned int active_fe_index = cell->active_fe_index();
if (active_fe_index != pointerstruct->second.active_fe_index)
{
TimeStepBase *new_timestep)
{
Assert ((std::find(timesteps.begin(), timesteps.end(), position) != timesteps.end()) ||
- (position == 0),
+ (position == nullptr),
ExcInvalidPosition());
// first insert the new time step
// into the doubly linked list
// of timesteps
- if (position == 0)
+ if (position == nullptr)
{
// at the end
- new_timestep->set_next_timestep (0);
+ new_timestep->set_next_timestep (nullptr);
if (timesteps.size() > 0)
{
timesteps.back()->set_next_timestep (new_timestep);
new_timestep->set_previous_timestep (timesteps.back());
}
else
- new_timestep->set_previous_timestep (0);
+ new_timestep->set_previous_timestep (nullptr);
}
else if (position == timesteps[0])
{
// at the beginning
- new_timestep->set_previous_timestep (0);
+ new_timestep->set_previous_timestep (nullptr);
if (timesteps.size() > 0)
{
timesteps[0]->set_previous_timestep (new_timestep);
new_timestep->set_next_timestep (timesteps[0]);
}
else
- new_timestep->set_next_timestep (0);
+ new_timestep->set_next_timestep (nullptr);
}
else
{
// finally enter it into the
// array
- timesteps.insert ((position == 0 ?
+ timesteps.insert ((position == nullptr ?
timesteps.end() :
std::find(timesteps.begin(), timesteps.end(), position)),
new_timestep);
void
TimeDependent::add_timestep (TimeStepBase *new_timestep)
{
- insert_timestep (0, new_timestep);
+ insert_timestep (nullptr, new_timestep);
}
// later deletion and unlock
// SmartPointer
TimeStepBase *t = timesteps[position];
- timesteps[position] = 0;
+ timesteps[position] = nullptr;
// Now delete unsubscribed object
delete t;
TimeStepBase::TimeStepBase (const double time) :
- previous_timestep(0),
- next_timestep (0),
+ previous_timestep(nullptr),
+ next_timestep (nullptr),
sweep_no (numbers::invalid_unsigned_int),
timestep_no (numbers::invalid_unsigned_int),
time (time),
double
TimeStepBase::get_backward_timestep () const
{
- Assert (previous_timestep != 0,
+ Assert (previous_timestep != nullptr,
ExcMessage("The backward time step cannot be computed because "
"there is no previous time step."));
return time - previous_timestep->time;
double
TimeStepBase::get_forward_timestep () const
{
- Assert (next_timestep != 0,
+ Assert (next_timestep != nullptr,
ExcMessage("The forward time step cannot be computed because "
"there is no next time step."));
return next_timestep->time - time;
template <int dim>
TimeStepBase_Tria<dim>::TimeStepBase_Tria() :
TimeStepBase (0),
- tria (0, typeid(*this).name()),
- coarse_grid (0, typeid(*this).name()),
+ tria (nullptr, typeid(*this).name()),
+ coarse_grid (nullptr, typeid(*this).name()),
flags (),
refinement_flags(0)
{
const Flags &flags,
const RefinementFlags &refinement_flags) :
TimeStepBase (time),
- tria(0, typeid(*this).name()),
+ tria(nullptr, typeid(*this).name()),
coarse_grid (&coarse_grid, typeid(*this).name()),
flags (flags),
refinement_flags (refinement_flags)
if (!flags.delete_and_rebuild_tria)
{
Triangulation<dim> *t = tria;
- tria = 0;
+ tria = nullptr;
delete t;
}
else
- Assert (tria==0, ExcInternalError());
+ Assert (tria==nullptr, ExcInternalError());
- coarse_grid = 0;
+ coarse_grid = nullptr;
}
{
if (sleep_level == flags.sleep_level_to_delete_grid)
{
- Assert (tria!=0, ExcInternalError());
+ Assert (tria!=nullptr, ExcInternalError());
if (flags.delete_and_rebuild_tria)
{
Triangulation<dim> *t = tria;
- tria = 0;
+ tria = nullptr;
delete t;
}
}
template <int dim>
void TimeStepBase_Tria<dim>::restore_grid ()
{
- Assert (tria == 0, ExcGridNotDeleted());
+ Assert (tria == nullptr, ExcGridNotDeleted());
Assert (refine_flags.size() == coarsen_flags.size(),
ExcInternalError());
// two pointers into this array denoting
// the position where the two thresholds
// are assumed
- Vector<float>::const_iterator p_refinement_threshold=0,
- p_coarsening_threshold=0;
+ Vector<float>::const_iterator p_refinement_threshold=nullptr,
+ p_coarsening_threshold=nullptr;
// if we are to do some cell number
deallog << *data.try_read<double>(" d 17.") << std::endl;
- if (data.try_read<char *>(" d 17.") == 0)
+ if (data.try_read<char *>(" d 17.") == nullptr)
deallog << "(nil)" << std::endl;
else
AssertThrow (false, ExcInternalError());
- if (data.try_read<double>("does not exist") == 0)
+ if (data.try_read<double>("does not exist") == nullptr)
deallog << "(nil)" << std::endl;
else
AssertThrow (false, ExcInternalError());
for (unsigned int i=0; i<vectors.size(); ++i)
{
const VectorType *p = vectors.try_read_ptr<VectorType>(i);
- if (p!=0)
+ if (p!=nullptr)
{
// this should be equal to dof->n_dofs() otherwise
// DoFOutputOperator will complain
new FE_DGQ<dim>(0),
new FE_DGQ<dim>(1),
new FE_DGQ<dim>(2),
- (dim<3 ? new FE_DGQ<dim>(3) : 0),
- (dim<3 ? new FE_DGQ<dim>(4) : 0),
+ (dim<3 ? new FE_DGQ<dim>(3) : nullptr),
+ (dim<3 ? new FE_DGQ<dim>(4) : nullptr),
// FE_DGP
new FE_DGP<dim>(0),
for (unsigned int i=0; i<sizeof(fe_list)/sizeof(fe_list[0]); ++i)
- if (fe_list[i] != 0)
+ if (fe_list[i] != nullptr)
{
deallog << dim << "d, uniform grid, fe #" << i
<< ", " << ref_case_names[j];
for (unsigned int i=0; i<sizeof(fe_list)/sizeof(fe_list[0]); ++i)
- if (fe_list[i] != 0)
+ if (fe_list[i] != nullptr)
delete fe_list[i];
}
ArrayView<int> a (&v[4], 0);
ArrayView<int> b = a;
- ArrayView<int> c (NULL, 0);
+ ArrayView<int> c (nullptr, 0);
ArrayView<int> d = a;
deallog << "OK" << std::endl;
}
};
+
+template<typename T>
+struct EqualityWithSizeofTest<T *>
+{
+ EqualityWithSizeofTest()
+ {
+ T *t = nullptr;
+ deallog << (sizeof(t) == dealii::MemoryConsumption::memory_consumption(t))
+ << std::endl;
+
+ std::vector<T *> vector_test(42);
+ deallog << ((sizeof(std::vector<T *>) + vector_test.capacity()*sizeof(T *))
+ == dealii::MemoryConsumption::memory_consumption(vector_test))
+ << std::endl;
+ }
+};
+
+
int main()
{
std::ofstream logfile("output");
// started out with
Patterns::Integer *pattern2 = Patterns::Integer::create (desc);
- AssertThrow (pattern2 != 0, ExcInternalError());
+ AssertThrow (pattern2 != nullptr, ExcInternalError());
AssertThrow (desc == pattern2->description(), ExcInternalError());
deallog << desc << std::endl;
Quadrature<0> &
get_q_face (Function<1> &)
{
- Quadrature<0> *q = 0;
+ Quadrature<0> *q = nullptr;
return *q;
}
Vector<float> this_error (tria.n_active_cells());
KellyErrorEstimator<dim>::estimate (mapping, dof, q_face, neumann_bc,
v, this_error,
- std::vector<bool>(), 0,
+ std::vector<bool>(), nullptr,
MultithreadInfo::n_threads(),
subdomain);
this_error *= scaling_factor;
Quadrature<0> &
get_q_face (Function<1> &)
{
- Quadrature<0> *q = 0;
+ Quadrature<0> *q = nullptr;
return *q;
}
Vector<float> this_error (tria.n_active_cells());
KellyErrorEstimator<dim>::estimate (mapping, dof, q_face, neumann_bc,
v, this_error,
- std::vector<bool>(), 0,
+ std::vector<bool>(), nullptr,
MultithreadInfo::n_threads(),
numbers::invalid_unsigned_int,
material);
const RightHandSide<dim> rhs_function;
const Solution<dim> boundary_values;
- LaplaceSolver::Base<dim> *solver = 0;
+ LaplaceSolver::Base<dim> *solver = nullptr;
if (solver_name == "global")
solver = new LaplaceSolver::RefinementGlobal<dim> (triangulation, fe,
quadrature,
const QGauss<dim> quadrature(descriptor.dual_fe_degree+1);
const QGauss<dim-1> face_quadrature(descriptor.dual_fe_degree+1);
- LaplaceSolver::Base<dim> *solver = 0;
+ LaplaceSolver::Base<dim> *solver = nullptr;
switch (descriptor.refinement_criterion)
{
case ProblemDescription::dual_weighted_error_estimator:
deallog << std::endl;
delete solver;
- solver = 0;
+ solver = nullptr;
}
LaplaceKernelIntegration<dim>::~LaplaceKernelIntegration()
{
FEValues<dim,dim+1> *fp = fe_values;
- fe_values = 0;
+ fe_values = nullptr;
delete fp;
}
Quadrature<0> &
get_q_face <1>()
{
- Quadrature<0> *q = 0;
+ Quadrature<0> *q = nullptr;
return *q;
}
Vector<float> this_error (tria.n_active_cells());
KellyErrorEstimator<dim,spacedim>::estimate (mapping, dof, q_face, neumann_bc,
v, this_error,
- std::vector<bool>(), 0,
+ std::vector<bool>(), nullptr,
MultithreadInfo::n_threads(),
subdomain);
this_error *= scaling_factor;
Quadrature<0> &
get_q_face <1>()
{
- Quadrature<0> *q = 0;
+ Quadrature<0> *q = nullptr;
return *q;
}
cell != dof.end(); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
deallog << p << '\t' << v[i] << std::endl;
cell != dof.end(level); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_mg_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
deallog << p << '\t' << v[i] << std::endl;
cell != dof.end(); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
deallog << p << '\t' << v[i] << std::endl;
cell != dof.end(); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
deallog << p << '\t' << v[i] << std::endl;
cell != dof.end(); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
deallog << p << '\t' << v[i] << std::endl;
cell != dof.end(); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
deallog << p << '\t' << v[i] << std::endl;
cell != dof.end(); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
deallog << p << '\t' << v[i] << std::endl;
cell != dof.end(); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
deallog << p << '\t' << v[i] << std::endl;
cell != dof.end(); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
out << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
out << p << '\t' << v[i] << std::endl;
cell != dof.end(); ++cell)
{
Point<dim> p = cell->center();
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
fevalues->reinit(cell);
cell->get_dof_indices (v);
for (unsigned int i=0; i<v.size(); ++i)
- if (fevalues.get() != 0)
+ if (fevalues.get() != nullptr)
out << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
else
out << p << '\t' << v[i] << std::endl;
template <int dim>
TestCases<dim>::TestCases () :
- tria(0), dof(0) {}
+ tria(nullptr), dof(nullptr) {}
template <int dim>
void TestCases<dim>::create_new ()
{
- if (dof != 0) delete dof;
- if (tria != 0) delete tria;
+ if (dof != nullptr) delete dof;
+ if (tria != nullptr) delete tria;
tria = new Triangulation<dim>();
GridGenerator::hyper_cube(*tria);
// with FunctionMap
typename FunctionMap<dim>::type fm;
- fm[0] = 0;
+ fm[0] = nullptr;
deallog << dof_handler.n_boundary_dofs(fm) << std::endl;
// with std::set
// create sparsity pattern
typename FunctionMap<dim>::type boundary_ids;
- boundary_ids[0] = 0;
+ boundary_ids[0] = nullptr;
SparsityPattern sp (dof_handler.n_boundary_dofs(boundary_ids),
dof_handler.max_couplings_between_dofs());
DoFTools::make_boundary_sparsity_pattern (dof_handler, boundary_ids,
// create sparsity pattern
typename FunctionMap<dim>::type boundary_ids;
- boundary_ids[0] = 0;
+ boundary_ids[0] = nullptr;
DynamicSparsityPattern sp (dof_handler.n_boundary_dofs(boundary_ids));
DoFTools::make_boundary_sparsity_pattern (dof_handler, boundary_ids,
map, sp);
DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
typename FunctionMap<dim>::type boundary_ids;
- boundary_ids[0] = 0;
+ boundary_ids[0] = nullptr;
const unsigned int n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
const unsigned int n_blocks = std::min (dof_handler.get_fe().n_components(),
n_boundary_dofs);
DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
typename FunctionMap<dim>::type boundary_ids;
- boundary_ids[0] = 0;
+ boundary_ids[0] = nullptr;
const types::global_dof_index n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
const unsigned int n_blocks = std::min (
static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
const hp::QCollection<dim> quadrature(QGauss<dim>(descriptor.dual_fe_degree+1));
const hp::QCollection<dim-1> face_quadrature(QGauss<dim-1>(descriptor.dual_fe_degree+1));
- LaplaceSolver::Base<dim> *solver = 0;
+ LaplaceSolver::Base<dim> *solver = nullptr;
switch (descriptor.refinement_criterion)
{
case ProblemDescription::dual_weighted_error_estimator:
deallog << std::endl;
delete solver;
- solver = 0;
+ solver = nullptr;
}
};
for (unsigned int i=0; i<sizeof(fe_list)/sizeof(fe_list[0]); ++i)
- if (fe_list[i] != 0)
+ if (fe_list[i] != nullptr)
{
deallog << dim << "d, uniform grid, fe #" << i;
check_element (tr, *fe_list[i]);
SparseMatrix<double> &matrix,
const Function<dim> &rhs_function,
Vector<double> &rhs_vector,
- const Function<dim> *const coefficient = 0)
+ const Function<dim> *const coefficient = nullptr)
{
UpdateFlags update_flags = UpdateFlags(update_values | update_JxW_values | update_quadrature_points);
- if (coefficient != 0)
+ if (coefficient != nullptr)
update_flags = UpdateFlags (update_flags | update_quadrature_points);
FEValues<dim> fe_values (mapping, dof.get_fe(), q, update_flags);
const FiniteElement<dim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components();
- Assert(coefficient == 0 ||
+ Assert(coefficient == nullptr ||
coefficient->n_components==1 ||
coefficient->n_components==n_components, ExcInternalError());
rhs_function.vector_value_list (fe_values.get_quadrature_points(), rhs_values);
cell_vector = 0;
- if (coefficient != 0)
+ if (coefficient != nullptr)
{
if (coefficient->n_components==1)
{
SparseMatrix<double> &matrix,
const Function<dim> &rhs_function,
Vector<double> &rhs_vector,
- const Function<dim> *const coefficient = 0)
+ const Function<dim> *const coefficient = nullptr)
{
UpdateFlags update_flags = UpdateFlags(update_values | update_JxW_values | update_quadrature_points);
- if (coefficient != 0)
+ if (coefficient != nullptr)
update_flags = UpdateFlags (update_flags | update_quadrature_points);
FEValues<dim> fe_values (mapping, dof.get_fe(), q, update_flags);
const FiniteElement<dim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components();
- Assert(coefficient == 0 ||
+ Assert(coefficient == nullptr ||
coefficient->n_components==1 ||
coefficient->n_components==n_components, ExcInternalError());
rhs_function.vector_value_list (fe_values.get_quadrature_points(), rhs_values);
cell_vector = 0;
- if (coefficient != 0)
+ if (coefficient != nullptr)
{
if (coefficient->n_components==1)
{
SparseMatrix<double> &matrix,
const Function<dim> &rhs_function,
Vector<double> &rhs_vector,
- const Function<dim> *const coefficient = 0)
+ const Function<dim> *const coefficient = nullptr)
{
UpdateFlags update_flags = UpdateFlags(update_values | update_JxW_values | update_quadrature_points);
- if (coefficient != 0)
+ if (coefficient != nullptr)
update_flags = UpdateFlags (update_flags | update_quadrature_points);
FEValues<dim> fe_values (mapping, dof.get_fe(), q, update_flags);
const FiniteElement<dim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components();
- Assert(coefficient == 0 ||
+ Assert(coefficient == nullptr ||
coefficient->n_components==1 ||
coefficient->n_components==n_components, ExcInternalError());
rhs_function.vector_value_list (fe_values.get_quadrature_points(), rhs_values);
cell_vector = 0;
- if (coefficient != 0)
+ if (coefficient != nullptr)
{
if (coefficient->n_components==1)
{
new FE_Q<dim>(1),
new FE_Q<dim>(2),
new FE_Q<dim>(3),
- (dim<2 ? new FE_Q<dim>(4) : 0),
- (dim<2 ? new FE_Q<dim>(5) : 0),
+ (dim<2 ? new FE_Q<dim>(4) : nullptr),
+ (dim<2 ? new FE_Q<dim>(5) : nullptr),
// FE_DGQ
new FE_DGQ<dim>(0),
new FE_DGQ<dim>(1),
new FE_DGQ<dim>(2),
- (dim<3 ? new FE_DGQ<dim>(3) : 0),
- (dim<3 ? new FE_DGQ<dim>(4) : 0),
+ (dim<3 ? new FE_DGQ<dim>(3) : nullptr),
+ (dim<3 ? new FE_DGQ<dim>(4) : nullptr),
// FE_DGP does not
// presently have the
// new FE_DGP<dim>(3),
// a non-primitive FE
- (dim != 1 ? new FE_Nedelec<dim>(0) : 0),
- (dim != 1 ? new FE_Nedelec<dim>(1) : 0),
+ (dim != 1 ? new FE_Nedelec<dim>(0) : nullptr),
+ (dim != 1 ? new FE_Nedelec<dim>(1) : nullptr),
// some composed elements
// of increasing
// really difficult
(dim != 1 ?
new FESystem<dim>(FE_Nedelec<dim>(0), 2)
- : 0),
+ : nullptr),
(dim != 1 ?
new FESystem<dim>(FE_Nedelec<dim>(0), 2,
FE_Q<dim> (2), 2)
- : 0),
+ : nullptr),
(dim != 1 ?
new FESystem<dim>(FE_Nedelec<dim>(0), 2,
FE_DGQ<dim> (2), 2,
FESystem<dim>(FE_Nedelec<dim>(0), 2,
FE_Q<dim> (2), 2), 2)
- : 0),
+ : nullptr),
};
for (unsigned int i=0; i<sizeof(fe_list)/sizeof(fe_list[0]); ++i)
- if (fe_list[i] != 0)
+ if (fe_list[i] != nullptr)
{
deallog << dim << "d, uniform grid, fe #" << i;
check_element (tr, *fe_list[i]);
for (unsigned int i=0; i<sizeof(fe_list)/sizeof(fe_list[0]); ++i)
- if (fe_list[i] != 0)
+ if (fe_list[i] != nullptr)
delete fe_list[i];
}
}
// then compute new point locations and output the result
- GridTools::laplace_transform<dim> (new_points,tria, NULL, true);
+ GridTools::laplace_transform<dim> (new_points,tria, nullptr, true);
std::ofstream out ("output");
GridOut grid_out;
grid_out.write_eps (tria, out);
}
}
- GridTools::laplace_transform<dim> (new_points, tria, NULL, true);
+ GridTools::laplace_transform<dim> (new_points, tria, nullptr, true);
GridOut grid_out;
?
new FE_DGQ<dim>(2)
:
- 0);
+ nullptr);
// define composed finite
// elements. to limit memory
delete fe_1;
delete fe_2;
- if (fe_dq_quadratic != 0)
+ if (fe_dq_quadratic != nullptr)
delete fe_dq_quadratic;
}
rhs_function, rhs_ref);
constraints.condense(matrix_ref, rhs_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
hp::QCollection<dim>(quadrature), matrix,
rhs_function, rhs, dummy, constraints);
hp::QCollection<dim>(quadrature), matrix_ref);
constraints.condense(matrix_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
hp::QCollection<dim>(quadrature), matrix,
dummy, constraints);
rhs_function, rhs_ref);
constraints.condense(matrix_ref, rhs_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
hp::QCollection<dim>(quadrature), matrix,
rhs_function, rhs, dummy, constraints);
hp::QCollection<dim>(quadrature), matrix_ref);
constraints.condense(matrix_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
hp::QCollection<dim>(quadrature), matrix,
dummy, constraints);
const RightHandSide<dim> rhs_function;
const Solution<dim> boundary_values;
- LaplaceSolver::Base<dim> *solver = 0;
+ LaplaceSolver::Base<dim> *solver = nullptr;
if (solver_name == "global")
solver = new LaplaceSolver::RefinementGlobal<dim> (triangulation, fe,
quadrature,
MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >(
dof.begin_active(), dof.end(), dof_info, info_box,
- cell_matrix<dim>, 0, 0, assembler);
+ cell_matrix<dim>, nullptr, nullptr, assembler);
for (unsigned int b=0; b<matrices.size(); ++b)
if (b%3 == 0)
dof_info,
info_box,
&MatrixIntegrator<dim>::cell,
- 0,
+ nullptr,
&MatrixIntegrator<dim>::face,
assembler);
}
deallog.attach(logfile);
deallog.threshold_double(1.e-10);
- FiniteElement<3> *fe = 0;
+ FiniteElement<3> *fe = nullptr;
for (unsigned int element=0; element<2; ++element)
{
// delete all triangulations and
// boundary objects
for (unsigned int i=0; i<tria_ptr.size(); ++i)
- if (tria_ptr[i]!=0)
+ if (tria_ptr[i]!=nullptr)
delete tria_ptr[i];
for (unsigned int i=0; i<boundary_ptr.size(); ++i)
- if (boundary_ptr[i]!=0)
+ if (boundary_ptr[i]!=nullptr)
delete boundary_ptr[i];
}
// create
ierr = METIS_PartGraphRecursive(&n, &ncon, &int_rowstart[0], &int_colnums[0],
- NULL, NULL, NULL,
- &nparts,NULL,NULL,&options[0],
+ nullptr, nullptr, nullptr,
+ &nparts,nullptr,nullptr,&options[0],
&dummy,&int_partition_indices[0]);
deallog << "METIS outputs:" << std::endl;
unsigned int tag = 1234;
for (std::set<types::subdomain_id>::iterator it = s.begin();
it != s.end(); ++it)
- MPI_Send(NULL, 0, MPI_INT, *it, tag, MPI_COMM_WORLD);
+ MPI_Send(nullptr, 0, MPI_INT, *it, tag, MPI_COMM_WORLD);
for (unsigned int i=0; i<s.size(); ++i)
{
MPI_Status status;
- MPI_Recv(NULL, 0, MPI_INT, MPI_ANY_SOURCE, tag, MPI_COMM_WORLD, &status);
+ MPI_Recv(nullptr, 0, MPI_INT, MPI_ANY_SOURCE, tag, MPI_COMM_WORLD, &status);
if ((s.end() == s.find(status.MPI_SOURCE)))
deallog << status.MPI_SOURCE << " NOTOKAY" << std::endl;
Assert(s.end() != s.find(status.MPI_SOURCE), ExcInternalError());
unsigned int tag = 1234;
for (std::set<types::subdomain_id>::iterator it = s.begin();
it != s.end(); ++it)
- MPI_Send(NULL, 0, MPI_INT, *it, tag, MPI_COMM_WORLD);
+ MPI_Send(nullptr, 0, MPI_INT, *it, tag, MPI_COMM_WORLD);
for (unsigned int i=0; i<s.size(); ++i)
{
MPI_Status status;
- MPI_Recv(NULL, 0, MPI_INT, MPI_ANY_SOURCE, tag, MPI_COMM_WORLD, &status);
+ MPI_Recv(nullptr, 0, MPI_INT, MPI_ANY_SOURCE, tag, MPI_COMM_WORLD, &status);
if ((s.end() == s.find(status.MPI_SOURCE)))
deallog << status.MPI_SOURCE << " NOTOKAY" << std::endl;
Assert(s.end() != s.find(status.MPI_SOURCE), ExcInternalError());
dof.begin_mg(l), dof.end_mg(l),
dof_info, info_box,
std::bind(&OutputCreator<dim>::cell, &matrix_integrator, std::placeholders::_1, std::placeholders::_2),
- 0,
- 0,
+ nullptr,
+ nullptr,
assembler);
}
}
dof.begin_mg(l), dof.end_mg(l),
dof_info, info_box,
std::bind(&OutputCreator<dim>::cell, &matrix_integrator, std::placeholders::_1, std::placeholders::_2),
- 0,
- 0,
+ nullptr,
+ nullptr,
assembler);
}
}
const Quadrature<0> &
boundary_q (const DoFHandler<1> &)
{
- static const Quadrature<0> *q = 0;
+ static const Quadrature<0> *q = nullptr;
return *q;
}
rhs_function, rhs_ref);
constraints.condense(matrix_ref, rhs_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_laplace_matrix (mapping, dof, quadrature, matrix,
rhs_function, rhs, dummy, constraints);
rhs_function, rhs_ref);
constraints.condense(matrix_ref, rhs_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_laplace_matrix (mapping, dof, quadrature, matrix,
rhs_function, rhs, dummy, constraints);
quadrature, matrix_ref);
constraints.condense(matrix_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_laplace_matrix (mapping, dof, quadrature, matrix,
dummy, constraints);
rhs_function, rhs_ref);
constraints.condense(matrix_ref, rhs_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_mass_matrix (mapping, dof, quadrature, matrix,
rhs_function, rhs, dummy, constraints);
rhs_function, rhs_ref);
constraints.condense(matrix_ref, rhs_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_mass_matrix (mapping, dof, quadrature, matrix,
rhs_function, rhs, dummy, constraints);
quadrature, matrix_ref);
constraints.condense(matrix_ref);
- const Function<dim> *const dummy = 0;
+ const Function<dim> *const dummy = nullptr;
MatrixTools::create_mass_matrix (mapping, dof, quadrature, matrix,
dummy, constraints);
Quadrature<0> &
get_q_face (Function<1> &)
{
- Quadrature<0> *q = 0;
+ Quadrature<0> *q = nullptr;
return *q;
}
values,
error,
dealii::ComponentMask(),
- 0,
+ nullptr,
dealii::numbers::invalid_unsigned_int,
dealii::numbers::invalid_subdomain_id,
dealii::numbers::invalid_material_id,
values,
error,
dealii::ComponentMask(),
- 0,
+ nullptr,
dealii::numbers::invalid_unsigned_int,
dealii::numbers::invalid_subdomain_id,
dealii::numbers::invalid_material_id,
values,
error,
dealii::ComponentMask(),
- 0,
+ nullptr,
dealii::numbers::invalid_unsigned_int,
dealii::numbers::invalid_subdomain_id,
dealii::numbers::invalid_material_id,
values,
error,
dealii::ComponentMask(),
- 0,
+ nullptr,
dealii::numbers::invalid_unsigned_int,
dealii::numbers::invalid_subdomain_id,
dealii::numbers::invalid_material_id,
const Quadrature<0> &
boundary_q (const DoFHandler<1> &)
{
- static const Quadrature<0> *q = 0;
+ static const Quadrature<0> *q = nullptr;
return *q;
}
incremental_displacement,
error_per_cell,
ComponentMask(),
- 0,
+ nullptr,
MultithreadInfo::n_threads(),
this_mpi_process);
const unsigned int n_local_cells = triangulation.n_locally_owned_active_cells ();
incremental_displacement,
error_per_cell,
ComponentMask(),
- 0,
+ nullptr,
MultithreadInfo::n_threads(),
this_mpi_process);
const unsigned int n_local_cells = triangulation.n_locally_owned_active_cells ();
int get_num_thread_env()
{
const char *penv = getenv ("DEAL_II_NUM_THREADS");
- if (penv!=NULL)
+ if (penv!=nullptr)
{
int max_threads_env = -1;
try
// p2 should have been created, and should
// have been different from the address of
// p1
- AssertThrow (p2 != 0, ExcInternalError());
+ AssertThrow (p2 != nullptr, ExcInternalError());
AssertThrow (p1 != p2, ExcInternalError());
delete p1;
pair_1.first.c = c;
pair_1.second.c = c;
- pair_2.first.c = 0;
- pair_2.second.c = 0;
+ pair_2.first.c = nullptr;
+ pair_2.second.c = nullptr;
verify (pair_1, pair_2);
logfile << "Initializing SLEPc (PETSc): "
<< std::flush;
- SlepcInitialize (&argc, &argv, 0, 0);
+ SlepcInitialize (&argc, &argv, nullptr, nullptr);
{
logfile << "ok"
<< std::endl;
logfile << "Initializing SLEPc (PETSc): "
<< std::flush;
- SlepcInitialize (&argc, &argv, 0, 0);
+ SlepcInitialize (&argc, &argv, nullptr, nullptr);
{
logfile << "ok"
<< std::endl;
const dealii::parallel::distributed::Triangulation<dim,spacedim> *tria =
(dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&mg_dof.get_triangulation()));
- AssertThrow(tria!=NULL, ExcMessage("multigrid with Trilinos vectors only works with distributed Triangulation!"));
+ AssertThrow(tria!=nullptr, ExcMessage("multigrid with Trilinos vectors only works with distributed Triangulation!"));
for (unsigned int level=v.min_level();
level<=v.max_level(); ++level)
Vector<double> cellwise_errors (tria.n_active_cells());
QIterated<dim> quadrature (QTrapez<1>(), 5);
- const dealii::Function<dim,double> *w = 0;
+ const dealii::Function<dim,double> *w = nullptr;
VectorTools::integrate_difference (dofh,
solution,
ZeroFunction<dim>(dim),
Vector<double> cellwise_errors (tria.n_active_cells());
QIterated<dim> quadrature (QTrapez<1>(), 5);
- const dealii::Function<dim,double> *w = 0;
+ const dealii::Function<dim,double> *w = nullptr;
VectorTools::integrate_difference (dofh,
solution,
ZeroFunction<dim>(dim),
Vector<double> cellwise_errors (tria.n_active_cells());
QIterated<dim> quadrature (QTrapez<1>(), 5);
- const dealii::Function<dim,double> *w = 0;
+ const dealii::Function<dim,double> *w = nullptr;
VectorTools::integrate_difference (dofh,
solution,
ZeroFunction<dim>(dim),