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
Releases
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
Yuhao Liu
ogs
Commits
96762658
Commit
96762658
authored
12 years ago
by
Karsten Rink
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:ufz/ogs
parents
cb94fea9
32baf93c
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
MeshLib/Elements/Pyramid.h
+5
-107
5 additions, 107 deletions
MeshLib/Elements/Pyramid.h
MeshLib/Elements/TemplatePyramid.h
+123
-0
123 additions, 0 deletions
MeshLib/Elements/TemplatePyramid.h
MeshLib/Elements/TemplatePyramid.hpp
+1
-1
1 addition, 1 deletion
MeshLib/Elements/TemplatePyramid.hpp
with
129 additions
and
108 deletions
MeshLib/Elements/Pyramid.h
+
5
−
107
View file @
96762658
/**
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.
org
)
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.
net
)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* http://www.opengeosys.org/LICENSE.txt
*
* \file Pyramid.h
*
* Created on
2012-05-02 by Karsten Rink
*
Created on
Sep 27, 2012 by Thomas Fischer
*/
#ifndef PYRAMID_H_
#define PYRAMID_H_
#include
"
Cell
.h"
#include
"
TemplatePyramid
.h"
namespace
MeshLib
{
/**
* This class represents a 3d pyramid element. The following sketch shows the node and edge numbering.
* @anchor PyramidNodeAndEdgeNumbering
* @code
*
* 4
* //|\
* // | \
* 7// | \6
* // |5 \
* // | \
* 3/.... |.....2
* ./ | 2 /
* ./4 | /
* 3./ | /1
* ./ | /
* ./ |/
* 0------------1
* 0
* @endcode
*/
template
<
unsigned
ORDER
,
unsigned
NNODES
>
class
TemplatePyramid
:
public
Cell
{
public:
/// Constructor with an array of mesh nodes.
TemplatePyramid
(
Node
*
nodes
[
NNODES
],
unsigned
value
=
0
);
/// Copy constructor
TemplatePyramid
(
const
TemplatePyramid
<
ORDER
,
NNODES
>
&
pyramid
);
/// Destructor
virtual
~
TemplatePyramid
();
/// Returns the face i of the element.
const
Element
*
getFace
(
unsigned
i
)
const
;
/// Get the number of edges for this element.
unsigned
getNEdges
()
const
{
return
8
;
};
/// Get the number of nodes for face i.
unsigned
getNFaceNodes
(
unsigned
i
)
const
;
/// Get the number of faces for this element.
unsigned
getNFaces
()
const
{
return
5
;
};
/// Get the number of neighbors for this element.
unsigned
getNNeighbors
()
const
{
return
5
;
};
/// Get the number of nodes for this element.
virtual
unsigned
getNNodes
(
unsigned
order
=
1
)
const
{
return
order
==
ORDER
?
NNODES
:
5
;
}
/**
* Method returns the type of the element. In this case PYRAMID will be returned.
* @return MshElemType::PYRAMID
*/
virtual
MshElemType
::
type
getType
()
const
{
return
MshElemType
::
PYRAMID
;
}
/// Returns true if these two indeces form an edge and false otherwise
bool
isEdge
(
unsigned
i
,
unsigned
j
)
const
;
/**
* Method clone is inherited from class Element. It makes a deep copy of the
* TemplatePyramid instance employing the copy constructor of class TemplatePyramid.
* @return an exact copy of the object
*/
virtual
Element
*
clone
()
const
;
/**
* This method should be called after at least two nodes of the pyramid
* element are collapsed. As a consequence of the node collapsing an edge
* of the pyramid will be collapsed. If one of the edges 0, 1, 2 or 3 (see
* sketch @ref PyramidNodeAndEdgeNumbering) is collapsed we obtain a
* tetrahedron. In this case the method will create the appropriate
* object of class Tetrahedron.
* @return a Tetrahedron object or NULL
*/
virtual
Element
*
reviseElement
()
const
;
protected
:
/// Calculates the volume of a prism by subdividing it into two tetrahedra.
double
computeVolume
();
/// Return a specific edge node.
inline
Node
*
getEdgeNode
(
unsigned
edge_id
,
unsigned
node_id
)
const
{
return
_nodes
[
_edge_nodes
[
edge_id
][
node_id
]];
};
/// Returns the ID of a face given an array of nodes.
unsigned
identifyFace
(
Node
*
nodes
[
3
])
const
;
static
const
unsigned
_face_nodes
[
5
][
4
];
static
const
unsigned
_edge_nodes
[
8
][
2
];
static
const
unsigned
_n_face_nodes
[
5
];
};
/* class */
typedef
TemplatePyramid
<
1
,
5
>
Pyramid
;
}
/* namespace */
#include
"Pyramid.hpp"
}
#endif
/* PYRAMID_H_ */
This diff is collapsed.
Click to expand it.
MeshLib/Elements/TemplatePyramid.h
0 → 100644
+
123
−
0
View file @
96762658
/**
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*
* \file TemplatePyramid.h
*
* Created on 2012-05-02 by Karsten Rink
*/
#ifndef TEMPLATEPYRAMID_H_
#define TEMPLATEPYRAMID_H_
#include
"Cell.h"
namespace
MeshLib
{
/**
* This class represents a 3d pyramid element. The following sketch shows the node and edge numbering.
* @anchor PyramidNodeAndEdgeNumbering
* @code
*
* 4
* //|\
* // | \
* 7// | \6
* // |5 \
* // | \
* 3/.... |.....2
* ./ | 2 /
* ./4 | /
* 3./ | /1
* ./ | /
* ./ |/
* 0------------1
* 0
* @endcode
*/
template
<
unsigned
ORDER
,
unsigned
NNODES
>
class
TemplatePyramid
:
public
Cell
{
public:
/// Constructor with an array of mesh nodes.
TemplatePyramid
(
Node
*
nodes
[
NNODES
],
unsigned
value
=
0
);
/// Copy constructor
TemplatePyramid
(
const
TemplatePyramid
<
ORDER
,
NNODES
>
&
pyramid
);
/// Destructor
virtual
~
TemplatePyramid
();
/// Returns the face i of the element.
const
Element
*
getFace
(
unsigned
i
)
const
;
/// Get the number of edges for this element.
unsigned
getNEdges
()
const
{
return
8
;
};
/// Get the number of nodes for face i.
unsigned
getNFaceNodes
(
unsigned
i
)
const
;
/// Get the number of faces for this element.
unsigned
getNFaces
()
const
{
return
5
;
};
/// Get the number of neighbors for this element.
unsigned
getNNeighbors
()
const
{
return
5
;
};
/// Get the number of nodes for this element.
virtual
unsigned
getNNodes
(
unsigned
order
=
1
)
const
{
return
order
==
ORDER
?
NNODES
:
5
;
}
/**
* Method returns the type of the element. In this case PYRAMID will be returned.
* @return MshElemType::PYRAMID
*/
virtual
MshElemType
::
type
getType
()
const
{
return
MshElemType
::
PYRAMID
;
}
/// Returns true if these two indeces form an edge and false otherwise
bool
isEdge
(
unsigned
i
,
unsigned
j
)
const
;
/**
* Method clone is inherited from class Element. It makes a deep copy of the
* TemplatePyramid instance employing the copy constructor of class TemplatePyramid.
* @return an exact copy of the object
*/
virtual
Element
*
clone
()
const
;
/**
* This method should be called after at least two nodes of the pyramid
* element are collapsed. As a consequence of the node collapsing an edge
* of the pyramid will be collapsed. If one of the edges 0, 1, 2 or 3 (see
* sketch @ref PyramidNodeAndEdgeNumbering) is collapsed we obtain a
* tetrahedron. In this case the method will create the appropriate
* object of class Tetrahedron.
* @return a Tetrahedron object or NULL
*/
virtual
Element
*
reviseElement
()
const
;
protected
:
/// Calculates the volume of a prism by subdividing it into two tetrahedra.
double
computeVolume
();
/// Return a specific edge node.
inline
Node
*
getEdgeNode
(
unsigned
edge_id
,
unsigned
node_id
)
const
{
return
_nodes
[
_edge_nodes
[
edge_id
][
node_id
]];
};
/// Returns the ID of a face given an array of nodes.
unsigned
identifyFace
(
Node
*
nodes
[
3
])
const
;
static
const
unsigned
_face_nodes
[
5
][
4
];
static
const
unsigned
_edge_nodes
[
8
][
2
];
static
const
unsigned
_n_face_nodes
[
5
];
};
/* class */
}
/* namespace */
#include
"TemplatePyramid.hpp"
#endif
/* TEMPLATEPYRAMID_H_ */
This diff is collapsed.
Click to expand it.
MeshLib/Elements/Pyramid.hpp
→
MeshLib/Elements/
Template
Pyramid.hpp
+
1
−
1
View file @
96762658
...
...
@@ -5,7 +5,7 @@
* http://www.opengeosys.org/project/license
*
*
* \file Pyramid.hpp
* \file
Template
Pyramid.hpp
*
* Created on 2012-05-02 by Karsten Rink
*/
...
...
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