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
a79dd3ec
Commit
a79dd3ec
authored
21 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
Moved to discfuncarray.* .
[[Imported from SVN: r204]]
parent
4ae58aa7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fem/localfunctionarray.hh
+0
-203
0 additions, 203 deletions
fem/localfunctionarray.hh
with
0 additions
and
203 deletions
fem/localfunctionarray.hh
deleted
100644 → 0
+
0
−
203
View file @
4ae58aa7
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef __DUNE_LOCALFUNCTIONARRAY_HH__
#define __DUNE_LOCALFUNCTIONARRAY_HH__
#include
<vector>
#include
"../common/array.hh"
#include
"basefunctions.hh"
#include
"fastbase.hh"
#include
"localfunction.hh"
#include
"dofiterator.hh"
namespace
Dune
{
//**************************************************************************
//
// --LocalFunctionArray
//
//! Implementation of the local functions
//
//**************************************************************************
template
<
class
DiscreteFunctionSpaceType
>
class
LocalFunctionArray
:
public
LocalFunctionDefault
<
DiscreteFunctionSpaceType
,
LocalFunctionArray
<
DiscreteFunctionSpaceType
>
>
{
typedef
FastBaseFunctionSet
<
DiscreteFunctionSpaceType
>
BaseFunctionSetType
;
typedef
LocalFunctionArray
<
DiscreteFunctionSpaceType
>
MyType
;
typedef
typename
MemoryProvider
<
MyType
>::
ObjectEntity
ObjectEntityType
;
public:
//! Constructor
LocalFunctionArray
(
const
DiscreteFunctionSpaceType
&
f
,
std
::
vector
<
Array
<
RangeField
>
>
&
dofVec
)
:
fSpace_
(
f
),
dofVec_
(
dofVec
)
,
next_
(
NULL
)
{
built_
=
false
;
baseFuncSet_
=
NULL
;
};
~
LocalFunctionArray
()
{
if
(
next_
)
delete
next_
;
}
//! access to dof number num, all dofs of the dof entity
RangeField
&
operator
[]
(
int
num
)
{
//if (!built_) std::cout << "Warning: LocalFunction not built!\n";
return
(
*
dofArray_
)[
map_
[
num
]
];
}
int
numberOfDofs
()
{
//if (!built_) std::cout << "Warning: LocalFunction not built!\n";
return
numOfDof_
;
};
//! sum over all local base functions
template
<
class
EntityType
>
void
evaluate
(
EntityType
&
en
,
const
Domain
&
x
,
Range
&
ret
)
{
ret
=
0.0
;
for
(
int
i
=
0
;
i
<
numOfDof_
;
i
++
)
{
baseFuncSet_
->
evaluate
(
i
,
diffVar
,
x
,
tmp
);
ret
+=
this
->
operator
[]
(
i
)
*
tmp
;
}
}
//! get pointer to next LocalFunction
MyType
*
getNext
()
const
{
return
next_
;
}
//! set pointer to next LocalFunction
void
setNext
(
MyType
*
n
)
{
next_
=
n
;
}
//! methods that do not belong to the interface but have to be public
//! used like setElInfo and so on
template
<
class
EntityType
>
void
init
(
EntityType
&
en
)
{
built_
=
false
;
dofArray_
=
&
dofVec_
[
en
.
level
()
];
baseFuncSet_
=
&
(
fSpace_
.
getBaseFunctionSet
(
en
)
);
numOfDof_
=
baseFuncSet_
->
getNumberOfBaseFunctions
();
if
(
numOfDof_
>
map_
.
size
())
map_
.
resize
(
numOfDof_
);
for
(
int
i
=
0
;
i
<
numOfDof_
;
i
++
)
map_
[
i
]
=
fSpace_
.
mapToGlobal
(
en
,
i
);
built_
=
true
;
};
// print local function
void
print
()
{
for
(
int
i
=
0
;
i
<
numOfDof_
;
i
++
)
std
::
cout
<<
this
->
operator
[]
(
i
)
<<
" Dof "
<<
i
<<
"
\n
"
;
}
protected
:
//! needed once
Range
tmp
;
//! remember pointer to next LocalFunction
MyType
*
next_
;
//! diffVar for evaluate, is empty
const
DiffVariable
<
0
>::
Type
diffVar
;
//! true if setup is done
bool
built_
;
//! number of dofs
int
numOfDof_
;
//! the corresponding function space which provides the base function set
const
DiscreteFunctionSpaceType
&
fSpace_
;
//! dofArray of current level from the discrete function
Array
<
RangeField
>
*
dofArray_
;
//! dofVec from all levels of the discrete function
std
::
vector
<
Array
<
RangeField
>
>
&
dofVec_
;
//! lookup table for local to global mapping
Array
<
int
>
map_
;
//! the corresponding base function set
BaseFunctionSetType
*
baseFuncSet_
;
};
// end LocalFunctionArray
//***********************************************************************
//
// --DofIteratorArray
//
//***********************************************************************
template
<
class
DofType
>
class
DofIteratorArray
:
public
DofIteratorDefault
<
DofType
,
DofIteratorArray
<
DofType
>
>
{
public:
DofIteratorArray
(
Array
<
DofType
>
&
dofArray
,
int
count
)
:
dofArray_
(
dofArray
)
,
count_
(
count
)
{};
DofType
&
operator
*
()
{
return
dofArray_
[
count_
];
};
DofIteratorType
&
operator
++
()
{
count_
++
;
return
(
*
this
);
};
DofIteratorType
&
operator
++
(
int
i
)
{
count_
+=
i
;
return
(
*
this
);
};
DofType
&
operator
[]
(
int
i
)
{
return
dofArray_
[
i
];
}
bool
operator
==
(
const
DofIteratorType
&
I
)
{
return
count_
==
I
.
count_
;
}
bool
operator
!=
(
const
DofIteratorType
&
I
)
{
return
count_
!=
I
.
count_
;
}
int
index
()
{
return
count_
;
}
void
reset
()
{
count_
=
0
;
};
private
:
//! index
int
count_
;
//! the array holding the dofs
Array
<
DofType
>
&
dofArray_
;
};
}
// end namespace Dune
#endif
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