Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-gdt
Commits
bcb18c2b
Commit
bcb18c2b
authored
12 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[discreteoperator.local.codim1.boundaryintegral] minor rewrite
parent
1a75c4c9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/detailed/discretizations/discreteoperator/local/codim1/boundaryintegral.hh
+42
-45
42 additions, 45 deletions
...zations/discreteoperator/local/codim1/boundaryintegral.hh
with
42 additions
and
45 deletions
dune/detailed/discretizations/discreteoperator/local/codim1/boundaryintegral.hh
+
42
−
45
View file @
bcb18c2b
...
...
@@ -5,11 +5,14 @@
#ifndef DUNE_DETAILED_DISCRETIZATIONS_DISCRETEOPERATOR_LOCAL_CODIM1_BOUNDARYINTEGRAL_HH
#define DUNE_DETAILED_DISCRETIZATIONS_DISCRETEOPERATOR_LOCAL_CODIM1_BOUNDARYINTEGRAL_HH
// dune
grid includes
#include
<dune/
grid/
common/
quadraturerules
.hh>
// dune
-common
#include
<dune/common/
densematrix
.hh>
// dune-helper-tools includes
#include
<dune/helper-tools/common/matrix.hh>
// dune-geometry
#include
<dune/geometry/quadraturerules.hh>
// dune-stuff
#include
<dune/stuff/common/matrix.hh>
namespace
Dune
{
...
...
@@ -41,6 +44,8 @@ public:
typedef
typename
FunctionSpaceType
::
DomainType
DomainType
;
typedef
typename
FunctionSpaceType
::
DomainFieldType
DomainFieldType
;
// template< class InducingDiscreteFunctionType >
// class LocalFunctional
// {
...
...
@@ -50,17 +55,11 @@ public:
// Type;
// };
BoundaryIntegral
(
const
LocalEvaluationType
localEvaluation
)
BoundaryIntegral
(
const
LocalEvaluationType
&
localEvaluation
)
:
localEvaluation_
(
localEvaluation
)
{
}
//! copy constructor
BoundaryIntegral
(
const
ThisType
&
other
)
:
localEvaluation_
(
other
.
localEvaluation
())
{
}
const
LocalEvaluationType
&
localEvaluation
()
const
{
return
localEvaluation_
;
...
...
@@ -88,44 +87,38 @@ public:
const
LocalTestBaseFunctionSetType
&
localTestBaseFunctionSet
,
const
IntersectionType
&
intersection
,
LocalMatrixType
&
localMatrix
,
std
::
vector
<
LocalMatrixType
>&
tmpLocalMatrices
)
const
{
// some types
typedef
typename
LocalAnsatzBaseFunctionSetType
::
DiscreteFunctionSpaceType
DiscreteFunctionSpaceType
;
typedef
typename
DiscreteFunctionSpaceType
::
GridViewType
GridViewType
;
typedef
Dune
::
QuadratureRules
<
double
,
IntersectionType
::
mydimension
>
FaceQuadratureRules
;
typedef
Dune
::
QuadratureRule
<
double
,
IntersectionType
::
mydimension
>
FaceQuadratureType
;
typedef
typename
IntersectionType
::
LocalCoordinate
LocalCoordinateType
;
// some stuff
const
unsigned
int
rows
=
localAnsatzBaseFunctionSet
.
size
();
const
unsigned
int
cols
=
localTestBaseFunctionSet
.
size
();
const
unsigned
int
quadratureOrder
=
localEvaluation_
.
order
()
+
localAnsatzBaseFunctionSet
.
order
()
+
localTestBaseFunctionSet
.
order
();
const
FaceQuadratureType
&
faceQuadrature
=
FaceQuadratureRules
::
rule
(
intersection
.
type
(),
2
*
quadratureOrder
+
1
);
// make sure, that the target matri
ces are
big enough
// make sure, that the target matri
x is
big enough
assert
(
localMatrix
.
rows
()
>=
rows
);
assert
(
localMatrix
.
cols
()
>=
cols
);
// clear target matri
ces
Dune
::
HelperTools
::
Common
::
Matrix
::
clear
(
localMatrix
);
// clear target matri
x
Dune
::
Stuff
::
Common
::
Matrix
::
clear
(
localMatrix
);
// check tmp local matrices
if
(
tmpLocalMatrices
.
size
()
<
1
)
{
tmpLocalMatrices
.
resize
(
1
,
if
(
tmpLocalMatrices
.
size
()
<
numTmpObjectsRequired
()
)
{
tmpLocalMatrices
.
resize
(
numTmpObjectsRequired
()
,
LocalMatrixType
(
localAnsatzBaseFunctionSet
.
baseFunctionSet
().
space
().
map
().
maxLocalSize
(),
localTestBaseFunctionSet
.
baseFunctionSet
().
space
().
map
().
maxLocalSize
(),
RangeFieldType
(
0.0
)));
}
}
// check tmp local matrices
const
typename
FaceQuadratureType
::
const_iterator
quadratureEnd
=
faceQuadrature
.
end
();
for
(
typename
FaceQuadratureType
::
const_iterator
quadPoint
=
faceQuadrature
.
begin
();
quadPoint
!=
quadratureEnd
;
// quadrature
const
unsigned
int
quadratureOrder
=
localEvaluation_
.
order
()
+
localAnsatzBaseFunctionSet
.
order
()
+
localTestBaseFunctionSet
.
order
();
typedef
Dune
::
QuadratureRules
<
DomainFieldType
,
IntersectionType
::
mydimension
>
FaceQuadratureRules
;
typedef
Dune
::
QuadratureRule
<
DomainFieldType
,
IntersectionType
::
mydimension
>
FaceQuadratureType
;
const
FaceQuadratureType
&
faceQuadrature
=
FaceQuadratureRules
::
rule
(
intersection
.
type
(),
2
*
quadratureOrder
+
1
);
// loop over all quadrature points
for
(
typename
FaceQuadratureType
::
const_iterator
quadPoint
=
faceQuadrature
.
begin
();
quadPoint
!=
faceQuadrature
.
end
();
++
quadPoint
)
{
// local coordinates
const
LocalCoordinate
Type
x
=
quadPoint
->
position
();
const
typename
IntersectionType
::
LocalCoordinate
x
=
quadPoint
->
position
();
// integration factors
const
double
integrationFactor
=
intersection
.
geometry
().
integrationElement
(
x
);
...
...
@@ -138,27 +131,31 @@ public:
// compute integral (see below)
addToIntegral
(
tmpLocalMatrices
[
0
],
integrationFactor
,
quadratureWeight
,
rows
,
cols
,
localMatrix
);
}
//
done
loop over all quadrature points
}
// loop over all quadrature points
}
// end method applyLocal
private
:
//! assignment operator
BoundaryIntegral
(
const
ThisType
&
);
ThisType
&
operator
=
(
const
ThisType
&
);
template
<
class
Local
Matrix
Type
,
class
RangeFieldType
>
void
addToIntegral
(
const
Local
Matrix
Type
&
localMatrix
,
const
RangeFieldType
&
integrationFactor
,
template
<
class
Matrix
Imp
,
class
RangeFieldType
>
void
addToIntegral
(
const
Dune
::
DenseMatrix
<
Matrix
Imp
>
&
localMatrix
,
const
RangeFieldType
&
integrationFactor
,
const
RangeFieldType
&
quadratureWeight
,
const
unsigned
int
rows
,
const
unsigned
int
cols
,
Local
Matrix
Type
&
ret
)
const
Dune
::
DenseMatrix
<
Matrix
Imp
>
&
ret
)
const
{
// loop over all rows
for
(
unsigned
int
i
=
0
;
i
<
rows
;
++
i
)
{
// get row
const
typename
Dune
::
DenseMatrix
<
MatrixImp
>::
const_row_reference
localMatrixRow
=
localMatrix
[
i
];
typename
Dune
::
DenseMatrix
<
MatrixImp
>::
row_reference
retRow
=
ret
[
i
];
// loop over all cols
for
(
unsigned
int
j
=
0
;
j
<
cols
;
++
j
)
{
ret
[
i
][
j
]
+=
localMatrix
[
i
][
j
]
*
integrationFactor
*
quadratureWeight
;
}
}
}
// end method addToIntegral
const
LocalEvaluationType
localEvaluation_
;
retRow
[
j
]
+=
localMatrixRow
[
j
]
*
integrationFactor
*
quadratureWeight
;
}
// loop over all cols
}
// loop over all rows
}
// void addToIntegral(...) const
const
LocalEvaluationType
&
localEvaluation_
;
};
// end class BoundaryIntegral
}
// end namespace Codim1
...
...
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