Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Mojtaba Abdolkhani
ogs
Commits
781168dd
Commit
781168dd
authored
8 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[PL] Lower dim gauss pnt to bulk elem pnt mapping.
parent
37cee6ca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ProcessLib/CalculateSurfaceFlux/MapBulkElementPoint.cpp
+99
-0
99 additions, 0 deletions
ProcessLib/CalculateSurfaceFlux/MapBulkElementPoint.cpp
ProcessLib/CalculateSurfaceFlux/MapBulkElementPoint.h
+63
-0
63 additions, 0 deletions
ProcessLib/CalculateSurfaceFlux/MapBulkElementPoint.h
with
162 additions
and
0 deletions
ProcessLib/CalculateSurfaceFlux/MapBulkElementPoint.cpp
0 → 100644
+
99
−
0
View file @
781168dd
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include
<array>
#include
"MapBulkElementPoint.h"
namespace
ProcessLib
{
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Quad
const
&
quad
,
std
::
size_t
const
face_id
,
MathLib
::
WeightedPoint1D
const
&
wp
)
{
switch
(
face_id
)
{
case
0
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
wp
[
0
],
0.0
,
0.0
}}};
case
1
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
1.0
,
wp
[
0
],
0.0
}}};
case
2
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
1.0
-
wp
[
0
],
1.0
,
0.0
}}};
case
3
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
0.0
,
1.0
-
wp
[
0
],
0.0
}}};
default
:
OGS_FATAL
(
"Invalid face id '%u' for the quad."
,
face_id
);
}
}
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Hex
const
&
hex
,
std
::
size_t
const
face_id
,
MathLib
::
WeightedPoint2D
const
&
wp
)
{
switch
(
face_id
)
{
case
0
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
wp
[
1
],
wp
[
0
],
-
1.0
}}};
case
1
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
wp
[
0
],
-
1.0
,
wp
[
1
]}}};
case
2
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
1.0
,
wp
[
0
],
wp
[
1
]}}};
case
3
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
-
wp
[
0
],
-
1.0
,
wp
[
1
]}}};
case
4
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
-
1.0
,
-
wp
[
0
],
-
wp
[
1
]}}};
case
5
:
return
MathLib
::
Point3d
{
std
::
array
<
double
,
3
>
{{
wp
[
0
],
wp
[
1
],
1.0
}}};
default
:
OGS_FATAL
(
"Invalid face id '%u' for the hexahedron."
,
face_id
);
}
}
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Mesh
const
&
mesh
,
std
::
size_t
const
bulk_element_id
,
std
::
size_t
const
bulk_face_id
,
MathLib
::
WeightedPoint1D
const
&
wp
)
{
auto
const
*
element
=
mesh
.
getElement
(
bulk_element_id
);
if
(
element
->
getCellType
()
==
MeshLib
::
CellType
::
QUAD4
)
{
MeshLib
::
Quad
const
&
quad
(
*
dynamic_cast
<
MeshLib
::
Quad
const
*>
(
element
));
return
getBulkElementPoint
(
quad
,
bulk_face_id
,
wp
);
}
OGS_FATAL
(
"Wrong cell type '%s' or functionality not yet implemented."
,
MeshLib
::
CellType2String
(
element
->
getCellType
()).
c_str
());
}
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Mesh
const
&
mesh
,
std
::
size_t
bulk_element_id
,
std
::
size_t
bulk_face_id
,
MathLib
::
WeightedPoint2D
const
&
wp
)
{
auto
const
*
element
=
mesh
.
getElement
(
bulk_element_id
);
if
(
element
->
getCellType
()
==
MeshLib
::
CellType
::
HEX8
)
{
MeshLib
::
Hex
const
&
hex
(
*
dynamic_cast
<
MeshLib
::
Hex
const
*>
(
element
));
return
getBulkElementPoint
(
hex
,
bulk_face_id
,
wp
);
}
OGS_FATAL
(
"Wrong cell type '%s' or functionality not yet implemented."
,
MeshLib
::
CellType2String
(
element
->
getCellType
()).
c_str
());
}
// TODO disable the 3d elements in the local assembler creator
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Mesh
const
&
mesh
,
std
::
size_t
bulk_element_id
,
std
::
size_t
bulk_face_id
,
MathLib
::
WeightedPoint3D
const
&
wp
)
{
return
MathLib
::
ORIGIN
;
}
}
// end namespace ProcessLib
This diff is collapsed.
Click to expand it.
ProcessLib/CalculateSurfaceFlux/MapBulkElementPoint.h
0 → 100644
+
63
−
0
View file @
781168dd
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#ifndef PROCESSLIB_BALANCEPROCESS_MAPBULKELEMENT_H
#define PROCESSLIB_BALANCEPROCESS_MAPBULKELEMENT_H
#include
<array>
#include
"MathLib/TemplateWeightedPoint.h"
#include
"MeshLib/Elements/FaceRule.h"
#include
"MeshLib/Elements/Elements.h"
namespace
ProcessLib
{
/// Maps the given lower dimensional boundary point \c wp of a line, i.e. the 1d
/// gauss point given in local coordinates of a line, to higher dimensional
/// point of the quad face (defined by the quad element and the face id) also in
/// local coordinates of the quad face.
/// \param quad the quad element
/// \param face_id the id of the quad face the point will be mapped on
/// \param wp the gauss point of the lower dimensional element
/// \return the mapped point
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Quad
const
&
quad
,
std
::
size_t
const
face_id
,
MathLib
::
WeightedPoint1D
const
&
wp
);
/// Maps the given 2d boundary point \c wp of a quad face, given in local
/// coordinates of the quad, to 3d point existing on a hexahedron face also in
/// local coordinates.
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Hex
const
&
hex
,
std
::
size_t
const
face_id
,
MathLib
::
WeightedPoint2D
const
&
wp
);
/// Maps the given 1d boundary point \c wp of a boundary element, given in local
/// coordinates of the boundary element, to 3d point existing on a bulk element
/// also in local coordinates.
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Mesh
const
&
mesh
,
std
::
size_t
const
bulk_element_id
,
std
::
size_t
const
bulk_face_id
,
MathLib
::
WeightedPoint1D
const
&
wp
);
/// Maps the given 2d boundary point \c wp of a boundary element, given in local
/// coordinates of the boundary element, to 3d point existing on a bulk element
/// also in local coordinates.
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Mesh
const
&
mesh
,
std
::
size_t
bulk_element_id
,
std
::
size_t
bulk_face_id
,
MathLib
::
WeightedPoint2D
const
&
wp
);
// TODO disable the 3d elements in the local assembler creator
MathLib
::
Point3d
getBulkElementPoint
(
MeshLib
::
Mesh
const
&
mesh
,
std
::
size_t
bulk_element_id
,
std
::
size_t
bulk_face_id
,
MathLib
::
WeightedPoint3D
const
&
wp
);
}
// end namespace ProcessLib
#endif
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