Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
105473b0
Commit
105473b0
authored
15 years ago
by
Samuel Melchior
Browse files
Options
Downloads
Patches
Plain Diff
code for applying sparse projection
parent
890b478f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Solver/dgDofContainer.cpp
+26
-20
26 additions, 20 deletions
Solver/dgDofContainer.cpp
with
26 additions
and
20 deletions
Solver/dgDofContainer.cpp
+
26
−
20
View file @
105473b0
...
@@ -309,35 +309,41 @@ void dgDofContainer::Mesh2Mesh_BuildL2Projection(linearSystemCSRGmm<double> &pro
...
@@ -309,35 +309,41 @@ void dgDofContainer::Mesh2Mesh_BuildL2Projection(linearSystemCSRGmm<double> &pro
void
dgDofContainer
::
Mesh2Mesh_ApplyL2Projection
(
linearSystemCSRGmm
<
double
>
&
projector
,
dgDofContainer
&
donor
){
void
dgDofContainer
::
Mesh2Mesh_ApplyL2Projection
(
linearSystemCSRGmm
<
double
>
&
projector
,
dgDofContainer
&
donor
){
scale
(
0.
);
scale
(
0.
);
dgGroupCollection
*
dGroups
=
donor
.
getGroups
();
dgGroupCollection
*
rGroups
=
this
->
getGroups
();
std
::
vector
<
int
>
dGroupsStartIGlobal
(
dGroups
->
getNbElementGroups
()
+
1
);
int
iGlobal
=
0
;
// indices in global container
dGroupsStartIGlobal
[
0
]
=
0
;
for
(
int
i
=
1
;
i
<
dGroupsStartIGlobal
.
size
();
i
++
)
dGroupsStartIGlobal
[
i
]
=
dGroupsStartIGlobal
[
i
-
1
]
+
dGroups
->
getElementGroup
(
i
-
1
)
->
getNbElements
()
*
dGroups
->
getElementGroup
(
i
-
1
)
->
getNbNodes
();
int
*
startIndex
;
int
*
startIndex
;
int
*
columns
;
int
*
columns
;
double
*
values
;
double
*
values
;
projector
.
getMatrix
(
startIndex
,
columns
,
values
);
projector
.
getMatrix
(
startIndex
,
columns
,
values
);
/*nt nbCoarseNodes = 0; // OLD CODE
int nbCoarseElements = 0;
int
nbFields
=
0
;
// TO DEFINE !!!
int r = 0;
for (int kFine = 0;kFine < fineGroups.getNbElementGroups();kFine++) {
for
(
int
iGroup
=
0
;
iGroup
<
rGroups
->
getNbElementGroups
();
iGroup
++
)
{
// for 2d.groups
int nbFineNodes = fineGroups.getElementGroup(kFine)->getNbNodes();
const
dgGroupOfElements
&
rGroup
=
*
rGroups
->
getElementGroup
(
iGroup
);
fineSol.getGroupProxy(kFine).scale(0);
this
->
getGroupProxy
(
iGroup
).
scale
(
0
);
for (int fineElement = 0 ; fineElement<fineGroups.getElementGroup(kFine)->getNbElements() ;++fineElement) {
for
(
int
iElement
=
0
;
iElement
<
rGroup
.
getNbElements
()
;
++
iElement
)
{
// for elements
for (int fineNodes = 0 ; fineNodes<nbFineNodes ;++fineNodes) {
for
(
int
iNode
=
0
;
iNode
<
rGroup
.
getNbNodes
()
;
++
iNode
)
{
int kCoarse = 0;
int
jGroup
=
0
;
int c0 = 0;
for
(
int
i
=
startIndex
[
iGlobal
++
];
i
<
startIndex
[
iGlobal
]
-
1
;
i
++
){
for (int i = startIndex[r++]; i < startIndex[r] - 1; i++){
int
jGlobal
=
columns
[
i
];
int c = columns[i];
for
(;
jGlobal
<
dGroupsStartIGlobal
[
jGroup
+
1
];
jGroup
++
)
{
for (;c-c0 < nbCoarseNodes*nbCoarseElements;kCoarse++) {
c0 += nbCoarseNodes*nbCoarseElements;
nbCoarseNodes = coarseGroups.getElementGroup(kCoarse)->getNbNodes();
nbCoarseElements = coarseGroups.getElementGroup(kCoarse)->getNbElements();
}
}
int
coarse
Element = (
c-c0)/nbCoarse
Nodes;
int
j
Element
=
(
jGlobal
-
dGroupsStartIGlobal
[
jGroup
])
/
dGroups
->
getElementGroup
(
jGroup
)
->
getNb
Nodes
()
;
int
coarse
Node
s
=
c-c0-nbCoarseNodes*coarseElement
;
int
j
Node
=
jGlobal
-
dGroupsStartIGlobal
[
jGroup
]
-
jElement
*
dGroups
->
getElementGroup
(
jGroup
)
->
getNbNodes
()
;
for
(
int
m
=
0
;
m
<
nbFields
;
m
++
){
for
(
int
m
=
0
;
m
<
nbFields
;
m
++
){
(
fineSol.
getGroupProxy(
kFine))(fineNodes,fine
Element*nbFields+m) += values[i]*(
coarseSol
.getGroupProxy(
kCoarse))(coarseNodes,coarse
Element*nbFields+m);
(
this
->
getGroupProxy
(
iGroup
))(
iNode
,
i
Element
*
nbFields
+
m
)
+=
values
[
i
]
*
(
donor
.
getGroupProxy
(
jGroup
))(
jNode
,
j
Element
*
nbFields
+
m
);
}
}
}
}
}
}
}*/
}
//*/
}
}
}
void
dgDofContainer
::
exportGroupIdMsh
(){
void
dgDofContainer
::
exportGroupIdMsh
(){
...
...
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