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
53170dae
Commit
53170dae
authored
20 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
Some changes in resize methods for new adaptation strategy.
[[Imported from SVN: r1878]]
parent
88e9ec32
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
fem/dofmanager.hh
+32
-2
32 additions, 2 deletions
fem/dofmanager.hh
with
32 additions
and
2 deletions
fem/dofmanager.hh
+
32
−
2
View file @
53170dae
...
...
@@ -231,7 +231,7 @@ namespace Dune {
return
;
}
int
nMemSize
=
(
int
)
(
nsize
*
0.
02
);
int
nMemSize
=
(
int
)
(
nsize
*
0.
1
);
nMemSize
+=
nsize
;
vec_
=
AllocatorType
::
realloc
(
vec_
,
size_
,
nMemSize
);
...
...
@@ -267,6 +267,7 @@ namespace Dune {
{
int
len
=
size_
;
xdr_int
(
xdrs
,
&
len
);
//std::cout << len << " len|size "<< size_ << "\n";
assert
(
size_
<=
len
);
xdr_vector
(
xdrs
,(
char
*
)
vec_
,
size_
,
sizeof
(
T
)
,(
xdrproc_t
)
xdr_double
);
...
...
@@ -502,6 +503,8 @@ namespace Dune {
typedef
LocalInterface
<
typename
GridType
::
template
codim
<
0
>
::
Entity
>
LocalIndexSetObjectsType
;
mutable
LocalIndexSetObjectsType
indexSets_
;
int
maxIndex_
;
public:
template
<
class
MapperType
,
class
DofStorageType
>
struct
Traits
...
...
@@ -510,7 +513,7 @@ namespace Dune {
};
//! Constructor
DofManager
(
const
GridType
&
grid
)
:
grid_
(
grid
)
{}
DofManager
(
const
GridType
&
grid
)
:
grid_
(
grid
)
,
maxIndex_
(
0
)
{}
//! Desctructor, removes all MemObjects and IndexSetObjects
~
DofManager
()
...
...
@@ -649,9 +652,30 @@ namespace Dune {
ListIteratorType
it
=
memList_
.
begin
();
ListIteratorType
endit
=
memList_
.
end
();
maxIndex_
=
0
;
for
(
;
it
!=
endit
;
++
it
)
{
(
*
it
)
->
realloc
(
(
*
it
)
->
size
()
+
(
*
it
)
->
additionalSizeEstimate
()
);
maxIndex_
=
std
::
max
(
(
*
it
)
->
size
()
,
maxIndex_
);
}
}
void
resizeChunk
(
int
index
,
int
chunkSize
)
{
//std::cout << "index = " << index << " |m=" << maxIndex_ << "\n";
if
(
index
>=
maxIndex_
)
{
ListIteratorType
it
=
memList_
.
begin
();
ListIteratorType
endit
=
memList_
.
end
();
maxIndex_
=
0
;
for
(
;
it
!=
endit
;
++
it
)
{
(
*
it
)
->
realloc
(
(
*
it
)
->
size
()
+
chunkSize
);
//std::cout << "Resized with new size = " << (*it)->size() << "\n";
maxIndex_
=
std
::
max
(
(
*
it
)
->
size
()
,
maxIndex_
);
//std::cout << "index = " << index << " |m=" << maxIndex_ << "\n";
}
}
}
...
...
@@ -660,9 +684,11 @@ namespace Dune {
ListIteratorType
it
=
memList_
.
begin
();
ListIteratorType
endit
=
memList_
.
end
();
maxIndex_
=
0
;
for
(
;
it
!=
endit
;
++
it
)
{
(
*
it
)
->
realloc
(
(
*
it
)
->
size
()
+
nsize
);
maxIndex_
=
std
::
max
(
(
*
it
)
->
size
()
,
maxIndex_
);
}
}
...
...
@@ -684,10 +710,12 @@ namespace Dune {
ListIteratorType
it
=
memList_
.
begin
();
ListIteratorType
endit
=
memList_
.
end
();
maxIndex_
=
0
;
for
(
;
it
!=
endit
;
++
it
)
{
int
nSize
=
(
*
it
)
->
newSize
();
(
*
it
)
->
realloc
(
nSize
);
maxIndex_
=
std
::
max
(
(
*
it
)
->
size
()
,
maxIndex_
);
}
}
...
...
@@ -709,11 +737,13 @@ namespace Dune {
ListIteratorType
it
=
memList_
.
begin
();
ListIteratorType
endit
=
memList_
.
end
();
maxIndex_
=
0
;
for
(
;
it
!=
endit
;
++
it
)
{
// if correponding index was not compressed yet, yhis is called in
// the MemObject dofCompress, if index has not changes, nothing happens
(
*
it
)
->
dofCompress
()
;
maxIndex_
=
std
::
max
(
(
*
it
)
->
size
()
,
maxIndex_
);
}
}
...
...
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