ripley/src/domainhelpers.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2017 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014 by Centre for Geoscience Computing (GeoComp)
*
*****************************************************************************/
#ifndef _RIPLEY_DOMAINHELPERS_H_
#define _RIPLEY_DOMAINHELPERS_H_
#include <ripley/Ripley.h>
#include <escript/Data.h>
namespace ripley {
typedef std::map<std::string, escript::Data> DataMap;
inline const escript::Data unpackData(const std::string target,
const DataMap& mapping)
{
DataMap::const_iterator i = mapping.find(target);
return (i == mapping.end() ? escript::Data() : i->second);
}
inline bool isNotEmpty(const std::string target, const DataMap& mapping)
{
DataMap::const_iterator i = mapping.find(target);
return i != mapping.end() && !i->second.isEmpty();
}
inline void doublyLink(std::vector<ripley::IndexVector>& va,
std::vector<ripley::IndexVector>& vb, int a, int b)
{
va[a].push_back(b);
vb[b].push_back(a);
}
void factorise(std::vector<int>& factors, int product);
#ifdef ESYS_HAVE_BOOST_IO
std::vector<char> unzip(const std::vector<char>& compressed);
#endif // ESYS_HAVE_BOOST_IO
} // namespace ripley
#endif // _RIPLEY_DOMAINHELPERS_H_
ripley::unpackData
const escript::Data unpackData(const std::string target, const DataMap &mapping)
Definition: ripley/src/domainhelpers.h:28
ripley::DataMap
std::map< std::string, escript::Data > DataMap
Definition: ripley/src/domainhelpers.h:24
ripley::factorise
void factorise(std::vector< int > &factors, int product)
Definition: ripley/src/domainhelpers.cpp:28
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:63
ripley::isNotEmpty
bool isNotEmpty(const std::string target, const DataMap &mapping)
Definition: ripley/src/domainhelpers.h:39
ripley
Definition: ripley/src/AbstractAssembler.h:25
ripley::doublyLink
void doublyLink(std::vector< ripley::IndexVector > &va, std::vector< ripley::IndexVector > &vb, int a, int b)
Definition: ripley/src/domainhelpers.h:49