Skip to content
Snippets Groups Projects
Commit 45cfcf28 authored by Elias Pipping's avatar Elias Pipping
Browse files

[Cleanup] Kill duneoctave

parent e496871a
No related branches found
No related tags found
No related merge requests found
#ifndef DUNE_TECTONIC_OCTAVE_DUNEOCTAVE_HH
#define DUNE_TECTONIC_OCTAVE_DUNEOCTAVE_HH
#include <cassert>
#include <octave/oct.h>
#include "../ellipticenergy.hh"
namespace Dune {
template <int dimension>
void octaveToDune(Array<double> const &from,
typename Dune::EllipticEnergy<dimension>::SmallVector &to) {
assert(from.length() == dimension);
for (size_t i = 0; i < dimension; ++i)
to[i] = from(i);
}
template <int dimension>
void octaveToDune(Matrix const &from,
typename Dune::EllipticEnergy<dimension>::SmallMatrix &to) {
dim_vector dims = from.dims();
assert(dims.length() == 2);
assert(dims(0) == 2);
assert(dims(1) == 2);
for (size_t i = 0; i < dimension; ++i)
for (size_t j = 0; j < dimension; ++j)
to[i][j] = from(i, j);
}
template <int dimension>
void duneToOctave(
typename Dune::EllipticEnergy<dimension>::SmallVector const &from,
Array<double> &to) {
assert(to.length() == dimension);
for (size_t i = 0; i < dimension; ++i)
to(i) = from[i];
}
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment