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
Nils-Arne Dreier
dune-common
Commits
754bcdfb
Commit
754bcdfb
authored
20 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
added a Quadrature::Iterator based on GenericIterator
[[Imported from SVN: r1102]]
parent
98c37dc8
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
quadrature/common/quadrature.hh
+61
-69
61 additions, 69 deletions
quadrature/common/quadrature.hh
with
61 additions
and
69 deletions
quadrature/common/quadrature.hh
+
61
−
69
View file @
754bcdfb
...
...
@@ -5,11 +5,14 @@
#include
<vector>
#include
<dune
/common/dynamictype.hh
>
#include
"../..
/common/dynamictype.hh
"
// For ElementType
#include
<dune/grid/common/grid.hh>
// For Quadrature::Iterator
#include
"../../common/genericiterator.hh"
namespace
Dune
{
...
...
@@ -49,41 +52,6 @@ namespace Dune {
static
RangeField
getWeight
(
int
i
);
};
template
<
class
Domain
,
class
RangeField
,
ElementType
ElType
,
int
polOrd
>
int
QuadraturePoints
<
Domain
,
RangeField
,
ElType
,
polOrd
>::
numberOfQuadPoints
()
{
return
-
1
;
}
template
<
class
Domain
,
class
RangeField
,
ElementType
ElType
,
int
polOrd
>
int
QuadraturePoints
<
Domain
,
RangeField
,
ElType
,
polOrd
>::
order
()
{
return
-
1
;
}
//! default implementation of getPoint throws error because no
//! default implementation can be done in this matter
template
<
class
Domain
,
class
RangeField
,
ElementType
ElType
,
int
polOrd
>
Domain
QuadraturePoints
<
Domain
,
RangeField
,
ElType
,
polOrd
>::
getPoint
(
int
i
)
{
Domain
tmp
;
std
::
cerr
<<
"No default implementation of getPoint (i) available for this set of template parameters!
\n
"
;
abort
();
return
tmp
;
}
//! default implementation of getWeight throws error because no
//! default implementation can be done in this matter
template
<
class
Domain
,
class
RangeField
,
ElementType
ElType
,
int
polOrd
>
RangeField
QuadraturePoints
<
Domain
,
RangeField
,
ElType
,
polOrd
>::
getWeight
(
int
i
)
{
RangeField
tmp
;
std
::
cerr
<<
"No default implementation of getWeight (i) available for this set of template parameters!
\n
"
;
abort
();
return
tmp
;
}
template
<
class
Domain
,
class
RangeField
,
ElementType
ElType
,
int
polOrd
>
struct
DualQuadraturePoints
{
...
...
@@ -93,30 +61,6 @@ namespace Dune {
static
RangeField
getWeight
(
int
i
);
};
//! default implementation of getPoint throws error because no
//! default implementation can be done in this matter
template
<
class
Domain
,
class
RangeField
,
ElementType
ElType
,
int
polOrd
>
Domain
DualQuadraturePoints
<
Domain
,
RangeField
,
ElType
,
polOrd
>::
getPoint
(
int
i
)
{
Domain
tmp
;
std
::
cerr
<<
"No default implementation of getPoint (i) available for this set of template parameters!
\n
"
;
abort
();
return
tmp
;
}
//! default implementation of getWeight throws error because no
//! default implementation can be done in this matter
template
<
class
Domain
,
class
RangeField
,
ElementType
ElType
,
int
polOrd
>
RangeField
DualQuadraturePoints
<
Domain
,
RangeField
,
ElType
,
polOrd
>::
getWeight
(
int
i
)
{
RangeField
tmp
;
std
::
cerr
<<
"No default implementation of getWeight (i) available for this set of template parameters!
\n
"
;
abort
();
return
tmp
;
}
//**************************************************************************
//
// --QuadratureInterface
...
...
@@ -132,15 +76,9 @@ namespace Dune {
class
QuadratureInterface
:
public
DynamicType
{
public:
//! Contructor passing ident to DynamicType for comparison with other
//! Quadratures
//QuadratureInterface ( int ident ) : DynamicType (ident) {};
//QuadratureInterface () {};
//! return number of quadrature points
int
nop
()
const
{
return
asImp
().
nop
();
}
//! return order of quadrature
int
order
()
const
{
return
asImp
().
order
();
}
...
...
@@ -171,9 +109,64 @@ namespace Dune {
:
public
QuadratureInterface
<
RangeFieldType
,
DomainType
,
QuadratureImp
>
{
public:
//
QuadratureDefault
( int ident ) :
//
Quadrature
Interface < RangeFieldType , DomainType, QuadratureImp > (ident) {}
;
typedef
QuadratureDefault
<
RangeFieldType
,
DomainType
,
QuadratureImp
>
Quadrature
Class
;
//! A single quadrature point
class
QuadraturePoint
{
DomainType
p
;
RangeFieldType
w
;
QuadraturePoint
()
{};
public
:
friend
class
QuadratureDefault
<
RangeFieldType
,
DomainType
,
QuadratureImp
>
;
//! return the evalution point
const
DomainType
&
point
()
const
{
return
p
;
}
//! return the weight
const
RangeFieldType
&
weight
()
const
{
return
w
;
}
};
//! get quadrature point i
QuadraturePoint
&
operator
[]
(
int
i
)
const
{
static
QuadraturePoint
qp
;
qp
.
p
=
this
->
point
(
i
);
qp
.
w
=
this
->
weight
(
i
);
return
qp
;
};
//! Iterator for quadrature points
typedef
GenericIterator
<
QuadratureClass
,
QuadraturePoint
>
Iterator
;
//! const Iterator for quadrature points
typedef
GenericIterator
<
const
QuadratureClass
,
const
QuadraturePoint
>
constIterator
;
/** Returns an Iterator pointing to the beginning of the
quadrature point list. */
Iterator
begin
(){
return
Iterator
(
*
this
,
0
);
}
/** Returns an constIterator pointing to the beginning of the
quadrature point list. */
constIterator
begin
()
const
{
return
constIterator
(
*
this
,
0
);
}
/** Returns an Iterator pointing to the end of the
quadrature point list. */
Iterator
end
(){
return
Iterator
(
*
this
,
asImp
().
nop
());
}
/** Returns an constIterator pointing to the end of the
quadrature point list. */
constIterator
end
()
const
{
return
constIterator
(
*
this
,
asImp
().
nop
());
}
//! pretty print this Quadrature to ostream s
void
print
(
std
::
ostream
&
s
,
int
indent
)
const
{
double
sum
=
0.0
;
...
...
@@ -204,7 +197,6 @@ namespace Dune {
return
s
;
}
/** @} end documentation group */
}
// 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