diff --git a/dune/grid/io/file/vtk/function.hh b/dune/grid/io/file/vtk/function.hh index 13263f991981e62f03ee922f8dc85cfaa8936661..a86909930d7e99cf47c6bf5ce148d9cccb44108f 100644 --- a/dune/grid/io/file/vtk/function.hh +++ b/dune/grid/io/file/vtk/function.hh @@ -246,7 +246,7 @@ namespace Dune // (Ab)use the MultiLinearGeometry class to do multi-linear interpolation between scalars const MultiLinearGeometry<ctype,dim,1> interpolation(e.type(), cornerValues); - return interpolation.global(xi); + return interpolation.global(xi)[0]; } //! get name diff --git a/dune/grid/onedgrid/onedgrid.cc b/dune/grid/onedgrid/onedgrid.cc index 18c511254c9782caad0f7cf3003c8fdf196be4f0..2ee9d7731b04403284032d41e4100682cf1e9876 100644 --- a/dune/grid/onedgrid/onedgrid.cc +++ b/dune/grid/onedgrid/onedgrid.cc @@ -71,7 +71,7 @@ Dune::OneDGrid::OneDGrid(const std::vector<ctype>& coords) // Init vertex set for (size_t i=0; i<coords.size(); i++) { - OneDEntityImp<0> newVertex(0, coords[i], getNextFreeId()); + OneDEntityImp<0> newVertex(0, FieldVector<ctype,1>(coords[i]), getNextFreeId()); vertices(0).push_back(newVertex); } @@ -84,7 +84,7 @@ Dune::OneDGrid::OneDGrid(const std::vector<ctype>& coords) it = it->succ_; newElement.vertex_[1] = it; - if (newElement.vertex_[0]->pos_ >= newElement.vertex_[1]->pos_) + if (newElement.vertex_[0]->pos_[0] >= newElement.vertex_[1]->pos_[0]) DUNE_THROW(GridError, "The coordinates have to be in ascending order!"); elements(0).push_back(newElement); @@ -318,7 +318,7 @@ bool Dune::OneDGrid::adapt() // Create new center vertex // ////////////////////////////////// - ctype p = 0.5*(eIt->vertex_[0]->pos_[0] + eIt->vertex_[1]->pos_[0]); + FieldVector<ctype,1> p(0.5*(eIt->vertex_[0]->pos_[0] + eIt->vertex_[1]->pos_[0])); OneDEntityImp<0> centerVertex(i+1, p, getNextFreeId()); diff --git a/dune/grid/onedgrid/onedgridfactory.cc b/dune/grid/onedgrid/onedgridfactory.cc index 384b6f83137c69998b40aeda39d3960ad4ae99a6..4532e290fe48fb92cd670ecf792f94132d6a56d9 100644 --- a/dune/grid/onedgrid/onedgridfactory.cc +++ b/dune/grid/onedgrid/onedgridfactory.cc @@ -39,7 +39,7 @@ GridFactory<Dune::OneDGrid>:: void GridFactory<Dune::OneDGrid>:: insertVertex(const Dune::FieldVector<GridFactory<OneDGrid >::ctype,1>& pos) { - vertexPositions_.insert(std::make_pair(pos, vertexIndex_++)); + vertexPositions_.insert(std::make_pair(pos[0], vertexIndex_++)); } void GridFactory<Dune::OneDGrid>:: @@ -115,7 +115,7 @@ createGrid() grid_->entityImps_.resize(1); for (const auto& vtx : vertexPositions_) { - OneDEntityImp<0> newVertex(0, vtx.first, grid_->getNextFreeId()); + OneDEntityImp<0> newVertex(0, FieldVector<ctype,1>(vtx.first), grid_->getNextFreeId()); newVertex.leafIndex_ = vtx.second; newVertex.levelIndex_ = vtx.second; @@ -133,7 +133,7 @@ createGrid() DUNE_THROW(GridError, "You cannot provide more than two boundary segments to a OneDGrid (it must be connected)."); if (boundarySegments_.size() > 1 - && vertexPositionsByIndex_[boundarySegments_[0]] > vertexPositions_.begin()->first[0]) + && vertexPositionsByIndex_[boundarySegments_[0]] > vertexPositions_.begin()->first) grid_->reversedBoundarySegmentNumbering_ = true; // /////////////////////////////////////////////////////////////////// diff --git a/dune/grid/onedgrid/onedgridfactory.hh b/dune/grid/onedgrid/onedgridfactory.hh index 79dbebb23c95ab6f18779119354edc168ec572e1..0a95f44221655d79a53f789d24d4925d908ca8bc 100644 --- a/dune/grid/onedgrid/onedgridfactory.hh +++ b/dune/grid/onedgrid/onedgridfactory.hh @@ -110,7 +110,7 @@ namespace Dune { std::vector<std::array<unsigned int, 2> > elements_; /** \brief Buffer the vertices until createGrid() is called */ - std::map<FieldVector<ctype,1>, unsigned int > vertexPositions_; + std::map<ctype, unsigned int > vertexPositions_; /** \brief Counter that creates the vertex indices */ unsigned int vertexIndex_; diff --git a/dune/grid/onedgrid/onedgridintersections.hh b/dune/grid/onedgrid/onedgridintersections.hh index 933e23a5680d90f644ff2e2455e64583da31bc79..db1e8ebc5081f9d43b9bd32b77076e068d3fb0f2 100644 --- a/dune/grid/onedgrid/onedgridintersections.hh +++ b/dune/grid/onedgrid/onedgridintersections.hh @@ -158,14 +158,14 @@ namespace Dune { //! where iteration started. LocalGeometry geometryInInside () const { - return LocalGeometry( LocalGeometryImpl( (indexInInside() == 0) ? 0 : 1 ) ); + return LocalGeometry( LocalGeometryImpl( typename LocalGeometry::GlobalCoordinate(indexInInside() == 0 ? 0 : 1) ) ); } //! intersection of codimension 1 of this neighbor with element where iteration started. //! Here returned element is in LOCAL coordinates of neighbor LocalGeometry geometryInOutside () const { - return LocalGeometry( LocalGeometryImpl( (indexInInside() == 0) ? 1 : 0 ) ); + return LocalGeometry( LocalGeometryImpl( typename LocalGeometry::GlobalCoordinate(indexInInside() == 0 ? 1 : 0) ) ); } //! intersection of codimension 1 of this neighbor with element where iteration started. @@ -416,14 +416,14 @@ namespace Dune { //! where iteration started. LocalGeometry geometryInInside () const { - return LocalGeometry( LocalGeometryImpl( (indexInInside() == 0) ? 0 : 1 ) ); + return LocalGeometry( LocalGeometryImpl( typename LocalGeometry::GlobalCoordinate(indexInInside() == 0 ? 0 : 1) ) ); } //! intersection of codimension 1 of this neighbor with element where iteration started. //! Here returned element is in LOCAL coordinates of neighbor LocalGeometry geometryInOutside () const { - return LocalGeometry( LocalGeometryImpl( (indexInInside() == 0) ? 1 : 0 ) ); + return LocalGeometry( LocalGeometryImpl( typename LocalGeometry::GlobalCoordinate(indexInInside() == 0 ? 1 : 0) ) ); } //! intersection of codimension 1 of this neighbor with element where iteration started. diff --git a/dune/grid/test/test-oned.cc b/dune/grid/test/test-oned.cc index 4ac2ef9a3bd48ef87bd00ad2d654b7455424c20b..73ad3fdeb6349d6e1c4439daabbc873791820edd 100644 --- a/dune/grid/test/test-oned.cc +++ b/dune/grid/test/test-oned.cc @@ -20,7 +20,7 @@ std::unique_ptr<OneDGrid> testFactory() GridFactory<OneDGrid> factory; // Insert vertices - std::vector<FieldVector<double,1> > vertexPositions = {0.6, 1.0, 0.2, 0.0, 0.4, 0.3, 0.7}; + std::vector<FieldVector<double,1> > vertexPositions = {{0.6}, {1.0}, {0.2}, {0.0}, {0.4}, {0.3}, {0.7}}; for (auto&& pos : vertexPositions) factory.insertVertex(pos); diff --git a/dune/grid/test/test-parallel-ug.cc b/dune/grid/test/test-parallel-ug.cc index eb5c5af80d8e4a41d4086cde81eacf45c6166e59..76bbc353157e74f0761f6854cb2ece1342b5bcb0 100644 --- a/dune/grid/test/test-parallel-ug.cc +++ b/dune/grid/test/test-parallel-ug.cc @@ -31,7 +31,7 @@ class DataExchange public: //! export type of data for message buffer typedef double DataType; - typedef std::vector<Dune::FieldVector<double,1> > UserDataType; + typedef std::vector<double> UserDataType; //! constructor DataExchange(const MapperT &mapper, @@ -78,7 +78,7 @@ public: DataType x = mapper_.index(e); gatherCounter_[mapper_.index(e)]++; - userDataSend_[mapper_.index(e)][0] = x; + userDataSend_[mapper_.index(e)] = x; dverb << "Process " << Dune::MPIHelper::getCommunication().rank()+1 << " sends for entity " @@ -100,7 +100,7 @@ public: DataType x; buff.read(x); - userDataReceive_[mapper_.index(e)][0] = x; + userDataReceive_[mapper_.index(e)] = x; scatterCounter_[mapper_.index(e)]++; dverb << "Process " << Dune::MPIHelper::getCommunication().rank()+1 @@ -240,7 +240,7 @@ void testCommunication(const GridView &gridView, MapperType mapper(gridView, mcmgLayout); // create the user data arrays - using UserDataType = std::vector<Dune::FieldVector<double, 1> >; + using UserDataType = std::vector<double>; UserDataType userDataSend(mapper.size(), 0.0); UserDataType userDataReceive(mapper.size(), 0.0);