#include <laspack_vector.h>
LaspackVector (const ParallelType=AUTOMATIC)
LaspackVector (const unsigned int n, const ParallelType=AUTOMATIC)
LaspackVector (const unsigned int n, const unsigned int n_local, const ParallelType=AUTOMATIC)
LaspackVector (const unsigned int N, const unsigned int n_local, const std::vector< unsigned int > &ghost, const ParallelType=AUTOMATIC)
~LaspackVector ()
void close ()
void clear ()
void zero ()
AutoPtr< NumericVector< T > > clone () const
void init (const unsigned int N, const unsigned int n_local, const bool fast=false, const ParallelType type=AUTOMATIC)
void init (const unsigned int N, const bool fast=false, const ParallelType type=AUTOMATIC)
void init (const unsigned int, const unsigned int, const std::vector< unsigned int > &, const bool=false, const ParallelType=AUTOMATIC)
virtual void init (const NumericVector< T > &other, const bool fast=false)
NumericVector< T > & operator= (const T s)
NumericVector< T > & operator= (const NumericVector< T > &V)
LaspackVector< T > & operator= (const LaspackVector< T > &V)
NumericVector< T > & operator= (const std::vector< T > &v)
Real min () const
Real max () const
T sum () const
Real l1_norm () const
Real l2_norm () const
Real linfty_norm () const
unsigned int size () const
unsigned int local_size () const
unsigned int first_local_index () const
unsigned int last_local_index () const
T operator() (const unsigned int i) const
NumericVector< T > & operator+= (const NumericVector< T > &V)
NumericVector< T > & operator-= (const NumericVector< T > &V)
void set (const unsigned int i, const T value)
void add (const unsigned int i, const T value)
void add (const T s)
void add (const NumericVector< T > &V)
void add (const T a, const NumericVector< T > &v)
void add_vector (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices)
void add_vector (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices)
void add_vector (const NumericVector< T > &, const SparseMatrix< T > &)
void add_vector (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices)
virtual void insert (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices)
virtual void insert (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices)
virtual void insert (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices)
virtual void insert (const DenseSubVector< T > &V, const std::vector< unsigned int > &dof_indices)
void scale (const T factor)
virtual void abs ()
virtual T dot (const NumericVector< T > &V) const
void localize (std::vector< T > &v_local) const
void localize (NumericVector< T > &v_local) const
void localize (NumericVector< T > &v_local, const std::vector< unsigned int > &send_list) const
void localize (const unsigned int first_local_idx, const unsigned int last_local_idx, const std::vector< unsigned int > &send_list)
void localize_to_one (std::vector< T > &v_local, const unsigned int proc_id=0) const
virtual void pointwise_mult (const NumericVector< T > &vec1, const NumericVector< T > &vec2)
virtual void swap (NumericVector< T > &v)
virtual bool initialized () const
ParallelType type () const
ParallelType & type ()
virtual bool closed () const
virtual Real subset_l1_norm (const std::set< unsigned int > &indices)
virtual Real subset_l2_norm (const std::set< unsigned int > &indices)
virtual Real subset_linfty_norm (const std::set< unsigned int > &indices)
virtual T el (const unsigned int i) const
virtual void get (const std::vector< unsigned int > &index, std::vector< T > &values) const
NumericVector< T > & operator*= (const T a)
NumericVector< T > & operator/= (const T a)
void add_vector (const NumericVector< T > &v, const ShellMatrix< T > &a)
virtual int compare (const NumericVector< T > &other_vector, const Real threshold=TOLERANCE) const
template<> int compare (const NumericVector< float > &other_vector, const Real threshold) const
template<> int compare (const NumericVector< double > &other_vector, const Real threshold) const
template<> int compare (const NumericVector< long double > &other_vector, const Real threshold) const
template<> int compare (const NumericVector< Complex > &other_vector, const Real threshold) const
virtual void print (std::ostream &os=std::cout) const
template<> void print (std::ostream &os) const
virtual void print_global (std::ostream &os=std::cout) const
template<> void print_global (std::ostream &os) const
virtual void print_matlab (const std::string name='NULL') const
virtual void create_subvector (NumericVector< T > &, const std::vector< unsigned int > &) const
static AutoPtr< NumericVector< T > > build (const SolverPackage solver_package=libMesh::default_solver_package())
static std::string get_info ()
static void print_info ()
static unsigned int n_objects ()
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
void increment_constructor_count (const std::string &name)
void increment_destructor_count (const std::string &name)
bool _is_closed
bool _is_initialized
ParallelType _type
static Counts _counts
static Threads::atomic< unsigned int > _n_objects
static Threads::spin_mutex _mutex
class LaspackLinearSolver< T >
std::ostream & operator<< (std::ostream &os, const NumericVector< T > &v)
Author:
Definition at line 61 of file laspack_vector.h.
Definition at line 105 of file reference_counter.h.
Definition at line 451 of file laspack_vector.h.
{
this->_type = type;
}
Definition at line 460 of file laspack_vector.h.
References libMesh::init().
{
this->init(n, n, false, type);
}
Definition at line 470 of file laspack_vector.h.
References libMesh::init().
{
this->init(n, n_local, false, type);
}
Definition at line 481 of file laspack_vector.h.
References libMesh::init().
{
this->init(N, n_local, ghost, false, type);
}
Definition at line 493 of file laspack_vector.h.
References LaspackLinearSolver< T >::clear().
{
this->clear ();
}
Implements NumericVector< T >.
Definition at line 255 of file laspack_vector.C.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
const unsigned int n = this->size();
for (unsigned int i=0; i!=n; ++i)
this->set(i,std::abs((*this)(i)));
}
Implements NumericVector< T >.
Definition at line 679 of file laspack_vector.h.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
libmesh_assert (i < this->size());
V_AddCmp (&_vec, i+1, value);
}
Implements NumericVector< T >.
Definition at line 108 of file laspack_vector.C.
{
const unsigned int n = this->size();
for (unsigned int i=0; i<n; i++)
this->add (i, v);
}
Implements NumericVector< T >.
Definition at line 120 of file laspack_vector.C.
{
this->add (1., v);
}
Implements NumericVector< T >.
Definition at line 128 of file laspack_vector.C.
References LaspackVector< T >::size().
{
// Make sure the vector passed in is really a LaspackVector
const LaspackVector* v = libmesh_cast_ptr<const LaspackVector*>(&v_in);
libmesh_assert (v != NULL);
libmesh_assert (this->size() == v->size());
for (unsigned int i=0; i<v->size(); i++)
this->add (i, a*(*v)(i));
}
Implements NumericVector< T >.
Definition at line 229 of file laspack_vector.C.
References LaspackVector< T >::_vec.
{
// Make sure the data passed in are really in Laspack types
const LaspackVector<T>* vec = libmesh_cast_ptr<const LaspackVector<T>*>(&vec_in);
const LaspackMatrix<T>* mat = libmesh_cast_ptr<const LaspackMatrix<T>*>(&mat_in);
libmesh_assert (vec != NULL);
libmesh_assert (mat != NULL);
// += mat*vec
AddAsgn_VV (&_vec, Mul_QV(const_cast<QMatrix*>(&mat->_QMat),
const_cast<QVector*>(&vec->_vec)));
}
Implements NumericVector< T >.
Definition at line 168 of file laspack_vector.C.
References DenseVector< T >::size().
{
libmesh_assert (V.size() == dof_indices.size());
for (unsigned int i=0; i<V.size(); i++)
this->add (dof_indices[i], V(i));
}
Implements NumericVector< T >.
Definition at line 156 of file laspack_vector.C.
References NumericVector< T >::size().
{
libmesh_assert (V.size() == dof_indices.size());
for (unsigned int i=0; i<V.size(); i++)
this->add (dof_indices[i], V(i));
}
Definition at line 253 of file numeric_vector.C.
References ShellMatrix< T >::vector_mult_add().
{
a.vector_mult_add(*this,v);
}
Implements NumericVector< T >.
Definition at line 143 of file laspack_vector.C.
{
libmesh_assert (!v.empty());
libmesh_assert (v.size() == dof_indices.size());
for (unsigned int i=0; i<v.size(); i++)
this->add (dof_indices[i], v[i]);
}
Definition at line 41 of file numeric_vector.C.
References LASPACK_SOLVERS, libMeshEnums::PETSC_SOLVERS, and TRILINOS_SOLVERS.
Referenced by ExactErrorEstimator::estimate_error().
{
// Build the appropriate vector
switch (solver_package)
{
#ifdef LIBMESH_HAVE_LASPACK
case LASPACK_SOLVERS:
{
AutoPtr<NumericVector<T> > ap(new LaspackVector<T>);
return ap;
}
#endif
#ifdef LIBMESH_HAVE_PETSC
case PETSC_SOLVERS:
{
AutoPtr<NumericVector<T> > ap(new PetscVector<T>);
return ap;
}
#endif
#ifdef LIBMESH_HAVE_TRILINOS
case TRILINOS_SOLVERS:
{
AutoPtr<NumericVector<T> > ap(new EpetraVector<T>);
return ap;
}
#endif
default:
AutoPtr<NumericVector<T> > ap(new DistributedVector<T>);
return ap;
}
AutoPtr<NumericVector<T> > ap(NULL);
return ap;
}
Reimplemented from NumericVector< T >.
Definition at line 584 of file laspack_vector.h.
References libMesh::libMeshPrivateData::_is_initialized, and libMesh::initialized().
{
if (this->initialized())
{
V_Destr (&_vec);
}
this->_is_closed = this->_is_initialized = false;
}
Implements NumericVector< T >.
Definition at line 608 of file laspack_vector.h.
{
AutoPtr<NumericVector<T> > cloned_vector (new LaspackVector<T>);
cloned_vector->init(*this, true);
*cloned_vector = *this;
return cloned_vector;
}
Implements NumericVector< T >.
Definition at line 573 of file laspack_vector.h.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
this->_is_closed = true;
}
Definition at line 125 of file numeric_vector.h.
Referenced by DofMap::enforce_constraints_exactly(), and DofMap::max_constraint_error().
{ return _is_closed; }
Definition at line 114 of file numeric_vector.C.
References NumericVector< T >::first_local_index(), NumericVector< T >::initialized(), libMesh::initialized(), and NumericVector< T >::last_local_index().
{
libmesh_assert (this->initialized());
libmesh_assert (other_vector.initialized());
libmesh_assert (this->first_local_index() == other_vector.first_local_index());
libmesh_assert (this->last_local_index() == other_vector.last_local_index());
int rvalue = -1;
unsigned int i = first_local_index();
do
{
if ( std::abs( (*this)(i) - other_vector(i) ) > threshold )
rvalue = i;
else
i++;
}
while (rvalue==-1 && i<last_local_index());
return rvalue;
}
Definition at line 140 of file numeric_vector.C.
References NumericVector< T >::first_local_index(), NumericVector< T >::initialized(), libMesh::initialized(), and NumericVector< T >::last_local_index().
{
libmesh_assert (this->initialized());
libmesh_assert (other_vector.initialized());
libmesh_assert (this->first_local_index() == other_vector.first_local_index());
libmesh_assert (this->last_local_index() == other_vector.last_local_index());
int rvalue = -1;
unsigned int i = first_local_index();
do
{
if ( std::abs( (*this)(i) - other_vector(i) ) > threshold )
rvalue = i;
else
i++;
}
while (rvalue==-1 && i<last_local_index());
return rvalue;
}
Definition at line 167 of file numeric_vector.C.
References NumericVector< T >::first_local_index(), NumericVector< T >::initialized(), libMesh::initialized(), and NumericVector< T >::last_local_index().
{
libmesh_assert (this->initialized());
libmesh_assert (other_vector.initialized());
libmesh_assert (this->first_local_index() == other_vector.first_local_index());
libmesh_assert (this->last_local_index() == other_vector.last_local_index());
int rvalue = -1;
unsigned int i = first_local_index();
do
{
if (( std::abs( (*this)(i).real() - other_vector(i).real() ) > threshold ) ||
( std::abs( (*this)(i).imag() - other_vector(i).imag() ) > threshold ))
rvalue = i;
else
i++;
}
while (rvalue==-1 && i<this->last_local_index());
return rvalue;
}
Definition at line 89 of file numeric_vector.C.
References NumericVector< T >::first_local_index(), NumericVector< T >::initialized(), libMesh::initialized(), and NumericVector< T >::last_local_index().
{
libmesh_assert (this->initialized());
libmesh_assert (other_vector.initialized());
libmesh_assert (this->first_local_index() == other_vector.first_local_index());
libmesh_assert (this->last_local_index() == other_vector.last_local_index());
int rvalue = -1;
unsigned int i = first_local_index();
do
{
if ( std::abs( (*this)(i) - other_vector(i) ) > threshold )
rvalue = i;
else
i++;
}
while (rvalue==-1 && i<last_local_index());
return rvalue;
}
Reimplemented in PetscVector< T >, and EpetraVector< T >.
Definition at line 562 of file numeric_vector.h.
{
std::cerr << 'ERROR: Not Implemented in base class yet!' << std::endl;
libmesh_error();
}
Implements NumericVector< T >.
Definition at line 266 of file laspack_vector.C.
References LaspackVector< T >::_vec, and libMesh::initialized().
{
libmesh_assert (this->initialized());
// Make sure the NumericVector passed in is really a LaspackVector
const LaspackVector<T>* v = libmesh_cast_ptr<const LaspackVector<T>*>(&V);
libmesh_assert (v != NULL);
return Mul_VV (const_cast<QVector*>(&(this->_vec)),
const_cast<QVector*>(&(v->_vec)));
}
Definition at line 314 of file numeric_vector.h.
{ return (*this)(i); }
Implements NumericVector< T >.
Definition at line 645 of file laspack_vector.h.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
return 0;
}
Reimplemented in PetscVector< T >.
Definition at line 714 of file numeric_vector.h.
{
const unsigned int num = index.size();
values.resize(num);
for(unsigned int i=0; i<num; i++)
{
values[i] = (*this)(index[i]);
}
}
Definition at line 45 of file reference_counter.C.
References ReferenceCounter::_counts, and Quality::name().
Referenced by ReferenceCounter::print_info().
{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
std::ostringstream out;
out << '
<< ' ----------------------------------------------------------------------------
<< '| Reference count information |
<< ' ---------------------------------------------------------------------------- ;
for (Counts::iterator it = _counts.begin();
it != _counts.end(); ++it)
{
const std::string name(it->first);
const unsigned int creations = it->second.first;
const unsigned int destructions = it->second.second;
out << '| ' << name << ' reference count information:
<< '| Creations: ' << creations << '
<< '| Destructions: ' << destructions << ';
}
out << ' ---------------------------------------------------------------------------- ;
return out.str();
#else
return '';
#endif
}
Definition at line 149 of file reference_counter.h.
References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.
Referenced by ReferenceCountedObject< Value >::ReferenceCountedObject().
{
Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
std::pair<unsigned int, unsigned int>& p = _counts[name];
p.first++;
}
Definition at line 167 of file reference_counter.h.
References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.
Referenced by ReferenceCountedObject< Value >::~ReferenceCountedObject().
{
Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
std::pair<unsigned int, unsigned int>& p = _counts[name];
p.second++;
}
Implements NumericVector< T >.
Definition at line 563 of file laspack_vector.h.
References libMesh::init(), NumericVector< T >::local_size(), NumericVector< T >::size(), and NumericVector< T >::type().
{
this->init(other.size(),other.local_size(),fast,other.type());
}
On fast==false, the vector is filled by zeros.
Implements NumericVector< T >.
Definition at line 502 of file laspack_vector.h.
References libMesh::libMeshPrivateData::_is_initialized, LaspackLinearSolver< T >::clear(), libMesh::initialized(), libMeshEnums::SERIAL, and libMesh::zero.
{
// Laspack vectors only for serial cases,
// but can provide a 'parallel' vector on one processor.
libmesh_assert (n == n_local);
this->_type = SERIAL;
// Clear initialized vectors
if (this->initialized())
this->clear();
// create a sequential vector
static int cnt = 0;
char foo[80];
std::sprintf(foo, 'Vec-%d', cnt++);
V_Constr(&_vec, const_cast<char*>(foo), n, Normal, _LPTrue);
this->_is_initialized = true;
// Optionally zero out all components
if (fast == false)
this->zero ();
return;
}
Implements NumericVector< T >.
Definition at line 538 of file laspack_vector.h.
References libMesh::init().
{
this->init(n,n,fast,type);
}
Implements NumericVector< T >.
Definition at line 548 of file laspack_vector.h.
References libMesh::init().
{
libmesh_assert(ghost.empty());
this->init(n,n_local,fast,type);
}
Definition at line 109 of file numeric_vector.h.
Referenced by ImplicitSystem::assemble(), ExplicitSystem::assemble_qoi(), ExplicitSystem::assemble_qoi_derivative(), NumericVector< T >::compare(), PetscVector< T >::create_subvector(), and PetscVector< T >::init().
{ return _is_initialized; }
Implements NumericVector< T >.
Definition at line 205 of file laspack_vector.C.
References DenseVector< T >::size().
{
libmesh_assert (V.size() == dof_indices.size());
for (unsigned int i=0; i<V.size(); i++)
this->set (dof_indices[i], V(i));
}
Implements NumericVector< T >.
Definition at line 217 of file laspack_vector.C.
References DenseVectorBase< T >::size().
{
libmesh_assert (V.size() == dof_indices.size());
for (unsigned int i=0; i<V.size(); i++)
this->set (dof_indices[i], V(i));
}
Implements NumericVector< T >.
Definition at line 180 of file laspack_vector.C.
{
libmesh_assert (!v.empty());
libmesh_assert (v.size() == dof_indices.size());
for (unsigned int i=0; i<v.size(); i++)
this->set (dof_indices[i], v[i]);
}
Implements NumericVector< T >.
Definition at line 193 of file laspack_vector.C.
References NumericVector< T >::size().
{
libmesh_assert (V.size() == dof_indices.size());
for (unsigned int i=0; i<V.size(); i++)
this->set (dof_indices[i], V(i));
}
Implements NumericVector< T >.
Definition at line 53 of file laspack_vector.C.
References libMesh::closed().
{
libmesh_assert (this->closed());
return static_cast<Real>(l1Norm_V(const_cast<QVector*>(&_vec)));
}
Implements NumericVector< T >.
Definition at line 63 of file laspack_vector.C.
References libMesh::closed().
{
libmesh_assert (this->closed());
return static_cast<Real>(l2Norm_V(const_cast<QVector*>(&_vec)));
}
Implements NumericVector< T >.
Definition at line 656 of file laspack_vector.h.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
return this->size();
}
Implements NumericVector< T >.
Definition at line 73 of file laspack_vector.C.
References libMesh::closed().
{
libmesh_assert (this->closed());
return static_cast<Real>(MaxNorm_V(const_cast<QVector*>(&_vec)));
}
Implements NumericVector< T >.
Definition at line 634 of file laspack_vector.h.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
return this->size();
}
Implements NumericVector< T >.
Definition at line 349 of file laspack_vector.C.
{
// Make sure the NumericVector passed in is really a LaspackVector
LaspackVector<T>* v_local =
libmesh_cast_ptr<LaspackVector<T>*>(&v_local_in);
libmesh_assert (v_local != NULL);
*v_local = *this;
}
Implements NumericVector< T >.
Definition at line 392 of file laspack_vector.C.
{
v_local.resize(this->size());
for (unsigned int i=0; i<v_local.size(); i++)
v_local[i] = (*this)(i);
}
Implements NumericVector< T >.
Definition at line 363 of file laspack_vector.C.
References LaspackVector< T >::size().
{
// Make sure the NumericVector passed in is really a LaspackVector
LaspackVector<T>* v_local =
libmesh_cast_ptr<LaspackVector<T>*>(&v_local_in);
libmesh_assert (v_local != NULL);
libmesh_assert (send_list.size() <= v_local->size());
*v_local = *this;
}
Implements NumericVector< T >.
Definition at line 379 of file laspack_vector.C.
{
libmesh_assert (first_local_idx == 0);
libmesh_assert (last_local_idx+1 == this->size());
libmesh_assert (send_list.size() <= this->size());
}
Implements NumericVector< T >.
Definition at line 404 of file laspack_vector.C.
{
libmesh_assert (pid == 0);
this->localize (v_local);
}
Implements NumericVector< T >.
Definition at line 424 of file laspack_vector.C.
References libMesh::initialized(), libmesh_real(), and std::max().
{
libmesh_assert (this->initialized());
if (!this->size())
return -std::numeric_limits<Real>::max();
Real max = libmesh_real((*this)(0));
const unsigned int n = this->size();
for (unsigned int i=1; i<n; i++)
max = std::max (max, libmesh_real((*this)(i)));
return max;
}
Implements NumericVector< T >.
Definition at line 443 of file laspack_vector.C.
References libMesh::initialized(), libmesh_real(), std::max(), and std::min().
{
libmesh_assert (this->initialized());
if (!this->size())
return std::numeric_limits<Real>::max();
Real min = libmesh_real((*this)(0));
const unsigned int n = this->size();
for (unsigned int i=1; i<n; i++)
min = std::min (min, libmesh_real((*this)(i)));
return min;
}
Definition at line 76 of file reference_counter.h.
References ReferenceCounter::_n_objects.
Referenced by System::read_serialized_blocked_dof_objects(), and System::write_serialized_blocked_dof_objects().
{ return _n_objects; }
Implements NumericVector< T >.
Definition at line 691 of file laspack_vector.h.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
libmesh_assert ( ((i >= this->first_local_index()) &&
(i < this->last_local_index())) );
return static_cast<T>(V_GetCmp(const_cast<QVector*>(&_vec), i+1));
}
Definition at line 340 of file numeric_vector.h.
{ this->scale(a); return *this; }
Implements NumericVector< T >.
Definition at line 83 of file laspack_vector.C.
References libMesh::closed().
{
libmesh_assert (this->closed());
this->add(1., v);
return *this;
}
Implements NumericVector< T >.
Definition at line 96 of file laspack_vector.C.
References libMesh::closed().
{
libmesh_assert (this->closed());
this->add(-1., v);
return *this;
}
Definition at line 346 of file numeric_vector.h.
{ this->scale(1./a); return *this; }
Definition at line 312 of file laspack_vector.C.
References NumericVector< T >::_is_closed, LaspackVector< T >::_vec, libMesh::initialized(), and LaspackVector< T >::size().
{
libmesh_assert (this->initialized());
libmesh_assert (this->size() == v.size());
this->_is_closed = v._is_closed;
if (v.size() != 0)
Asgn_VV (const_cast<QVector*>(&_vec),
const_cast<QVector*>(&v._vec)
);
return *this;
}
Implements NumericVector< T >.
Definition at line 295 of file laspack_vector.C.
{
// Make sure the NumericVector passed in is really a LaspackVector
const LaspackVector<T>* v =
libmesh_cast_ptr<const LaspackVector<T>*>(&v_in);
libmesh_assert (v != NULL);
*this = *v;
return *this;
}
Case 1: The vector is the same size of The global vector. Only add the local components.
Implements NumericVector< T >.
Definition at line 331 of file laspack_vector.C.
{
if (this->size() == v.size())
for (unsigned int i=0; i<v.size(); i++)
this->set (i, v[i]);
else
libmesh_error();
return *this;
}
Implements NumericVector< T >.
Definition at line 282 of file laspack_vector.C.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
V_SetAllCmp (&_vec, s);
return *this;
}
Implements NumericVector< T >.
Definition at line 415 of file laspack_vector.C.
{
libmesh_not_implemented();
}
Definition at line 749 of file numeric_vector.h.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
os << 'Size global = ' << this->size()
<< ' local = ' << this->local_size() << std::endl;
os << '# Value' << std::endl;
for (unsigned int i=this->first_local_index(); i<this->last_local_index(); i++)
os << i << ' ' << (*this)(i) << std::endl;
}
Definition at line 731 of file numeric_vector.h.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
os << 'Size global = ' << this->size()
<< ' local = ' << this->local_size() << std::endl;
// std::complex<>::operator<<() is defined, but use this form
os << '# Real part Imaginary part' << std::endl;
for (unsigned int i=this->first_local_index(); i<this->last_local_index(); i++)
os << i << ' '
<< (*this)(i).real() << ' '
<< (*this)(i).imag() << std::endl;
}
Definition at line 764 of file numeric_vector.h.
References libMesh::initialized(), and libMesh::processor_id().
{
libmesh_assert (this->initialized());
std::vector<Complex> v(this->size());
this->localize(v);
// Right now we only want one copy of the output
if (libMesh::processor_id())
return;
os << 'Size global = ' << this->size() << std::endl;
os << '# Real part Imaginary part' << std::endl;
for (unsigned int i=0; i!=v.size(); i++)
os << i << ' '
<< v[i].real() << ' '
<< v[i].imag() << std::endl;
}
Definition at line 786 of file numeric_vector.h.
References libMesh::initialized(), and libMesh::processor_id().
{
libmesh_assert (this->initialized());
std::vector<T> v(this->size());
this->localize(v);
// Right now we only want one copy of the output
if (libMesh::processor_id())
return;
os << 'Size global = ' << this->size() << std::endl;
os << '# Value' << std::endl;
for (unsigned int i=0; i!=v.size(); i++)
os << i << ' ' << v[i] << std::endl;
}
Definition at line 83 of file reference_counter.C.
References ReferenceCounter::get_info().
{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
std::cout << ReferenceCounter::get_info();
#endif
}
Reimplemented in PetscVector< T >, and EpetraVector< T >.
Definition at line 549 of file numeric_vector.h.
{
std::cerr << 'ERROR: Not Implemented in base class yet!' << std::endl;
std::cerr << 'ERROR writing MATLAB file ' << name << std::endl;
libmesh_error();
}
Implements NumericVector< T >.
Definition at line 247 of file laspack_vector.C.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
Mul_SV (factor, &_vec);
}
Implements NumericVector< T >.
Definition at line 667 of file laspack_vector.h.
References libMesh::initialized().
{
libmesh_assert (this->initialized());
libmesh_assert (i < this->size());
V_SetCmp (&_vec, i+1, value);
}
Implements NumericVector< T >.
Definition at line 623 of file laspack_vector.h.
References libMesh::initialized().
Referenced by LaspackVector< T >::add(), LaspackVector< T >::localize(), and LaspackVector< T >::operator=().
{
libmesh_assert (this->initialized());
return static_cast<unsigned int>(V_GetDim(const_cast<QVector*>(&_vec)));
}
Note that the indices must necessary live on this processor.
Definition at line 193 of file numeric_vector.C.
Referenced by System::discrete_var_norm().
{
NumericVector<T> & v = *this;
std::set<unsigned int>::iterator it = indices.begin();
const std::set<unsigned int>::iterator it_end = indices.end();
Real norm = 0;
for(; it!=it_end; ++it)
norm += std::abs(v(*it));
Parallel::sum(norm);
return norm;
}
Note that the indices must necessary live on this processor.
Definition at line 211 of file numeric_vector.C.
References libmesh_norm().
Referenced by System::discrete_var_norm().
{
NumericVector<T> & v = *this;
std::set<unsigned int>::iterator it = indices.begin();
const std::set<unsigned int>::iterator it_end = indices.end();
Real norm = 0;
for(; it!=it_end; ++it)
norm += libmesh_norm(v(*it));
Parallel::sum(norm);
return std::sqrt(norm);
}
Note that the indices must necessary live on this processor.
Definition at line 229 of file numeric_vector.C.
References std::max().
Referenced by System::discrete_var_norm().
{
NumericVector<T> & v = *this;
std::set<unsigned int>::iterator it = indices.begin();
const std::set<unsigned int>::iterator it_end = indices.end();
Real norm = 0;
for(; it!=it_end; ++it)
{
Real value = std::abs(v(*it));
if(value > norm)
norm = value;
}
Parallel::max(norm);
return norm;
}
Implements NumericVector< T >.
Definition at line 36 of file laspack_vector.C.
References libMesh::closed().
{
libmesh_assert (this->closed());
T _sum = 0;
const unsigned int n = this->size();
for (unsigned int i=0; i!=n; ++i)
_sum += (*this)(i);
return _sum;
}
Reimplemented from NumericVector< T >.
Definition at line 705 of file laspack_vector.h.
References LaspackVector< T >::_vec.
{
LaspackVector<T>& v = libmesh_cast_ref<LaspackVector<T>&>(other);
// This is all grossly dependent on Laspack version...
std::swap(_vec.Name, v._vec.Name);
std::swap(_vec.Dim, v._vec.Dim);
std::swap(_vec.Instance, v._vec.Instance);
std::swap(_vec.LockLevel, v._vec.LockLevel);
std::swap(_vec.Multipl, v._vec.Multipl);
std::swap(_vec.OwnData, v._vec.OwnData);
// This should still be O(1), since _vec.Cmp is just a pointer to
// data on the heap
std::swap(_vec.Cmp, v._vec.Cmp);
}
Definition at line 119 of file numeric_vector.h.
{ return _type; }
Definition at line 114 of file numeric_vector.h.
Referenced by DistributedVector< T >::DistributedVector(), DofMap::enforce_constraints_exactly(), EpetraVector< T >::EpetraVector(), EpetraVector< T >::init(), LaspackVector< T >::init(), DistributedVector< T >::init(), PetscVector< T >::localize(), PetscVector< T >::PetscVector(), System::project_vector(), and System::read_serialized_vector().
{ return _type; }
Implements NumericVector< T >.
Definition at line 597 of file laspack_vector.h.
References libMesh::initialized().
Referenced by LaspackLinearSolver< T >::solve().
{
libmesh_assert (this->initialized());
V_SetAllCmp (&_vec, 0.);
}
Definition at line 442 of file laspack_vector.h.
Definition at line 537 of file numeric_vector.h.
{
v.print_global(os);
return os;
}
Definition at line 110 of file reference_counter.h.
Referenced by ReferenceCounter::get_info(), ReferenceCounter::increment_constructor_count(), and ReferenceCounter::increment_destructor_count().
Definition at line 582 of file numeric_vector.h.
Referenced by NumericVector< Number >::closed(), PetscVector< T >::init(), DistributedVector< T >::localize(), LaspackVector< T >::operator=(), DistributedVector< T >::operator=(), PetscVector< T >::PetscVector(), and NumericVector< T >::swap().
Definition at line 588 of file numeric_vector.h.
Referenced by PetscVector< T >::create_subvector(), EpetraVector< T >::EpetraVector(), PetscVector< T >::init(), NumericVector< Number >::initialized(), DistributedVector< T >::localize(), DistributedVector< T >::operator=(), PetscVector< T >::PetscVector(), and NumericVector< T >::swap().
Definition at line 123 of file reference_counter.h.
Definition at line 118 of file reference_counter.h.
Referenced by ReferenceCounter::n_objects(), ReferenceCounter::ReferenceCounter(), and ReferenceCounter::~ReferenceCounter().
Definition at line 593 of file numeric_vector.h.
Referenced by DistributedVector< T >::DistributedVector(), EpetraVector< T >::EpetraVector(), PetscVector< T >::init(), PetscVector< T >::operator=(), PetscVector< T >::PetscVector(), NumericVector< T >::swap(), and NumericVector< Number >::type().
Definition at line 437 of file laspack_vector.h.
Referenced by LaspackVector< T >::add_vector(), LaspackVector< T >::dot(), LaspackVector< T >::operator=(), and LaspackVector< T >::swap().
Generated automatically by Doxygen for libMesh from the source code.