Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
dune-curvedgrid
Commits
9c87c77c
Commit
9c87c77c
authored
Mar 20, 2020
by
Praetorius, Simon
Browse files
implementation of curved geometries based on grid-function evaluation
parent
6c3f2da0
Changes
17
Hide whitespace changes
Inline
Side-by-side
dune/curvedsurfacegrid/backuprestore.hh
View file @
9c87c77c
...
...
@@ -51,10 +51,11 @@ namespace Dune
// BackupRestoreFacility for CurvedSurfaceGrid
// -------------------------------------------
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
>
struct
BackupRestoreFacility
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>>
template
<
class
Gri
dFunction
,
int
order
>
struct
BackupRestoreFacility
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>>
{
using
Grid
=
CurvedSurfaceGrid
<
HostGrid
,
CoordFunction
,
order
,
Allocator
>
;
using
Grid
=
CurvedSurfaceGrid
<
GridFunction
,
order
>
;
using
HostGrid
=
typename
Grid
::
HostGrid
;
using
HostBackupRestoreFacility
=
BackupRestoreFacility
<
HostGrid
>
;
static
void
backup
(
const
Grid
&
grid
,
const
std
::
string
&
filename
)
...
...
@@ -71,15 +72,14 @@ namespace Dune
static
Grid
*
restore
(
const
std
::
string
&
filename
)
{
// notice: We should also restore the coordinate function
HostGrid
*
hostGrid
=
HostBackupRestoreFacility
::
restore
(
filename
);
return
new
Grid
(
hostGrid
,
CoordFunction
{});
assert
(
false
&&
"Restore not yet implemented for CurvedSurfaceGrid"
);
return
nullptr
;
}
static
Grid
*
restore
(
const
std
::
istream
&
stream
)
{
HostGrid
*
hostGrid
=
HostBackupRestoreFacility
::
restore
(
stream
);
return
n
ew
Grid
(
hostGrid
,
CoordFunction
{})
;
assert
(
false
&&
"Restore not yet implemented for CurvedSurfaceGrid"
);
return
n
ullptr
;
}
};
...
...
dune/curvedsurfacegrid/capabilities.hh
View file @
9c87c77c
...
...
@@ -24,61 +24,66 @@ namespace Dune
// Capabilities from dune-grid
// ---------------------------
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
>
struct
hasSingleGeometryType
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
>
template
<
class
Gri
dFunction
,
int
order
>
struct
hasSingleGeometryType
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
>
{
using
HostGrid
=
typename
GridFunction
::
GridView
::
Grid
;
static
const
bool
v
=
hasSingleGeometryType
<
HostGrid
>
::
v
;
static
const
unsigned
int
topologyId
=
hasSingleGeometryType
<
HostGrid
>
::
topologyId
;
};
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
,
int
codim
>
struct
hasEntity
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
,
codim
>
template
<
class
Gri
dFunction
,
int
order
,
int
codim
>
struct
hasEntity
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
,
codim
>
{
static
const
bool
v
=
true
;
};
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
,
int
codim
>
struct
hasEntityIterator
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
,
codim
>
template
<
class
Gri
dFunction
,
int
order
,
int
codim
>
struct
hasEntityIterator
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
,
codim
>
{
static
const
bool
v
=
true
;
};
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
,
int
codim
>
struct
canCommunicate
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
,
codim
>
template
<
class
Gri
dFunction
,
int
order
,
int
codim
>
struct
canCommunicate
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
,
codim
>
{
using
HostGrid
=
typename
GridFunction
::
GridView
::
Grid
;
static
const
bool
v
=
canCommunicate
<
HostGrid
,
codim
>::
v
&&
hasEntity
<
HostGrid
,
codim
>::
v
;
};
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
>
struct
hasBackupRestoreFacilities
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
>
template
<
class
Gri
dFunction
,
int
order
>
struct
hasBackupRestoreFacilities
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
>
{
using
HostGrid
=
typename
GridFunction
::
GridView
::
Grid
;
static
const
bool
v
=
hasBackupRestoreFacilities
<
HostGrid
>::
v
;
};
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
>
struct
isLevelwiseConforming
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
>
template
<
class
Gri
dFunction
,
int
order
>
struct
isLevelwiseConforming
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
>
{
using
HostGrid
=
typename
GridFunction
::
GridView
::
Grid
;
static
const
bool
v
=
isLevelwiseConforming
<
HostGrid
>::
v
;
};
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
>
struct
isLeafwiseConforming
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
>
template
<
class
Gri
dFunction
,
int
order
>
struct
isLeafwiseConforming
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
>
{
using
HostGrid
=
typename
GridFunction
::
GridView
::
Grid
;
static
const
bool
v
=
isLeafwiseConforming
<
HostGrid
>::
v
;
};
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
>
struct
threadSafe
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
>
template
<
class
Gri
dFunction
,
int
order
>
struct
threadSafe
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
>
{
static
const
bool
v
=
false
;
};
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
>
struct
viewThreadSafe
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
>
template
<
class
Gri
dFunction
,
int
order
>
struct
viewThreadSafe
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
>
{
static
const
bool
v
=
false
;
};
...
...
@@ -88,9 +93,10 @@ namespace Dune
// hasHostEntity
// -------------
template
<
class
HostGrid
,
class
Coor
dFunction
,
int
order
,
class
Allocator
,
int
codim
>
struct
hasHostEntity
<
CurvedSurfaceGrid
<
HostGrid
,
Coor
dFunction
,
order
,
Allocator
>
,
codim
>
template
<
class
Gri
dFunction
,
int
order
,
int
codim
>
struct
hasHostEntity
<
CurvedSurfaceGrid
<
Gri
dFunction
,
order
>
,
codim
>
{
using
HostGrid
=
typename
GridFunction
::
GridView
::
Grid
;
static
const
bool
v
=
hasEntity
<
HostGrid
,
codim
>::
v
;
};
...
...
dune/curvedsurfacegrid/datahandle.hh
View file @
9c87c77c
...
...
@@ -47,7 +47,7 @@ namespace Dune
{
using
Entity
=
typename
Grid
::
Traits
::
template
Codim
<
HostEntity
::
codimension
>
::
Entity
;
using
EntityImpl
=
typename
Grid
::
Traits
::
template
Codim
<
HostEntity
::
codimension
>
::
EntityImpl
;
Entity
entity
(
EntityImpl
(
grid_
,
hostEntity
));
Entity
entity
(
EntityImpl
(
grid_
.
gridFunction
()
,
hostEntity
));
return
wrappedHandle_
.
size
(
entity
);
}
...
...
@@ -56,7 +56,7 @@ namespace Dune
{
using
Entity
=
typename
Grid
::
Traits
::
template
Codim
<
HostEntity
::
codimension
>
::
Entity
;
using
EntityImpl
=
typename
Grid
::
Traits
::
template
Codim
<
HostEntity
::
codimension
>
::
EntityImpl
;
Entity
entity
(
EntityImpl
(
grid_
,
hostEntity
));
Entity
entity
(
EntityImpl
(
grid_
.
gridFunction
()
,
hostEntity
));
wrappedHandle_
.
gather
(
buffer
,
entity
);
}
...
...
@@ -65,7 +65,7 @@ namespace Dune
{
using
Entity
=
typename
Grid
::
Traits
::
template
Codim
<
HostEntity
::
codimension
>
::
Entity
;
using
EntityImpl
=
typename
Grid
::
Traits
::
template
Codim
<
HostEntity
::
codimension
>
::
EntityImpl
;
Entity
entity
(
EntityImpl
(
grid_
,
hostEntity
));
Entity
entity
(
EntityImpl
(
grid_
.
gridFunction
()
,
hostEntity
));
wrappedHandle_
.
scatter
(
buffer
,
entity
,
size
);
}
...
...
dune/curvedsurfacegrid/declaration.hh
View file @
9c87c77c
...
...
@@ -6,7 +6,7 @@
namespace
Dune
{
template
<
class
HostGrid
,
class
CoordFunction
,
int
lagrangeOrder
,
class
Allocato
r
>
template
<
class
GridFunction
,
int
orde
r
>
class
CurvedSurfaceGrid
;
}
// namespace Dune
...
...
dune/curvedsurfacegrid/entity.hh
View file @
9c87c77c
...
...
@@ -7,6 +7,7 @@
#include
<dune/geometry/referenceelements.hh>
#include
<dune/grid/common/grid.hh>
#include
<dune/curvedsurfacegrid/geometry.hh>
namespace
Dune
{
...
...
@@ -53,21 +54,10 @@ namespace Dune
class
IntersectionIterator
;
// EntityBase (real)
// -----------------
/** \copydoc EntityBase
*
* This specialization implements the case, where the host grid provides
* the entity for this codimension, i.e., \em fake = \b false.
*
* \nosubgrouping
*/
template
<
int
codim
,
class
Grid
>
template
<
int
codim
,
class
G
>
class
EntityBase
{
using
Traits
=
typename
std
::
remove_const_t
<
G
rid
>::
Traits
;
using
Traits
=
typename
std
::
remove_const_t
<
G
>::
Traits
;
public:
/** \name Attributes
...
...
@@ -90,65 +80,57 @@ namespace Dune
//! coordinate type of the grid
using
ctype
=
typename
Traits
::
ctype
;
//! type of corresponding geometry
using
Geometry
=
typename
Traits
::
template
Codim
<
codimension
>
::
Geometry
;
/** \} */
private:
using
HostGrid
=
typename
Traits
::
HostGrid
;
public:
/** \name Host Types
* \{ */
//! type of corresponding host entity
using
HostEntity
=
typename
HostGrid
::
template
Codim
<
codimension
>
::
Entity
;
//! type of corresponding entity seed
using
EntitySeed
=
typename
Traits
::
template
Codim
<
codimension
>
::
EntitySeed
;
//! type of host elements, i.e., of host entities of codimension 0
using
HostElement
=
typename
HostGrid
::
template
Codim
<
0
>
::
Entity
;
/** \} */
private:
using
GeometryImpl
=
typename
Traits
::
template
Codim
<
codimension
>
::
GeometryImpl
;
using
HostGeometry
=
typename
HostGrid
::
template
Codim
<
codimension
>
::
Geometry
;
public:
/** \name Construction, Initialization and Destruction
* \{ */
using
Grid
=
typename
Traits
::
Grid
;
using
GridFunction
=
typename
Traits
::
GridFunction
;
//! type of the host grid
using
HostGrid
=
typename
Traits
::
HostGrid
;
//! type of corresponding host entity
using
HostEntity
=
typename
HostGrid
::
template
Codim
<
codim
>
::
Entity
;
//! type of host elements, i.e., of host entities of codimension 0
using
HostElement
=
typename
HostGrid
::
template
Codim
<
0
>
::
Entity
;
public:
EntityBase
()
=
default
;
// Construct the entity from an entity seed
EntityBase
(
const
Grid
&
grid
,
const
EntitySeed
&
seed
)
:
hostEntity_
(
grid
.
hostGrid
().
entity
(
seed
.
impl
().
hostEntitySeed
()))
,
grid
_
(
&
grid
)
,
grid
Function_
(
&
grid
.
gridFunction
()
)
{}
// construct the entity from a subentity of a host-entity
EntityBase
(
const
Grid
&
grid
,
const
HostElement
&
hostElement
,
int
i
)
EntityBase
(
const
Grid
Function
&
gridFunction
,
const
HostElement
&
hostElement
,
int
i
)
:
hostEntity_
(
hostElement
.
template
subEntity
<
codim
>(
i
))
,
grid
_
(
&
grid
)
,
grid
Function_
(
&
gridFunction
)
{}
// construct the entity from a host-entity
EntityBase
(
const
Grid
&
grid
,
const
HostEntity
&
hostEntity
)
EntityBase
(
const
Grid
Function
&
gridFunction
,
const
HostEntity
&
hostEntity
)
:
hostEntity_
(
hostEntity
)
,
grid
_
(
&
grid
)
,
grid
Function_
(
&
gridFunction
)
{}
// construct the entity from a host-entity
EntityBase
(
const
Grid
&
grid
,
HostEntity
&&
hostEntity
)
EntityBase
(
const
Grid
Function
&
gridFunction
,
HostEntity
&&
hostEntity
)
:
hostEntity_
(
std
::
move
(
hostEntity
))
,
grid
_
(
&
grid
)
,
grid
Function_
(
&
gridFunction
)
{}
/** \} */
//! compare two entities
bool
equals
(
const
EntityBase
&
other
)
const
{
...
...
@@ -180,42 +162,6 @@ namespace Dune
return
hostEntity
().
partitionType
();
}
//! obtain the geometry of this entity
/**
* Each DUNE entity encapsulates a geometry object, representing the map
* from the reference element to world coordinates. Wrapping the geometry
* is the main objective of the CurvedSurfaceGrid.
*
* The CurvedSurfaceGrid provides geometries by parametrization with local basis
* functions, using the CurvedGeometry.
*
* \returns a new curvedgeometry object
*/
Geometry
geometry
()
const
{
if
(
!
geo_
)
{
// mapping from local to curved global coordinates
auto
ff
=
[
f
=
grid
().
coordFunction
(),
geo
=
hostEntity
().
geometry
()](
const
auto
&
local
)
{
return
f
(
geo
.
global
(
local
));
};
if
(
grid_
->
useGeometryCaching
())
{
auto
const
&
idSet
=
grid_
->
hostGrid
().
localIdSet
();
auto
id
=
idSet
.
id
(
hostEntity
());
auto
&
cache
=
std
::
get
<
codim
>
(
grid_
->
geometryCache_
);
auto
[
it
,
inserted
]
=
cache
.
try_emplace
(
id
,
type
(),
ff
);
geo_
=
it
->
second
;
}
else
{
geo_
=
GeometryImpl
(
type
(),
ff
);
}
}
return
Geometry
(
*
geo_
);
}
//! obtain number of sub-entities of the current entity
unsigned
int
subEntities
(
unsigned
int
cc
)
const
{
...
...
@@ -228,16 +174,13 @@ namespace Dune
return
typename
EntitySeed
::
Implementation
(
hostEntity
().
seed
());
}
/** \} */
/** \name Methods Supporting the Grid Implementation
* \{ */
const
Grid
&
grid
()
const
const
Grid
Function
&
gridFunction
()
const
{
assert
(
grid_
);
return
*
grid_
;
return
*
gridFunction_
;
}
//! return the wrapped host-entity
...
...
@@ -249,20 +192,99 @@ namespace Dune
/** \} */
private:
HostEntity
hostEntity_
=
{};
const
Grid
*
grid_
=
nullptr
;
mutable
Std
::
optional
<
GeometryImpl
>
geo_
;
HostEntity
hostEntity_
;
const
GridFunction
*
gridFunction_
=
nullptr
;
};
template
<
int
codim
,
class
G
>
class
EntityBaseGeometry
:
public
EntityBase
<
codim
,
G
>
{
using
Super
=
EntityBase
<
codim
,
G
>
;
using
Traits
=
typename
std
::
remove_const_t
<
G
>::
Traits
;
public:
//! type of corresponding geometry
using
Geometry
=
typename
Traits
::
template
Codim
<
codim
>
::
Geometry
;
public:
using
Super
::
Super
;
//! obtain the geometry of this entity
Geometry
geometry
()
const
{
if
(
!
geo_
)
{
auto
localFct
=
localFunction
(
Super
::
gridFunction
());
// localFct.bind(Super::hostEntity());
// construct a fake local geometry for transformations.
// auto refElem = referenceElement<typename Geometry::ctype, Super::dimension>(GeometryTypes::simplex(Super::dimension));
geo_
=
std
::
make_shared
<
GeometryImpl
>
(
Super
::
type
(),
localFct
);
}
return
Geometry
(
*
geo_
);
//return Super::hostEntity().geometry();
}
private:
using
GeometryImpl
=
typename
Traits
::
template
Codim
<
codim
>
::
GeometryImpl
;
mutable
std
::
shared_ptr
<
GeometryImpl
>
geo_
;
};
template
<
class
G
>
class
EntityBaseGeometry
<
0
,
G
>
:
public
EntityBase
<
0
,
G
>
{
using
Super
=
EntityBase
<
0
,
G
>
;
using
Traits
=
typename
std
::
remove_const_t
<
G
>::
Traits
;
public:
//! type of corresponding geometry
using
Geometry
=
typename
Traits
::
template
Codim
<
0
>
::
Geometry
;
public:
using
Super
::
Super
;
//! obtain the geometry of this entity
/**
* Each DUNE entity encapsulates a geometry object, representing the map
* from the reference element to world coordinates. Wrapping the geometry
* is the main objective of the CurvedSurfaceGrid.
*
* The CurvedSurfaceGrid provides geometries by parametrization with local basis
* functions, using the CurvedGeometry.
*
* \returns a new curvedgeometry object
*/
Geometry
geometry
()
const
{
if
(
!
geo_
)
{
auto
localFct
=
localFunction
(
Super
::
gridFunction
());
localFct
.
bind
(
Super
::
hostEntity
());
geo_
=
std
::
make_shared
<
GeometryImpl
>
(
Super
::
type
(),
localFct
,
Dune
::
CGeo
::
Impl
::
DefaultLocalGeometry
{});
}
return
Geometry
(
*
geo_
);
}
private:
using
GeometryImpl
=
typename
Traits
::
template
Codim
<
0
>
::
GeometryImpl
;
mutable
std
::
shared_ptr
<
GeometryImpl
>
geo_
;
};
// Entity
// ------
template
<
int
codim
,
int
dim
,
class
G
rid
>
template
<
int
codim
,
int
dim
,
class
G
>
class
Entity
:
public
EntityBase
<
codim
,
G
rid
>
:
public
EntityBase
Geometry
<
codim
,
G
>
{
using
Super
=
EntityBase
<
codim
,
G
rid
>
;
using
Super
=
EntityBase
Geometry
<
codim
,
G
>
;
public:
// import constructors from base class
...
...
@@ -273,13 +295,15 @@ namespace Dune
// Entity for codimension 0
// ------------------------
template
<
int
dim
,
class
G
rid
>
class
Entity
<
0
,
dim
,
G
rid
>
:
public
EntityBase
<
0
,
G
rid
>
template
<
int
dim
,
class
G
>
class
Entity
<
0
,
dim
,
G
>
:
public
EntityBase
Geometry
<
0
,
G
>
{
using
Super
=
EntityBase
<
0
,
G
rid
>
;
using
Super
=
EntityBase
Geometry
<
0
,
G
>
;
using
Traits
=
typename
std
::
remove_const_t
<
Grid
>::
Traits
;
using
Traits
=
typename
std
::
remove_const_t
<
G
>::
Traits
;
using
Grid
=
typename
Traits
::
Grid
;
using
GridFunction
=
typename
Grid
::
GridFunction
;
using
HostGrid
=
typename
Traits
::
HostGrid
;
public:
...
...
@@ -291,7 +315,7 @@ namespace Dune
using
LocalGeometry
=
typename
Traits
::
template
Codim
<
0
>
::
LocalGeometry
;
//! facade type for entities
using
EntityFacade
=
Dune
::
Entity
<
0
,
dim
,
G
rid
,
Dune
::
CGeo
::
Entity
>
;
using
EntityFacade
=
Dune
::
Entity
<
0
,
dim
,
G
,
Dune
::
CGeo
::
Entity
>
;
//! type of hierarchic iterator
using
HierarchicIterator
=
typename
Traits
::
HierarchicIterator
;
...
...
@@ -311,7 +335,7 @@ namespace Dune
typename
Grid
::
template
Codim
<
codim
>
::
Entity
subEntity
(
int
i
)
const
{
using
EntityImpl
=
typename
Traits
::
template
Codim
<
codim
>
::
EntityImpl
;
return
EntityImpl
(
Super
::
grid
(),
Super
::
hostEntity
(),
i
);
return
EntityImpl
(
Super
::
grid
Function
(),
Super
::
hostEntity
(),
i
);
}
LevelIntersectionIterator
ilevelbegin
()
const
...
...
@@ -350,7 +374,7 @@ namespace Dune
EntityFacade
father
()
const
{
return
Entity
(
Super
::
grid
(),
Super
::
hostEntity
().
father
());
return
Entity
(
Super
::
grid
Function
(),
Super
::
hostEntity
().
father
());
}
bool
hasFather
()
const
...
...
@@ -365,14 +389,14 @@ namespace Dune
HierarchicIterator
hbegin
(
int
maxLevel
)
const
{
using
IteratorImpl
=
CGeo
::
HierarchicIterator
<
G
rid
>
;
return
IteratorImpl
(
Super
::
grid
(),
Super
::
hostEntity
().
hbegin
(
maxLevel
));
using
IteratorImpl
=
CGeo
::
HierarchicIterator
<
G
>
;
return
IteratorImpl
(
Super
::
grid
Function
(),
Super
::
hostEntity
().
hbegin
(
maxLevel
));
}
HierarchicIterator
hend
(
int
maxLevel
)
const
{
using
IteratorImpl
=
CGeo
::
HierarchicIterator
<
G
rid
>
;
return
IteratorImpl
(
Super
::
grid
(),
Super
::
hostEntity
().
hend
(
maxLevel
));
using
IteratorImpl
=
CGeo
::
HierarchicIterator
<
G
>
;
return
IteratorImpl
(
Super
::
grid
Function
(),
Super
::
hostEntity
().
hend
(
maxLevel
));
}
bool
isRegular
()
const
...
...
dune/curvedsurfacegrid/entityseed.hh
View file @
9c87c77c
...
...
@@ -16,10 +16,10 @@ namespace Dune
// EntitySeed
// ----------
template
<
int
codim
,
class
G
rd
>
template
<
int
codim
,
class
G
>
class
EntitySeed
{
using
Traits
=
typename
std
::
remove_const_t
<
G
rd
>::
Traits
;
using
Traits
=
typename
std
::
remove_const_t
<
G
>::
Traits
;
using
HostGrid
=
typename
Traits
::
HostGrid
;
using
HostEntitySeed
=
typename
HostGrid
::
template
Codim
<
codim
>
::
EntitySeed
;
...
...
dune/curvedsurfacegrid/geometry.hh
0 → 100644
View file @
9c87c77c
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_CURVED_SURFACE_GRID_GEOMETRY_HH
#define DUNE_CURVED_SURFACE_GRID_GEOMETRY_HH
#include
<cassert>
#include
<functional>
#include
<iterator>
#include
<limits>
#include
<vector>
#include
<dune/common/diagonalmatrix.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/common/fvector.hh>
#include
<dune/common/typetraits.hh>
#include
<dune/common/std/optional.hh>
#include
<dune/common/std/type_traits.hh>
#include
<dune/geometry/affinegeometry.hh>
#include
<dune/geometry/multilineargeometry.hh>
#include
<dune/geometry/quadraturerules.hh>
#include
<dune/geometry/referenceelements.hh>
#include
<dune/geometry/type.hh>
namespace
Dune
{
namespace
CGeo
{
namespace
Impl
{
struct
IdentityMatrix
{};
template
<
class
K
,
int
n
,
int
m
,
int
l
>
FieldMatrix
<
K
,
n
,
m
>
ABt
(
const
FieldMatrix
<
K
,
n
,
l
>&
A
,
const
FieldMatrix
<
K
,
m
,
l
>&
B
)
{
FieldMatrix
<
K
,
n
,
m
>
ABt
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
for
(
int
j
=
0
;
j
<
m
;
++
j
)
{
ABt
[
i
][
j
]
=
0
;
for
(
int
k
=
0
;
k
<
l
;
++
k
)
ABt
[
i
][
j
]
+=
A
[
i
][
k
]
*
B
[
j
][
k
];
}
return
ABt
;
}
template
<
class
K
,
int
n
,
int
m
>
FieldMatrix
<
K
,
n
,
m
>
ABt
(
const
DiagonalMatrix
<
K
,
n
>&
A
,
const
FieldMatrix
<
K
,
m
,
n
>&
B
)
{
FieldMatrix
<
K
,
n
,
m
>
ABt
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
for
(
int
j
=
0
;
j
<
m
;
++
j
)
{
ABt
[
i
][
j
]
=
A
[
i
][
i
]
*
B
[
j
][
i
];
}
return
ABt
;
}
template
<
class
K
,
int
n
,
int
m
,
int
l
>
FieldMatrix
<
K
,
n
,
m
>
AB
(
const
FieldMatrix
<
K
,
n
,
l
>&
A
,
const
FieldMatrix
<
K
,
l
,
m
>&
B
)
{