Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
MultigridCompositeGrid.h
Go to the documentation of this file.
1
/* -*-Mode: c++; -*- */
2
#ifndef MULTIGRID_COMPOSITE_GRID_H
3
#define MULTIGRID_COMPOSITE_GRID_H "MultigridCompositeGrid.h"
4
5
//=======================================================================================
10
//======================================================================================
11
12
#include "
Overture.h
"
13
14
class
MultigridCompositeGrid
:
public
ReferenceCounting
// derive the class from ReferenceCounting
15
{
16
17
public
:
18
19
// default constructor
20
MultigridCompositeGrid
( );
21
22
// destructor
23
~MultigridCompositeGrid
();
24
25
// copy constructor
26
MultigridCompositeGrid
(
const
MultigridCompositeGrid
& rcc,
27
const
CopyType
copyType =
DEEP
);
28
29
// assignment operator
30
MultigridCompositeGrid
&
operator=
(
const
MultigridCompositeGrid
& rcc );
31
32
// Allocate space for the CompositeGrid
33
int
allocate
();
34
36
const
CompositeGrid
&
compositeGrid
()
const
{
assert
(
rcData
->
pcg
!=
NULL
);
return
*
rcData
->
pcg
; }
37
38
CompositeGrid
&
operator()
(){
assert
(
rcData
->
pcg
!=
NULL
);
return
*
rcData
->
pcg
; }
//
39
const
CompositeGrid
&
operator()
()
const
{
assert
(
rcData
->
pcg
!=
NULL
);
return
*
rcData
->
pcg
; }
//
40
42
bool
isGridUpToDate
(){
return
rcData
->
isUpToDate
; }
43
44
// Return true if the CompositeGrid has not be allocated yet:
45
bool
isNull
()
const
{
return
rcData
->
pcg
==
NULL
; }
//
46
47
// Specify that the multigrid hierarchy is or is not update to date.
48
void
setGridIsUpToDate
(
bool
trueOrFalse =
true
);
49
50
// Update the grid to match a new CompositeGrid.
51
void
updateToMatchGrid
(
CompositeGrid
& cg );
52
53
// reference this object to another
54
void
reference
(
const
MultigridCompositeGrid
& rcc );
55
56
// break a reference
57
void
breakReference
();
58
59
private
:
60
61
// used by constructors
62
void
initialize();
63
64
// These are used by list's of ReferenceCounting objects
65
virtual
void
reference
(
const
ReferenceCounting
& rcc )
66
{
MultigridCompositeGrid::reference
( (
MultigridCompositeGrid
&) rcc ); }
67
virtual
ReferenceCounting
&
operator=
(
const
ReferenceCounting
& rcc )
68
{
return
MultigridCompositeGrid::operator=
( (
MultigridCompositeGrid
&) rcc ); }
69
virtual
ReferenceCounting
* virtualConstructor(
const
CopyType
ct =
DEEP
)
70
{ return ::new
MultigridCompositeGrid
(*
this
,ct); }
71
72
// protected:
73
public
:
// *wdh* 110518 do this for now to fix a problem with gcc 4.5.?
74
75
// this class hold the reference counted data
76
class
MultigridCompositeGridData
:
public
ReferenceCounting
77
{
78
public
:
79
80
CompositeGrid
*
pcg
;
// holds the multigrid hierarchy
81
bool
isUpToDate
;
// set to true when the multigrid hierarchy is up to date.
82
83
MultigridCompositeGridData
();
84
85
~MultigridCompositeGridData
();
86
87
MultigridCompositeGridData
&
operator=
(
const
MultigridCompositeGridData
& rcc );
88
89
private
:
90
// These are used by list's of ReferenceCounting objects
91
virtual
void
reference(
const
ReferenceCounting
& rcc )
92
{ MultigridCompositeGridData::reference( (
MultigridCompositeGridData
&) rcc ); }
93
virtual
ReferenceCounting
&
operator=
(
const
ReferenceCounting
& rcc )
94
{
return
MultigridCompositeGridData::operator=
( (
MultigridCompositeGridData
&) rcc ); }
95
virtual
ReferenceCounting
* virtualConstructor(
const
CopyType
)
96
{ return ::new
MultigridCompositeGridData
(); }
97
};
98
99
100
protected
:
101
MultigridCompositeGridData
*
rcData
;
102
103
104
};
105
106
#endif
Generated on Fri Jan 4 2013 10:17:56 for Overture by
1.8.3