Commit 75106fc1 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

renamed CGeo namespace to Curved

parent 8b0c4cb8
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
namespace Dune namespace Dune
{ {
namespace CGeo namespace Curved
{ {
// BackupRestoreFacilities // BackupRestoreFacilities
...@@ -44,7 +44,7 @@ namespace Dune ...@@ -44,7 +44,7 @@ namespace Dune
} }
}; };
} // namespace CGeo } // namespace Curved
......
...@@ -30,11 +30,11 @@ namespace Dune ...@@ -30,11 +30,11 @@ namespace Dune
//convertDuneGridToCrvsrfMesh //convertDuneGridToCrvsrfMesh
template<class GridPtr> template<class GridPtr>
CGeo::Mesh *convertDuneGridToCrvsrfMesh(GridPtr &grid){ Curved::Mesh *convertDuneGridToCrvsrfMesh(GridPtr &grid){
auto gridView = grid->leafGridView(); auto gridView = grid->leafGridView();
//determine coordinate-extrema //determine coordinate-extrema
CGeo::Vertex minc(DBL_MAX, DBL_MAX, DBL_MAX), maxc(-DBL_MAX, -DBL_MAX, -DBL_MAX); Curved::Vertex minc(DBL_MAX, DBL_MAX, DBL_MAX), maxc(-DBL_MAX, -DBL_MAX, -DBL_MAX);
for(const auto &vertexEntity : vertices(gridView)){ for(const auto &vertexEntity : vertices(gridView)){
const auto &vertex = vertexEntity.geometry().corner(0); const auto &vertex = vertexEntity.geometry().corner(0);
for(int i = 0; i < grid->dimensionworld; ++i){ for(int i = 0; i < grid->dimensionworld; ++i){
...@@ -43,19 +43,19 @@ namespace Dune ...@@ -43,19 +43,19 @@ namespace Dune
} }
} }
CGeo::Mesh *surface_mesh = new CGeo::Mesh(grid->dimension, grid->dimensionworld); Curved::Mesh *surface_mesh = new Curved::Mesh(grid->dimension, grid->dimensionworld);
CGeo::VertexMap<int> vmap(minc, maxc, grid->dimensionworld); Curved::VertexMap<int> vmap(minc, maxc, grid->dimensionworld);
//build mesh //build mesh
int next_index = 0; int next_index = 0;
for(const auto &element : elements(gridView)){ for(const auto &element : elements(gridView)){
if(element.geometry().corners() != 3){ if(element.geometry().corners() != 3){
CGeo::error("Element is not a triangle in convertDuneGridToCrvsrfMesh."); Curved::error("Element is not a triangle in convertDuneGridToCrvsrfMesh.");
} }
int32_t el[grid->dimension + 1]; int32_t el[grid->dimension + 1];
for(int i = 0; i <= grid->dimension; ++i){ for(int i = 0; i <= grid->dimension; ++i){
auto coords = element.geometry().corner(i); auto coords = element.geometry().corner(i);
CGeo::Vertex v(coords[0], coords[1], coords[2]); Curved::Vertex v(coords[0], coords[1], coords[2]);
if(!vmap.find_3d(v, el[i])){ if(!vmap.find_3d(v, el[i])){
surface_mesh->add_vertex(v); surface_mesh->add_vertex(v);
el[i] = next_index; el[i] = next_index;
...@@ -93,7 +93,7 @@ namespace Dune ...@@ -93,7 +93,7 @@ namespace Dune
input *= radius_ / input.two_norm(); input *= radius_ / input.two_norm();
} }
double run_time = dbl_time() - start_time; double run_time = dbl_time() - start_time;
std::cout << "csphere time: " << CGeo::ft(run_time, 11, 9) std::cout << "csphere time: " << Curved::ft(run_time, 11, 9)
<< ", count: " << inputs.size() << std::endl; << ", count: " << inputs.size() << std::endl;
} }
#endif #endif
...@@ -135,7 +135,7 @@ namespace Dune ...@@ -135,7 +135,7 @@ namespace Dune
for(int i = 0; i < 3; ++i) input[i] = center_[i] + direction[i] * factor; for(int i = 0; i < 3; ++i) input[i] = center_[i] + direction[i] * factor;
} }
double run_time = dbl_time() - start_time; double run_time = dbl_time() - start_time;
std::cout << "sphere time: " << CGeo::ft(run_time, 11, 9) std::cout << "sphere time: " << Curved::ft(run_time, 11, 9)
<< ", count: " << inputs.size() << std::endl; << ", count: " << inputs.size() << std::endl;
} }
#endif #endif
...@@ -162,29 +162,29 @@ namespace Dune ...@@ -162,29 +162,29 @@ namespace Dune
SurfaceDistanceCoordFunction(const GridPtr &gridPtr, SurfaceDistanceCoordFunction(const GridPtr &gridPtr,
double expansion_width=-1.0, bool no_scaling=false) : cache(nullptr){ double expansion_width=-1.0, bool no_scaling=false) : cache(nullptr){
if(gridPtr->dimension != 2 || gridPtr->dimensionworld != 3){ if(gridPtr->dimension != 2 || gridPtr->dimensionworld != 3){
CGeo::error("SurfaceDistanceCoordFunction needs a triangle-surface-mesh!"); Curved::error("SurfaceDistanceCoordFunction needs a triangle-surface-mesh!");
} }
surface_mesh = convertDuneGridToCrvsrfMesh(gridPtr); surface_mesh = convertDuneGridToCrvsrfMesh(gridPtr);
backgrid = new CGeo::BackGrid(*surface_mesh, expansion_width, no_scaling); backgrid = new Curved::BackGrid(*surface_mesh, expansion_width, no_scaling);
if(cached){ if(cached){
CGeo::Vertex c_begin, c_end; Curved::Vertex c_begin, c_end;
surface_mesh->determine_coordinate_extrema(c_begin, c_end); surface_mesh->determine_coordinate_extrema(c_begin, c_end);
CGeo::Vertex c_expansion = (c_end - c_begin) * 0.1; Curved::Vertex c_expansion = (c_end - c_begin) * 0.1;
cache = new CGeo::VertexMap<CGeo::Vertex>(c_begin - c_expansion, c_end + c_expansion, 3); cache = new Curved::VertexMap<Curved::Vertex>(c_begin - c_expansion, c_end + c_expansion, 3);
} }
} }
//constructor using vtu-reader to read "file" //constructor using vtu-reader to read "file"
SurfaceDistanceCoordFunction(const char *file, SurfaceDistanceCoordFunction(const char *file,
double expansion_width=-1.0, bool no_scaling=false) : cache(nullptr){ double expansion_width=-1.0, bool no_scaling=false) : cache(nullptr){
surface_mesh = new CGeo::Mesh(2, 3); surface_mesh = new Curved::Mesh(2, 3);
read_vtu_file(file, *surface_mesh); read_vtu_file(file, *surface_mesh);
backgrid = new CGeo::BackGrid(*surface_mesh, expansion_width, no_scaling); backgrid = new Curved::BackGrid(*surface_mesh, expansion_width, no_scaling);
if(cached){ if(cached){
CGeo::Vertex c_begin, c_end; Curved::Vertex c_begin, c_end;
surface_mesh->determine_coordinate_extrema(c_begin, c_end); surface_mesh->determine_coordinate_extrema(c_begin, c_end);
CGeo::Vertex c_expansion = (c_end - c_begin) * 0.1; Curved::Vertex c_expansion = (c_end - c_begin) * 0.1;
cache = new CGeo::VertexMap<CGeo::Vertex>(c_begin - c_expansion, c_end + c_expansion, 3); cache = new Curved::VertexMap<Curved::Vertex>(c_begin - c_expansion, c_end + c_expansion, 3);
} }
} }
...@@ -202,18 +202,18 @@ namespace Dune ...@@ -202,18 +202,18 @@ namespace Dune
} }
//resetCache //resetCache
void resetCache(CGeo::Vertex begin = CGeo::Vertex(), void resetCache(Curved::Vertex begin = Curved::Vertex(),
CGeo::Vertex end = CGeo::Vertex(), Curved::Vertex end = Curved::Vertex(),
double expansion_factor = 0.1){ double expansion_factor = 0.1){
if(cached){ if(cached){
delete cache; delete cache;
if(begin.is_origin() && end.is_origin()){ if(begin.is_origin() && end.is_origin()){
surface_mesh->determine_coordinate_extrema(begin, end); surface_mesh->determine_coordinate_extrema(begin, end);
} }
CGeo::Vertex c_expansion = (end - begin) * expansion_factor; Curved::Vertex c_expansion = (end - begin) * expansion_factor;
cache = new CGeo::VertexMap<CGeo::Vertex>(begin - c_expansion, end + c_expansion, 3); cache = new Curved::VertexMap<Curved::Vertex>(begin - c_expansion, end + c_expansion, 3);
}else{ }else{
CGeo::error("Cannot reset cache in uncached SurfaceDistanceCoordFunction!"); Curved::error("Cannot reset cache in uncached SurfaceDistanceCoordFunction!");
} }
} }
...@@ -232,8 +232,8 @@ namespace Dune ...@@ -232,8 +232,8 @@ namespace Dune
int uncached_cnt = 0; int uncached_cnt = 0;
double start_time = dbl_time(); double start_time = dbl_time();
for(auto &input : inputs){ for(auto &input : inputs){
CGeo::Vertex hit_vertex; Curved::Vertex hit_vertex;
CGeo::Vertex v(input[0], input[1], input[2]); Curved::Vertex v(input[0], input[1], input[2]);
if(!cache->find_3d(v, hit_vertex)){ if(!cache->find_3d(v, hit_vertex)){
backgrid->distance_to_surface_3d(v, hit_vertex); backgrid->distance_to_surface_3d(v, hit_vertex);
cache->insert(v, hit_vertex); cache->insert(v, hit_vertex);
...@@ -241,17 +241,17 @@ namespace Dune ...@@ -241,17 +241,17 @@ namespace Dune
} }
} }
double run_time = dbl_time() - start_time; double run_time = dbl_time() - start_time;
std::cout << "surfdist time: " << CGeo::ft(run_time, 11, 9) << ", count: "<< inputs.size() std::cout << "surfdist time: " << Curved::ft(run_time, 11, 9) << ", count: "<< inputs.size()
<< ", uncached: " << uncached_cnt << std::endl; << ", uncached: " << uncached_cnt << std::endl;
}else{ //uncached }else{ //uncached
double start_time = dbl_time(); double start_time = dbl_time();
for(auto &input : inputs){ for(auto &input : inputs){
CGeo::Vertex hit_vertex; Curved::Vertex hit_vertex;
CGeo::Vertex v(input[0], input[1], input[2]); Curved::Vertex v(input[0], input[1], input[2]);
backgrid->distance_to_surface_3d(v, hit_vertex); backgrid->distance_to_surface_3d(v, hit_vertex);
} }
double run_time = dbl_time() - start_time; double run_time = dbl_time() - start_time;
std::cout << "surfdist time: " << CGeo::ft(run_time, 11, 9) std::cout << "surfdist time: " << Curved::ft(run_time, 11, 9)
<< ", count: "<< inputs.size() << std::endl; << ", count: "<< inputs.size() << std::endl;
} }
} }
...@@ -262,16 +262,16 @@ namespace Dune ...@@ -262,16 +262,16 @@ namespace Dune
if(cached){ if(cached){
cache->debug_output_statistics(); cache->debug_output_statistics();
}else{ }else{
CGeo::error("Cannot output vertexmap-statistics in " Curved::error("Cannot output vertexmap-statistics in "
"uncached SurfaceDistanceCoordFunction!"); "uncached SurfaceDistanceCoordFunction!");
} }
} }
#endif #endif
private: private:
CGeo::Mesh *surface_mesh; Curved::Mesh *surface_mesh;
CGeo::BackGrid *backgrid; Curved::BackGrid *backgrid;
CGeo::VertexMap<CGeo::Vertex> *cache; Curved::VertexMap<Curved::Vertex> *cache;
#if COLLECTOR_BENCHMARK != 0 #if COLLECTOR_BENCHMARK != 0
mutable std::vector<FieldVector<double, 3> > inputs; mutable std::vector<FieldVector<double, 3> > inputs;
#endif #endif
...@@ -284,8 +284,8 @@ namespace Dune ...@@ -284,8 +284,8 @@ namespace Dune
#if COLLECTOR_BENCHMARK != 0 #if COLLECTOR_BENCHMARK != 0
inputs.push_back(x); inputs.push_back(x);
#endif #endif
CGeo::Vertex hit_vertex; Curved::Vertex hit_vertex;
CGeo::Vertex v(x[0], x[1], x[2]); Curved::Vertex v(x[0], x[1], x[2]);
if(!cache->find_3d(v, hit_vertex)){ if(!cache->find_3d(v, hit_vertex)){
backgrid->distance_to_surface_3d(v, hit_vertex); backgrid->distance_to_surface_3d(v, hit_vertex);
cache->insert(v, hit_vertex); cache->insert(v, hit_vertex);
...@@ -301,8 +301,8 @@ namespace Dune ...@@ -301,8 +301,8 @@ namespace Dune
#if COLLECTOR_BENCHMARK != 0 #if COLLECTOR_BENCHMARK != 0
inputs.push_back(x); inputs.push_back(x);
#endif #endif
CGeo::Vertex hit_vertex; Curved::Vertex hit_vertex;
CGeo::Vertex v(x[0], x[1], x[2]); Curved::Vertex v(x[0], x[1], x[2]);
backgrid->distance_to_surface_3d(v, hit_vertex); backgrid->distance_to_surface_3d(v, hit_vertex);
return {hit_vertex[0], hit_vertex[1], hit_vertex[2]}; return {hit_vertex[0], hit_vertex[1], hit_vertex[2]};
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace Dune namespace Dune
{ {
namespace CGeo namespace Curved
{ {
// CommDataHandle // CommDataHandle
...@@ -81,7 +81,7 @@ namespace Dune ...@@ -81,7 +81,7 @@ namespace Dune
WrappedHandle& wrappedHandle_; WrappedHandle& wrappedHandle_;
}; };
} // namespace CGeo } // namespace Curved
} // namespace Dune } // namespace Dune
#endif // DUNE_CURVED_SURFACE_GRID_DATAHANDLE_HH #endif // DUNE_CURVED_SURFACE_GRID_DATAHANDLE_HH
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace Dune namespace Dune
{ {
namespace CGeo namespace Curved
{ {
// Internal Forward Declarations // Internal Forward Declarations
...@@ -337,7 +337,7 @@ namespace Dune ...@@ -337,7 +337,7 @@ namespace Dune
using LocalGeometry = typename Traits::template Codim<0>::LocalGeometry; using LocalGeometry = typename Traits::template Codim<0>::LocalGeometry;
//! facade type for entities //! facade type for entities
using EntityFacade = Dune::Entity<0, dim, G, Dune::CGeo::Entity>; using EntityFacade = Dune::Entity<0, dim, G, Dune::Curved::Entity>;
//! type of hierarchic iterator //! type of hierarchic iterator
using HierarchicIterator = typename Traits::HierarchicIterator; using HierarchicIterator = typename Traits::HierarchicIterator;
...@@ -362,25 +362,25 @@ namespace Dune ...@@ -362,25 +362,25 @@ namespace Dune
LevelIntersectionIterator ilevelbegin () const LevelIntersectionIterator ilevelbegin () const
{ {
using IteratorImpl = CGeo::IntersectionIterator<Grid, typename HostGrid::LevelIntersectionIterator>; using IteratorImpl = Curved::IntersectionIterator<Grid, typename HostGrid::LevelIntersectionIterator>;
return IteratorImpl(*this, Super::hostEntity().ilevelbegin()); return IteratorImpl(*this, Super::hostEntity().ilevelbegin());
} }
LevelIntersectionIterator ilevelend () const LevelIntersectionIterator ilevelend () const
{ {
using IteratorImpl = CGeo::IntersectionIterator<Grid, typename HostGrid::LevelIntersectionIterator>; using IteratorImpl = Curved::IntersectionIterator<Grid, typename HostGrid::LevelIntersectionIterator>;
return IteratorImpl(*this, Super::hostEntity().ilevelend()); return IteratorImpl(*this, Super::hostEntity().ilevelend());
} }
LeafIntersectionIterator ileafbegin () const LeafIntersectionIterator ileafbegin () const
{ {
using IteratorImpl = CGeo::IntersectionIterator<Grid, typename HostGrid::LeafIntersectionIterator>; using IteratorImpl = Curved::IntersectionIterator<Grid, typename HostGrid::LeafIntersectionIterator>;
return IteratorImpl(*this, Super::hostEntity().ileafbegin()); return IteratorImpl(*this, Super::hostEntity().ileafbegin());
} }
LeafIntersectionIterator ileafend () const LeafIntersectionIterator ileafend () const
{ {
using IteratorImpl = CGeo::IntersectionIterator<Grid, typename HostGrid::LeafIntersectionIterator>; using IteratorImpl = Curved::IntersectionIterator<Grid, typename HostGrid::LeafIntersectionIterator>;
return IteratorImpl(*this, Super::hostEntity().ileafend()); return IteratorImpl(*this, Super::hostEntity().ileafend());
} }
...@@ -411,13 +411,13 @@ namespace Dune ...@@ -411,13 +411,13 @@ namespace Dune
HierarchicIterator hbegin (int maxLevel) const HierarchicIterator hbegin (int maxLevel) const
{ {
using IteratorImpl = CGeo::HierarchicIterator<G>; using IteratorImpl = Curved::HierarchicIterator<G>;
return IteratorImpl(Super::gridFunction(), Super::hostEntity().hbegin(maxLevel)); return IteratorImpl(Super::gridFunction(), Super::hostEntity().hbegin(maxLevel));
} }
HierarchicIterator hend (int maxLevel) const HierarchicIterator hend (int maxLevel) const
{ {
using IteratorImpl = CGeo::HierarchicIterator<G>; using IteratorImpl = Curved::HierarchicIterator<G>;
return IteratorImpl(Super::gridFunction(), Super::hostEntity().hend(maxLevel)); return IteratorImpl(Super::gridFunction(), Super::hostEntity().hend(maxLevel));
} }
...@@ -437,7 +437,7 @@ namespace Dune ...@@ -437,7 +437,7 @@ namespace Dune
} }
}; };
} // namespace CGeo } // namespace Curved
} // namespace Dune } // namespace Dune
#endif // DUNE_CURVED_SURFACE_GRID_ENTITY_HH #endif // DUNE_CURVED_SURFACE_GRID_ENTITY_HH
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
namespace Dune namespace Dune
{ {
namespace CGeo namespace Curved
{ {
// EntitySeed // EntitySeed
...@@ -50,7 +50,7 @@ namespace Dune ...@@ -50,7 +50,7 @@ namespace Dune
HostEntitySeed hostEntitySeed_ = {}; HostEntitySeed hostEntitySeed_ = {};
}; };
} // namespace CGeo } // namespace Curved
} // namespace Dune } // namespace Dune
#endif // DUNE_CURVED_SURFACE_GRID_ENTITYSEED_HH #endif // DUNE_CURVED_SURFACE_GRID_ENTITYSEED_HH
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
namespace Dune namespace Dune
{ {
namespace CGeo namespace Curved
{ {
/// \brief Curved geometry implementation based on local basis function parametrization /// \brief Curved geometry implementation based on local basis function parametrization
/** /**
...@@ -220,7 +220,7 @@ namespace Dune ...@@ -220,7 +220,7 @@ namespace Dune
#endif // DOXYGEN #endif // DOXYGEN
} // end namespace CGeo } // end namespace Curved
} // namespace Dune } // namespace Dune
#endif // DUNE_CURVED_SURFACE_GRID_GEOMETRY_HH #endif // DUNE_CURVED_SURFACE_GRID_GEOMETRY_HH
...@@ -29,8 +29,8 @@ namespace Dune ...@@ -29,8 +29,8 @@ namespace Dune
using HG = GridOf_t<GridFunction>; using HG = GridOf_t<GridFunction>;
using type = GridDefaultImplementation< using type = GridDefaultImplementation<
HG::dimension, CGeo::DimRange<GridFunction>::value, typename HG::ctype, HG::dimension, Curved::DimRange<GridFunction>::value, typename HG::ctype,
CGeo::GridFamily<GridFunction,order> Curved::GridFamily<GridFunction,order>
>; >;
}; };
} }
...@@ -82,18 +82,18 @@ namespace Dune ...@@ -82,18 +82,18 @@ namespace Dune
template< class GF, int ORDER > template< class GF, int ORDER >
class CurvedSurfaceGrid class CurvedSurfaceGrid
: public CurvedSurfaceGridBase<GF,ORDER> : public CurvedSurfaceGridBase<GF,ORDER>
, public CGeo::BackupRestoreFacilities<CurvedSurfaceGrid<GF,ORDER> > , public Curved::BackupRestoreFacilities<CurvedSurfaceGrid<GF,ORDER> >
{ {
using Self = CurvedSurfaceGrid; using Self = CurvedSurfaceGrid;
using Super = CurvedSurfaceGridBase<GF,ORDER>; using Super = CurvedSurfaceGridBase<GF,ORDER>;
// friend declarations // friend declarations
template< class, class > friend class CGeo::IdSet; template< class, class > friend class Curved::IdSet;
template< class, class > friend class CGeo::IndexSet; template< class, class > friend class Curved::IndexSet;
public: public:
using GridFunction = GF; using GridFunction = GF;
using GridFamily = CGeo::GridFamily<GF,ORDER>; using GridFamily = Curved::GridFamily<GF,ORDER>;
/** \name Traits /** \name Traits
* \{ */ * \{ */
...@@ -441,7 +441,7 @@ namespace Dune ...@@ -441,7 +441,7 @@ namespace Dune
bool loadBalance (CommDataHandleIF<DataHandle, Data>& datahandle) bool loadBalance (CommDataHandleIF<DataHandle, Data>& datahandle)
{ {
using DataHandleIF = CommDataHandleIF<DataHandle, Data>; using DataHandleIF = CommDataHandleIF<DataHandle, Data>;
using WrappedDataHandle = CGeo::CommDataHandle<Self, DataHandleIF>; using WrappedDataHandle = Curved::CommDataHandle<Self, DataHandleIF>;
WrappedDataHandle wrappedDataHandle(*this, datahandle); WrappedDataHandle wrappedDataHandle(*this, datahandle);
const bool gridChanged = hostGrid().loadBalance(wrappedDataHandle); const bool gridChanged = hostGrid().loadBalance(wrappedDataHandle);
......
...@@ -29,7 +29,7 @@ namespace Dune ...@@ -29,7 +29,7 @@ namespace Dune
/** \brief namespace containing the implementations of CurvedSurfaceGrid /** \brief namespace containing the implementations of CurvedSurfaceGrid
* \ingroup CurvedGeo * \ingroup CurvedGeo
*/ */
namespace CGeo namespace Curved
{ {
template< class GF > template< class GF >
struct DimRange struct DimRange
...@@ -74,17 +74,17 @@ namespace Dune ...@@ -74,17 +74,17 @@ namespace Dune
static const int dimensionworld = DimRange<GridFunction>::value; static const int dimensionworld = DimRange<GridFunction>::value;
using LeafIntersection using LeafIntersection
= Dune::Intersection<const Grid, CGeo::Intersection<const Grid, typename HostGrid::LeafIntersection>>; = Dune::Intersection<const Grid, Curved::Intersection<const Grid, typename HostGrid::LeafIntersection>>;
using LevelIntersection using LevelIntersection
= Dune::Intersection<const Grid, CGeo::Intersection<const Grid, typename HostGrid::LevelIntersection>>; = Dune::Intersection<const Grid, Curved::Intersection<const Grid, typename HostGrid::LevelIntersection>>;
using LeafIntersectionIterator using LeafIntersectionIterator