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
240d8064
Commit
240d8064
authored
15 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
1884a693
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Solver/dgAlgorithm.cpp
+59
-0
59 additions, 0 deletions
Solver/dgAlgorithm.cpp
Solver/dgConservationLaw.h
+2
-2
2 additions, 2 deletions
Solver/dgConservationLaw.h
Solver/dgGroupOfElements.h
+25
-0
25 additions, 0 deletions
Solver/dgGroupOfElements.h
with
86 additions
and
2 deletions
Solver/dgAlgorithm.cpp
0 → 100644
+
59
−
0
View file @
240d8064
#include
"dgAlgorithm.h"
/*
compute
\int \vec{f} \cdot \grad \phi dv
*/
void
dgAlgorithm
::
residualVolume
(
dofManager
&
dof
,
// the DOF manager (maybe useless here)
const
dgConservationLaw
&
claw
,
// the conservation law
const
groupOfElements
&
group
)
// the residual
{
// get the solution at quadrature points
fullMatrix
<
double
>
solutionQp
(
group
.
getNbElements
()
*
group
.
getNbFields
(),
group
.
getNbIntegrationPoints
());
// solutionQp ( NbE x NbFields , NbQuad)
// collocation ( NbNod , NbQuad)
// solution ( NbE x NbFields, nbNodes)
group
.
getSolution
().
mult
(
group
.
getCollocationMatrix
()
,
solutionQp
);
// for all elements of the group,
// compute all fluxes, both diffusive and convective, in reference coordinates
fullMatrix
<
double
>
fConv
[
3
]
=
{
fullMatrix
<
double
>
(
group
.
getNbIntegrationPoints
(),
group
.
nbFields
()
),
fullMatrix
<
double
>
(
group
.
getNbIntegrationPoints
(),
group
.
nbFields
()
),
fullMatrix
<
double
>
(
group
.
getNbIntegrationPoints
(),
group
.
nbFields
()
)};
fullMatrix
<
double
>
fDiff
[
3
]
=
{
fullMatrix
<
double
>
(
group
.
getNbIntegrationPoints
(),
group
.
nbFields
()
),
fullMatrix
<
double
>
(
group
.
getNbIntegrationPoints
(),
group
.
nbFields
()
),
fullMatrix
<
double
>
(
group
.
getNbIntegrationPoints
(),
group
.
nbFields
()
)};
fullMatrix
<
double
>
Fuvw
[
3
]
=
{
fullMatrix
<
double
>
(
group
.
getNbElements
()
*
group
.
getNbFields
(),
group
.
getNbIntegrationPoints
()),
fullMatrix
<
double
>
(
group
.
getNbElements
()
*
group
.
getNbFields
(),
group
.
getNbIntegrationPoints
()),
fullMatrix
<
double
>
(
group
.
getNbElements
()
*
group
.
getNbFields
(),
group
.
getNbIntegrationPoints
())};
// for all elements of the group
for
(
int
iElement
=
0
;
iElement
<
group
.
getNbElements
()
;
++
iElement
)
{
dgElement
DGE
=
group
.
getDGElement
(
iElement
);
// compute convective and diffusive fluxes in XYZ coordinates
if
(
claw
.
convectiveFlux
())
(
*
claw
.
convectiveFlux
())(
DGE
,
fConv
);
if
(
claw
.
diffusiveFlux
())
(
*
claw
.
diffusiveFlux
())(
DGE
,
fDiff
);
for
(
int
iUVW
=
0
;
iUVW
<
group
.
getDimUVW
();
iUVW
++
)
{
// proxies should be done...
fullMatrix
<
double
>
fuvwe
=
Fuvw
[
iUVW
].
linesProxy
(
iElement
);
for
(
int
iXYZ
=
0
;
iXYZ
<
group
.
getDimXYZ
();
iXYZ
++
)
{
for
(
int
iPt
=
0
;
iPt
<
group
.
getNbIntegrationPoints
();
iPt
++
)
{
// get the right inv jacobian matrix dU/dX element
const
double
invJ
=
group
.
getInvJ
(
iElement
,
iPt
,
iXYZ
,
iUVW
);
// get the detJ at this point
const
double
detJ
=
group
.
getDetJ
(
iElement
,
iPt
);
const
double
factor
=
invJ
*
detJ
;
// compute fluxes in the reference coordinate system at this integration point
for
(
int
k
=
0
;
k
<
group
.
nbFields
();
k
++
)
{
fuvwe
(
i
,
k
)
+=
(
fConv
[
iXYZ
](
i
,
k
)
+
fDiff
[
iXYZ
](
i
,
k
))
*
factor
;
}
}
}
}
}
// finally, premultiply with the redistribution matrices
// this is the "heavy load" part
for
(
int
iUVW
=
0
;
iUVW
<
group
.
getDimUVW
();
iUVW
++
)
group
.
getResidual
().
dgemm
(
group
.
getCollocationMatrix
(
iUVW
),
Fuvw
[
iUVW
]);
}
This diff is collapsed.
Click to expand it.
Solver/dgConservationLaw.h
+
2
−
2
View file @
240d8064
...
...
@@ -13,13 +13,13 @@ class dgFace;
class
dgTerm
{
public:
virtual
~
dgTerm
()
{}
virtual
void
operator
()
(
const
dgElement
&
,
fullMatrix
<
double
>
&
fcx
)
const
=
0
;
virtual
void
operator
()
(
const
dgElement
&
,
fullMatrix
<
double
>
fcx
[]
)
const
=
0
;
};
class
dgFaceTerm
{
public:
virtual
~
dgFaceTerm
()
{}
virtual
void
operator
()
(
const
dgFace
&
,
fullMatrix
<
double
>
&
fcx
)
const
=
0
;
virtual
void
operator
()
(
const
dgFace
&
,
fullMatrix
<
double
>
fcx
[]
)
const
=
0
;
};
class
dgConservationLaw
{
...
...
This diff is collapsed.
Click to expand it.
Solver/dgGroupOfElements.h
+
25
−
0
View file @
240d8064
...
...
@@ -18,6 +18,13 @@ class MFace;
class
MEdge
;
class
functionSpace
;
class
dgElement
{
MElement
*
_element
;
double
*
_detJ
;
public:
dgElement
(
MElement
*
e
,
double
*
detJ
);
};
class
dgGroupOfElements
{
// N elements in the group
std
::
vector
<
MElement
*>
_elements
;
...
...
@@ -37,12 +44,30 @@ class dgGroupOfElements {
fullMatrix
<
double
>
*
_redistributionFluxes
[
3
];
// redistribution for the source term
fullMatrix
<
double
>
*
_redistributionSource
;
// the solution for this group (not owned)
fullMatrix
<
double
>
*
_solution
;
// the residual for this group (not owned)
fullMatrix
<
double
>
*
_residual
;
// dimension of the parametric space and of the real space
// may be different if the domain is a surface in 3D (manifold)
int
dimUVW
,
dimXYZ
;
// forbid the copy
// dgGroupOfElements (const dgGroupOfElements &e, int order) {}
// dgGroupOfElements & operator = (const dgGroupOfElements &e) {}
public:
dgGroupOfElements
(
const
std
::
vector
<
MElement
*>
&
e
,
int
);
virtual
~
dgGroupOfElements
();
inline
dgElement
getDGElement
(
int
i
)
const
;
inline
int
getNbElements
()
const
{
return
_elements
.
size
();}
inline
int
getNbNodes
()
const
{
return
_collocation
.
size1
();}
inline
int
getNbIntegrationPoints
()
const
{
return
_collocation
.
size2
();}
inline
int
getDimUVW
()
const
{
return
dimUVW
;}
inline
int
getDimXYZ
()
const
{
return
dimXYZ
;}
inline
const
fullMatrix
<
double
>
&
getCollocationMatrix
()
const
{
return
*
_collocation
;}
inline
const
fullMatrix
<
double
>
&
getRedistributionMatrix
(
int
i
)
const
{
return
*
_redistribution
[
i
];}
inline
const
fullMatrix
<
double
>
&
getSolution
()
const
{
return
*
_solution
;}
inline
const
fullMatrix
<
double
>
&
getResidual
()
const
{
return
*
_solution
;}
inline
double
getDetJ
(
int
iElement
,
int
iGaussPoint
)
};
/*class dgFace {
...
...
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