16 template<
typename MatrixType>
31 static std::pair<std::vector<int>, std::vector<int>>
99 std::vector<Eigen::SparseMatrix<double>> systems;
101 std::vector<Eigen::VectorXd> vectors;
103 vectors.emplace_back(Eigen::VectorXd::Zero(
size));
115 std::vector<std::vector<std::list<Eigen::Triplet<double> > > >
triplets(
nb_threads, std::vector<std::list<Eigen::Triplet<double> > >(
size_systems.size()));
116 std::vector<std::vector<Eigen::VectorXd>>
vecs(
nb_threads, vectors);
161 static inline std::pair<Eigen::SparseMatrix<double>, Eigen::VectorXd>
169 std::function<
void(
size_t start,
size_t end, std::vector<std::list<Eigen::Triplet<double>>> *
triplets, std::vector<Eigen::VectorXd> *
vecs)>
173 return std::make_pair(systems[0], vectors[0]);
178 static inline std::tuple<Eigen::SparseMatrix<double>, Eigen::VectorXd, Eigen::SparseMatrix<double>, Eigen::VectorXd>
188 std::function<
void(
size_t start,
size_t end, std::vector<std::list<Eigen::Triplet<double>>> *
triplets, std::vector<Eigen::VectorXd> *
vecs)>
192 return std::make_tuple(systems[0], vectors[0], systems[1], vectors[1]);
@ Matrix
Definition basis.hpp:67
static void parallel_for(unsigned nb_elements, std::function< void(size_t start, size_t end)> functor, bool use_threads=true)
Generic function to execute threaded processes.
Definition parallel_for.hpp:58
static SystemVectors< Eigen::SparseMatrix< double > > parallel_assembly_system(size_t nb_elements, std::vector< std::pair< size_t, size_t > > size_systems, std::vector< size_t > size_vectors, std::function< void(size_t start, size_t end, std::vector< std::list< Eigen::Triplet< double > > > *triplets, std::vector< Eigen::VectorXd > *vecs)> batch_local_assembly, bool use_threads=true)
Function to assemble global matrices from a procedure that compute local triplets.
Definition parallel_for.hpp:90
SystemVectors(std::vector< MatrixType > sys, std::vector< Eigen::VectorXd > vec)
Constructor.
Definition parallel_for.hpp:20
std::vector< Eigen::VectorXd > vectors
Definition parallel_for.hpp:27
std::vector< MatrixType > systems
Definition parallel_for.hpp:26
static std::pair< std::vector< int >, std::vector< int > > distributeLoad(size_t nb_elements, unsigned nb_threads)
Function to distribute elements (considered as jobs) over threads. It returns a pair of vectors indic...
Definition parallel_for.hpp:32
bool use_threads
Definition HHO_DiffAdvecReac.hpp:47
Definition ddr-magnetostatics.hpp:41
Struct to store the systems and vector.
Definition parallel_for.hpp:18