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
Snippets
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
Özgür Ozan Sen
ogs
Commits
cb4c507c
Commit
cb4c507c
authored
8 years ago
by
Norihiro Watanabe
Browse files
Options
Downloads
Patches
Plain Diff
[Mesh] check IDs of nonlinear nodes
parent
4086a353
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
MeshLib/Mesh.cpp
+25
-0
25 additions, 0 deletions
MeshLib/Mesh.cpp
MeshLib/Mesh.h
+3
-0
3 additions, 0 deletions
MeshLib/Mesh.h
with
28 additions
and
0 deletions
MeshLib/Mesh.cpp
+
25
−
0
View file @
cb4c507c
...
...
@@ -42,6 +42,8 @@ Mesh::Mesh(const std::string &name,
assert
(
n_base_nodes
<=
nodes
.
size
());
this
->
resetNodeIDs
();
this
->
resetElementIDs
();
if
(
isNonlinear
())
this
->
checkNonlinearNodeIDs
();
this
->
setDimension
();
this
->
setElementsConnectedToNodes
();
//this->setNodesConnectedByEdges();
...
...
@@ -253,6 +255,29 @@ void Mesh::setNodesConnectedByElements()
}
}
void
Mesh
::
checkNonlinearNodeIDs
()
const
{
for
(
MeshLib
::
Element
const
*
e
:
_elements
)
{
for
(
unsigned
i
=
0
;
i
<
e
->
getNumberOfBaseNodes
();
i
++
)
{
if
(
!
(
e
->
getNodeIndex
(
i
)
<
getNumberOfBaseNodes
()))
OGS_FATAL
(
"Node %d is a base/linear node, but the ID is not smaller "
"than the number of base nodes %d. Please renumber node IDs in the mesh."
,
e
->
getNodeIndex
(
i
),
getNumberOfBaseNodes
());
}
for
(
unsigned
i
=
e
->
getNumberOfBaseNodes
();
i
<
e
->
getNumberOfNodes
();
i
++
)
{
if
(
!
(
e
->
getNodeIndex
(
i
)
>=
getNumberOfBaseNodes
()))
OGS_FATAL
(
"Node %d is a non-linear node, but the ID is smaller "
"than the number of base nodes %d. Please renumber node IDs in the mesh."
,
e
->
getNodeIndex
(
i
),
getNumberOfBaseNodes
());
}
}
}
void
scaleMeshPropertyVector
(
MeshLib
::
Mesh
&
mesh
,
std
::
string
const
&
property_name
,
double
factor
)
...
...
This diff is collapsed.
Click to expand it.
MeshLib/Mesh.h
+
3
−
0
View file @
cb4c507c
...
...
@@ -162,6 +162,9 @@ protected:
/// connected if they are shared by an element.
void
setNodesConnectedByElements
();
/// Check if all the nonlinear nodes are stored at the end of the node vector
void
checkNonlinearNodeIDs
()
const
;
std
::
size_t
const
_id
;
unsigned
_mesh_dimension
;
/// The minimal and maximal edge length over all elements in the mesh
...
...
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