Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
DBUtils Namespace Reference

Functions

template<class T >
void Output1DArray (const Array< OneD, const T > &in, const int start=0, const int stop=StopDefault)
template<class T >
void Output1DArray (const Array< OneD, const T > &in, std::string outfile, const int start=0, const int stop=StopDefault)
template<class T >
void Output1DArray (const Array< OneD, const T > &in, ofstream &ofile, const int start=0, const int stop=StopDefault)
template<class T >
void Output1DArray (const NekVector< T > &in, ofstream &ofile, const int start=0, const int stop=StopDefault)
template<class T >
void NormGlobalVector (const int n, Array< OneD, const T > &in, std::ostream &out, MultiRegions::AssemblyMapCGSharedPtr &map)

Variables

const int StopDefault = -99

Function Documentation

template<class T >
void DBUtils::NormGlobalVector ( const int  n,
Array< OneD, const T > &  in,
std::ostream &  out,
MultiRegions::AssemblyMapCGSharedPtr map 
)

Definition at line 159 of file DBUtils.hpp.

References Vmath::Dot2(), and Nektar::LibUtilities::ReduceSum.

{
Array<OneD, NekDouble> vExchange(1);
Array<OneD, int> m_map = map->GetGlobalToUniversalMapUnique();
vExchange[0] = Vmath::Dot2(n, in, in, m_map);
map->GetComm()->AllReduce(vExchange, Nektar::LibUtilities::ReduceSum);
out << "Norm: " << vExchange[0] << endl;
}
template<class T >
void DBUtils::Output1DArray ( const Array< OneD, const T > &  in,
const int  start = 0,
const int  stop = StopDefault 
)

Definition at line 48 of file DBUtils.hpp.

References ASSERTL1, and StopDefault.

{
int i;
ASSERTL1(start < in.num_elements(), "Start value is outside array range ");
if(stop == StopDefault)
{
for(i = start; i < in.num_elements(); ++i)
{
cout << in[i] << endl;
}
}
else
{
ASSERTL1(stop <= in.num_elements(), "Stop value is outside array range ");
for(i = start; i < stop; ++i)
{
cout << in[i] << endl;
}
}
}
template<class T >
void DBUtils::Output1DArray ( const Array< OneD, const T > &  in,
std::string  outfile,
const int  start = 0,
const int  stop = StopDefault 
)

Definition at line 74 of file DBUtils.hpp.

References ASSERTL1, and StopDefault.

{
int i;
ASSERTL1(start < in.num_elements(), "Start value is outside array range ");
ofstream ofile(outfile.c_str());
if(stop == StopDefault)
{
for(i = start; i < in.num_elements(); ++i)
{
ofile << in[i] << endl;
}
}
else
{
ASSERTL1(stop <= in.num_elements(), "Stop value is outside array range ");
for(i = start; i < stop; ++i)
{
ofile << in[i] << endl;
}
}
}
template<class T >
void DBUtils::Output1DArray ( const Array< OneD, const T > &  in,
ofstream &  ofile,
const int  start = 0,
const int  stop = StopDefault 
)

Definition at line 104 of file DBUtils.hpp.

References ASSERTL1, and StopDefault.

{
int i;
ASSERTL1(start < in.num_elements(), "Start value is outside array range ");
if(stop == StopDefault)
{
for(i = start; i < in.num_elements(); ++i)
{
ofile << in[i] << endl;
}
}
else
{
ASSERTL1(stop <= in.num_elements(), "Stop value is outside array range ");
for(i = start; i < stop; ++i)
{
ofile << in[i] << endl;
}
}
}
template<class T >
void DBUtils::Output1DArray ( const NekVector< T > &  in,
ofstream &  ofile,
const int  start = 0,
const int  stop = StopDefault 
)

Definition at line 132 of file DBUtils.hpp.

References ASSERTL1, Nektar::NekVector< DataType >::GetDimension(), and StopDefault.

{
int i;
ASSERTL1(start < in.GetDimension(), "Start value is outside array range ");
if(stop == StopDefault)
{
for(i = start; i < in.GetDimension(); ++i)
{
ofile << in[i] << endl;
}
}
else
{
ASSERTL1(stop <= in.GetDimension(), "Stop value is outside array range ");
for(i = start; i < stop; ++i)
{
ofile << in[i] << endl;
}
}
}

Variable Documentation

const int DBUtils::StopDefault = -99

Definition at line 46 of file DBUtils.hpp.

Referenced by Output1DArray().