Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
dc43c80b
Commit
dc43c80b
authored
19 years ago
by
Adrian Burri
Browse files
Options
Downloads
Patches
Plain Diff
Final version for today
[[Imported from SVN: r2724]]
parent
8a0e9f44
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fem/space/combinedspace.hh
+29
-1
29 additions, 1 deletion
fem/space/combinedspace.hh
fem/space/subspace.cc
+36
-11
36 additions, 11 deletions
fem/space/subspace.cc
fem/space/subspace.hh
+32
-10
32 additions, 10 deletions
fem/space/subspace.hh
with
97 additions
and
22 deletions
fem/space/combinedspace.hh
+
29
−
1
View file @
dc43c80b
...
...
@@ -10,6 +10,7 @@
#include
<dune/fem/common/discretefunctionspace.hh>
#include
<dune/fem/common/basefunctions.hh>
#include
<dune/fem/common/dofmapperinterface.hh>
#include
<dune/fem/space/subspace.hh>
#include
<dune/common/misc.hh>
namespace
Dune
{
...
...
@@ -141,6 +142,8 @@ namespace Dune {
typedef
typename
ContainedSpaceTraits
::
GridType
GridType
;
typedef
typename
ContainedSpaceTraits
::
IteratorType
IteratorType
;
typedef
DofConversionUtility
<
policy
>
DofConversionType
;
enum
{
DimRange
=
FunctionSpaceType
::
DimRange
,
DimDomain
=
FunctionSpaceType
::
DimDomain
};
public
:
...
...
@@ -181,6 +184,8 @@ namespace Dune {
typedef
typename
Traits
::
BaseFunctionSetType
BaseFunctionSetType
;
typedef
typename
Traits
::
MapperType
MapperType
;
typedef
typename
Traits
::
DofConversionType
DofConversionType
;
CompileTimeChecker
<
(
Traits
::
ContainedDimRange
==
1
)
>
use_CombinedSpace_only_with_scalar_spaces
;
public:
//- Public methods
...
...
@@ -233,13 +238,28 @@ namespace Dune {
//! access to mapper
const
MapperType
&
mapper
()
const
{
return
mapper_
;
}
//- Additional methods
//! number of components
int
numComponents
()
const
{
return
N
;
}
//! policy of this space
DofStoragePolicy
policy
()
const
{
return
policy
;
}
private
:
//- Private typedefs
typedef
typename
Traits
::
ContainedMapperType
ContainedMapperType
;
//- Friend
friend
class
SubSpace
<
ThisType
>
;
private
:
//- Private methods
CombinedSpace
(
const
ThisType
&
other
);
const
ContainedMapperType
&
containedMapper
()
const
{
return
mapper_
.
containedMapper
();
}
private
:
//- Member data
ContainedDiscreteFunctionSpaceType
&
spc_
;
...
...
@@ -343,6 +363,10 @@ namespace Dune {
CombinedMapper
<
DiscreteFunctionSpaceImp
,
N
,
policy
>
>
{
public:
//- Friends
friend
class
CombinedSpace
<
DiscreteFunctionSpaceImp
,
N
,
policy
>
;
public:
//- Typedefs and enums
enum
{
numComponents
=
N
};
...
...
@@ -359,7 +383,7 @@ namespace Dune {
spc_
(
spc
),
mapper_
(
mapper
),
utilLocal_
(
N
),
utilGlobal_
(
chooseSize
(
N
,
spc
.
size
(),
Int2Type
<
policy
>
()
))
utilGlobal_
(
policy
==
PointBased
?
N
:
spc
.
size
(
))
{}
//! Total number of degrees of freedom
...
...
@@ -410,6 +434,10 @@ namespace Dune {
//- Private methods
CombinedMapper
(
const
ThisType
&
other
);
const
ContainedMapperType
&
containedMapper
()
const
{
return
mapper_
;
}
static
int
chooseSize
(
int
pointBased
,
int
variableBased
,
Int2Type
<
PointBased
>
)
{
return
pointBased
;
...
...
This diff is collapsed.
Click to expand it.
fem/space/subspace.cc
+
36
−
11
View file @
dc43c80b
...
...
@@ -13,40 +13,65 @@ namespace Dune {
mapper_
(
spc
,
spc
.
mapper
(),
component
),
component_
(
component
)
{
assert
(
false
);
// * more to come here
// initialise your basefunction set with all Geometry types found in mesh
IteratorType
endit
=
spc
.
end
();
for
(
IteratorType
it
=
spc
.
begin
();
it
!=
endit
;
++
it
)
{
GeometryType
geo
=
it
->
geometry
().
type
();
const
int
dimension
=
static_cast
<
int
>
(
IteratorType
::
Entity
::
mydimension
);
GeometryIdentifier
::
IdentifierType
id
=
GeometryIdentifier
::
fromGeo
(
dimension
,
geo
);
assert
(
id
>=
0
&&
id
<
GeometryIdentifier
::
numTypes
);
if
(
baseSetVec_
[
id
]
==
0
)
{
baseSetVec_
[
id
]
=
new
BaseFunctionSetType
(
spc
.
getBaseFunctionSet
(
*
it
),
component
);
}
}
// end for
}
//- class SubBaseFunctionSet
template
<
class
CombinedSpaceImp
>
template
<
int
diffOrd
>
void
Sub
Mapper
<
CombinedSpaceImp
>::
void
Sub
BaseFunctionSet
<
CombinedSpaceImp
>::
evaluate
(
int
baseFunct
,
const
FieldVector
<
deriType
,
diffOrd
>
&
diffVariable
,
const
DomainType
&
x
,
RangeType
&
phi
)
const
;
const
FieldVector
<
deriType
,
diffOrd
>&
diffVariable
,
const
DomainType
&
x
,
RangeType
&
phi
)
const
{
// Assumption: dimRange == 1
bSet_
.
evaluate
(
baseFunct
,
diffVariable
,
x
,
tmp_
);
phi
[
0
]
=
tmp_
[
component_
];
}
//! evaluate base function at quadrature point
template
<
class
CombinedSpaceImp
>
template
<
int
diffOrd
,
class
QuadratureType
>
void
Sub
Mapper
<
CombinedSpaceImp
>::
void
Sub
BaseFunctionSet
<
CombinedSpaceImp
>::
evaluate
(
int
baseFunct
,
const
FieldVector
<
deriType
,
diffOrd
>
&
diffVariable
,
QuadratureType
&
quad
,
int
quadPoint
,
RangeType
&
phi
)
const
;
int
quadPoint
,
RangeType
&
phi
)
const
{
// Assumption: dimRange == 1
bSet_
.
evaluate
(
baseFunct
,
diffVariable
,
quad
,
quadPoint
,
tmp_
);
phi
[
0
]
=
tmp_
[
component_
];
}
//- class SubMapper
template
<
class
CombinedSpaceImp
>
int
SubMapper
<
CombinedSpaceImp
>::
size
()
const
{
assert
(
false
);
// *more to come
return
mapper_
.
size
();
}
template
<
class
CombinedSpaceImp
>
template
<
class
EntityType
>
SubMapper
<
CombinedSpaceImp
>::
mapToGlobal
(
EntityType
&
en
,
int
localNum
)
const
{
assert
(
false
);
// *more to come
const
int
containedGlobal
=
mapper_
.
mapToGlobal
(
en
,
localNum
);
utilGlobal_
.
newSize
(
mapper_
.
size
());
// ok, since pointbased specialisation does nothing for newSize
return
utilGlobal_
.
combinedDof
(
containedGlobal
,
component_
);
}
...
...
This diff is collapsed.
Click to expand it.
fem/space/subspace.hh
+
32
−
10
View file @
dc43c80b
...
...
@@ -12,6 +12,14 @@
namespace
Dune
{
//- Forward declarations
template
<
class
CombinedSpaceImp
>
class
SubSpace
;
template
<
class
CombinedSpaceImp
>
class
SubBaseFunctionSet
;
template
<
class
CombinedSpaceImp
>
class
SubMapper
;
template
<
class
CombinedSpaceImp
>
struct
SubSpaceTraits
{
private:
...
...
@@ -25,9 +33,10 @@ namespace Dune {
typedef
typename
CombinedTraits
::
BaseFunctionSetType
CombinedBaseFunctionSetType
;
typedef
typename
CombinedTraits
::
MapperType
CombinedMapperType
;
enum
{
CombinedDimRange
=
CombinedTraits
::
DimRange
;
}
enum
{
CombinedDimRange
=
CombinedTraits
::
DimRange
}
;
public
:
// Assumption: only scalar contained function spaces
enum
{
DimDomain
=
CombinedTraits
::
DimDomain
,
DimRange
=
1
};
...
...
@@ -45,6 +54,7 @@ namespace Dune {
typedef
typename
CombinedTraits
::
GridType
GridType
;
typedef
typename
CombinedTraits
::
IteratorType
IteratorType
;
typedef
typename
CombinedTraits
::
DofConversionType
DofConversionType
;
public
:
//- Friends
...
...
@@ -136,7 +146,7 @@ namespace Dune {
};
// Idea: wrap contained base function set, since this is exactly what you
// need here (except for when you go for ranges...)
// need here (except for when you go for ranges
of subfunctions
...)
template
<
class
CombinedSpaceImp
>
class
SubBaseFunctionSet
:
public
BaseFunctionSetDefault
<
SubSpaceTraits
<
CombinedSpaceImp
>
>
...
...
@@ -159,8 +169,11 @@ namespace Dune {
typedef
int
deriType
;
public:
//- Public methods
SubBaseFunctionSet
(
const
CombinedBaseFunctionSetType
&
bSet
)
:
bSet_
(
bSet
)
SubBaseFunctionSet
(
const
CombinedBaseFunctionSetType
&
bSet
,
int
component
)
:
bSet_
(
bSet
),
component_
(
component
),
tmp_
(
0.0
)
{}
int
getNumberOfBaseFunctions
()
const
{
...
...
@@ -184,7 +197,9 @@ namespace Dune {
private
:
//- Data members
const
CombinedBaseFunctionSetType
&
bSet_
;
int
component_
;
const
int
component_
;
mutable
CombinedRangeType
tmp_
;
};
template
<
class
CombinedSpaceImp
>
...
...
@@ -199,16 +214,21 @@ namespace Dune {
typedef
SubSpaceTraits
<
CombinedSpaceType
>
Traits
;
typedef
typename
Traits
::
CombinedMapperType
CombinedMapperType
;
typedef
typename
Traits
::
DofConversionType
DofConversionType
;
public:
//- Public methods
SubMapper
(
const
CombinedSpaceType
&
spc
,
const
Co
mb
inedMapperType
&
mapper
,
const
Co
nta
inedMapperType
&
mapper
,
int
component
)
:
spc_
(
spc
),
mapper_
(
mapper
),
component_
(
component
)
component_
(
component
),
utilGlobal_
(
policy
==
PointBased
()
?
spc
.
numComponents
()
:
spc
.
size
()
/
spc
.
numComponents
())
{}
//! Total number of degrees of freedom
int
size
()
const
;
...
...
@@ -267,9 +287,11 @@ namespace Dune {
private
:
//- Data members
CombinedSpaceType
&
spc_
;
CombinedMapperType
&
mapper_
;
int
component_
;
const
CombinedSpaceType
&
spc_
;
const
ContainedMapperType
&
mapper_
;
const
int
component_
;
DofConversionType
utilGlobal_
;
};
}
// end namespace Dune
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment