Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Core Modules
dune-istl
Commits
fcb2ce25
Commit
fcb2ce25
authored
19 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Moved generic construction to separate file.
[[Imported from SVN: r325]]
parent
7b74f7fc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
istl/paamg/construction.hh
+66
-0
66 additions, 0 deletions
istl/paamg/construction.hh
istl/paamg/hierarchy.hh
+1
-0
1 addition, 0 deletions
istl/paamg/hierarchy.hh
istl/paamg/test/galerkintest.cc
+1
-1
1 addition, 1 deletion
istl/paamg/test/galerkintest.cc
with
68 additions
and
1 deletion
istl/paamg/construction.hh
0 → 100644
+
66
−
0
View file @
fcb2ce25
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_AMGCONSTRUCTION_HH
#define DUNE_AMGCONSTRUCTION_HH
namespace
Dune
{
namespace
Amg
{
/**
* @addtogroup ISTL_PAAMG
*
* @{
*/
/** @file
* @author Markus Blatt
* @brief Helper classes for the construction of classes without
* empty constructor.
*/
/**
* @brief Traits class for generically constructing non default
* constructable types.
*
* Needed because BCRSMatrix and Vector do a deep copy which is
* too expensive.
*/
template
<
typename
T
>
class
ConstructionTraits
{
public:
/**
* @brief A type holding all the arguments needed to call the
* constructor.
*/
typedef
const
void
*
Arguments
;
/**
* @brief Construct an object with the specified arguments.
*
* In the default implementation the copy constructor is called.
* @param object Pointer to the space allocated for the object.
* @param arguments The arguments for the construction.
*/
static
inline
T
*
construct
(
Arguments
&
args
)
{
return
new
T
();
}
};
template
<
class
T
>
class
ConstructionTraits
<
BlockVector
<
T
>
>
{
public:
typedef
const
int
Arguments
;
static
inline
BlockVector
<
T
>*
construct
(
Arguments
&
n
)
{
return
new
BlockVector
<
T
>
(
n
);
}
};
/** @} */
}
// namespace Amg
}
// namespace Dune
#endif
This diff is collapsed.
Click to expand it.
istl/paamg/hierarchy.hh
+
1
−
0
View file @
fcb2ce25
...
...
@@ -22,6 +22,7 @@
#include
<dune/istl/paamg/graph.hh>
#include
<dune/istl/paamg/indicescoarsener.hh>
#include
<dune/istl/paamg/globalaggregates.hh>
#include
<dune/istl/paamg/construction.hh>
namespace
Dune
{
...
...
This diff is collapsed.
Click to expand it.
istl/paamg/test/galerkintest.cc
+
1
−
1
View file @
fcb2ce25
...
...
@@ -127,6 +127,6 @@ void testCoarsenIndices()
int
main
(
int
argc
,
char
**
argv
)
{
MPI_Init
(
&
argc
,
&
argv
);
testCoarsenIndices
<
3
,
1
>
();
testCoarsenIndices
<
10
,
2
>
();
MPI_Finalize
();
}
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