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
986badb5
Commit
986badb5
authored
15 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
clipping for emilie
parent
5112c3bc
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Solver/dgConservationLawPerfectGas.cpp
+12
-9
12 additions, 9 deletions
Solver/dgConservationLawPerfectGas.cpp
Solver/dgSlopeLimiter.cpp
+17
-18
17 additions, 18 deletions
Solver/dgSlopeLimiter.cpp
with
29 additions
and
27 deletions
Solver/dgConservationLawPerfectGas.cpp
+
12
−
9
View file @
986badb5
...
@@ -443,26 +443,29 @@ public:
...
@@ -443,26 +443,29 @@ public:
class
dgPerfectGasLaw2d
::
clipToPhysics
:
public
dataCacheDouble
{
class
dgPerfectGasLaw2d
::
clipToPhysics
:
public
dataCacheDouble
{
dataCacheDouble
&
sol
;
dataCacheDouble
&
sol
;
double
_presMin
,
_rhoMin
;
public:
public:
clipToPhysics
(
dataCacheMap
&
cacheMap
)
:
clipToPhysics
(
dataCacheMap
&
cacheMap
,
double
presMin
,
double
rhoMin
)
:
sol
(
cacheMap
.
get
(
"Solution"
,
this
))
sol
(
cacheMap
.
get
(
"Solution"
,
this
))
{};
{
_presMin
=
presMin
;
_rhoMin
=
rhoMin
;
_value
=
fullMatrix
<
double
>
(
cacheMap
.
getNbEvaluationPoints
(),
4
);
};
void
_eval
()
{
void
_eval
()
{
double
rhomin
=
1.e-3
;
double
presmin
=
1.e-3
;
const
int
nQP
=
sol
().
size1
();
const
int
nQP
=
sol
().
size1
();
for
(
size_t
k
=
0
;
k
<
nQP
;
k
++
){
for
(
size_t
k
=
0
;
k
<
nQP
;
k
++
){
_value
(
k
,
0
)
=
sol
(
k
,
0
);
_value
(
k
,
0
)
=
sol
(
k
,
0
);
_value
(
k
,
1
)
=
sol
(
k
,
1
);
_value
(
k
,
1
)
=
sol
(
k
,
1
);
_value
(
k
,
2
)
=
sol
(
k
,
1
);
_value
(
k
,
2
)
=
sol
(
k
,
1
);
_value
(
k
,
3
)
=
sol
(
k
,
3
);
_value
(
k
,
3
)
=
sol
(
k
,
3
);
if
(
sol
(
k
,
0
)
<
rho
m
in
)
if
(
sol
(
k
,
0
)
<
_
rho
M
in
)
_value
(
k
,
0
)
=
rho
m
in
;
_value
(
k
,
0
)
=
_
rho
M
in
;
double
rhoV2
=
sol
(
k
,
1
)
*
sol
(
k
,
1
)
+
sol
(
k
,
2
)
*
sol
(
k
,
2
);
double
rhoV2
=
sol
(
k
,
1
)
*
sol
(
k
,
1
)
+
sol
(
k
,
2
)
*
sol
(
k
,
2
);
rhoV2
/=
sol
(
k
,
0
);
rhoV2
/=
sol
(
k
,
0
);
const
double
p
=
(
GAMMA
-
1
)
*
(
sol
(
k
,
3
)
-
0.5
*
rhoV2
);
const
double
p
=
(
GAMMA
-
1
)
*
(
sol
(
k
,
3
)
-
0.5
*
rhoV2
);
if
(
p
<
pres
m
in
)
if
(
p
<
_
pres
M
in
)
_value
(
k
,
3
)
=
pres
m
in
/
(
GAMMA
-
1
)
+
0.5
*
rhoV2
;
_value
(
k
,
3
)
=
_
pres
M
in
/
(
GAMMA
-
1
)
+
0.5
*
rhoV2
;
}
}
}
}
};
};
...
@@ -634,7 +637,7 @@ dataCacheDouble *dgPerfectGasLaw2d::newSourceTerm (dataCacheMap &cacheMap) const
...
@@ -634,7 +637,7 @@ dataCacheDouble *dgPerfectGasLaw2d::newSourceTerm (dataCacheMap &cacheMap) const
return
new
source
(
cacheMap
,
_sourceFunctionName
);
return
new
source
(
cacheMap
,
_sourceFunctionName
);
}
}
dataCacheDouble
*
dgPerfectGasLaw2d
::
newClipToPhysics
(
dataCacheMap
&
cacheMap
)
const
{
dataCacheDouble
*
dgPerfectGasLaw2d
::
newClipToPhysics
(
dataCacheMap
&
cacheMap
)
const
{
return
new
clipToPhysics
(
cacheMap
);
return
new
clipToPhysics
(
cacheMap
,
1e-3
,
1e-3
);
}
}
dgPerfectGasLaw2d
::
dgPerfectGasLaw2d
()
dgPerfectGasLaw2d
::
dgPerfectGasLaw2d
()
...
...
This diff is collapsed.
Click to expand it.
Solver/dgSlopeLimiter.cpp
+
17
−
18
View file @
986badb5
...
@@ -92,26 +92,25 @@ bool dgSlopeLimiter::apply ( dgDofContainer &solution,
...
@@ -92,26 +92,25 @@ bool dgSlopeLimiter::apply ( dgDofContainer &solution,
}
}
}
}
/*
// --- CLIPPING: check unphysical values
// --- CLIPPING: check unphysical values
// fullMatrix<double> solutionQP (group->getNbIntegrationPoints(),group->getNbElements() * nbFields);
dataCacheMap cacheMap(group->getNbNodes());
// group->getCollocationMatrix().mult(solleft, solutionQP);
dgGroupOfElements* group = eGroups[0];
// //dataCacheDouble &solutionQPe = cacheMap.provideData("Solution");
fullMatrix<double> &solGroup = solution.getGroupProxy(0);
// //solutionQPe.set(fullMatrix<double>(group.getNbIntegrationPoints(),nbFields));
dataCacheDouble &solutionE = cacheMap.provideData("Solution");
// //dataCacheElement &cacheElement = cacheMap.getElement();
solutionE.set(fullMatrix<double>(group.getNbNodes(),nbFields));
// dataCacheMap cacheMap(group->getNbIntegrationPoints());
dataCacheElement &cacheElement = cacheMap.getElement();
// dataCacheDouble *clipping = _claw->newClipToPhysics(cacheMap);
dataCacheDouble *solutionEClipped = _claw->newClipToPhysics(cacheMap);
// fullMatrix<double> clippedSol;
for (int iElement=0 ; iElement<group->getNbElements() ;++iElement) {
// for (int iElement=0 ; iElement<group->getNbElements() ;++iElement) {
cacheElement.set(group.getElement(iElement));
// clippedSol.setAsProxy(solutionQP, iElement*nbFields, nbFields );
solutionE.setAsProxy(solGroup,iElement*nbFields,nbFields);
// for (int iPt =0; iPt< group->getNbIntegrationPoints(); iPt++) {
for (int iPt =0; iPt< group->getNbNodes(); iPt++) {
// for (int k=0;k<nbFields;k++)
solutionE.set((*solutionEclipped)());
// clippedSol(iPt,k) = (*clipping)(iPt,k);
}
// }
}
// //cacheElement.set(group.getElement(iElement));
delete solutionEClipped;
// }
// solleft.gemm(group->getRedistributionMatrix(),solutionQP);
*/
//#if 0
//#if 0
// double rhomin = 1.e-3;
// double rhomin = 1.e-3;
// double presmin= 1.e-3;
// double presmin= 1.e-3;
...
...
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