Comments (3)
*proposed
On Thu, Aug 13, 2015 at 1:02 PM, Another Minion [email protected]
wrote:
I believe the apf::getElementNumbers should return the integer. Right now
this function is just a wrapper over numbering->getData()->getElementData
used as some template wizardry.getElementData takes a NewArray and will dynamically resize it, then
returns the new size of the array. Now NewArray has no internal
representation of size, so this return is very necessary to keep track of
the size of the array. Right now the apf::getElementNumbers black boxes the
new size and there is no way to tell the new size if reallocation occurs.This is the purposed change:
diff --git a/apf/apfNumbering.cc b/apf/apfNumbering.cc
index cd39870..538943c 100644
--- a/apf/apfNumbering.cc
+++ b/apf/apfNumbering.cc
@@ -180,9 +180,9 @@ int countComponents(Numbering* n)
return n->countComponents();
}-void getElementNumbers(Numbering* n, MeshEntity* e, NewArray& numbers)
+int getElementNumbers(Numbering* n, MeshEntity* e, NewArray& numbers)
{
- n->getData()->getElementData(e,numbers);
- return n->getData()->getElementData(e,numbers);
}int countFixed(Numbering* n)
diff --git a/apf/apfNumbering.h b/apf/apfNumbering.h
index 9a9a016..909c417 100644
--- a/apf/apfNumbering.h
+++ b/apf/apfNumbering.h
@@ -81,7 +81,7 @@ int countComponents(Numbering* n);
/** \brief returns the node numbers of an element \details numbers are returned in the standard element node ordering for its shape functions /
-void getElementNumbers(Numbering n, MeshEntity* e, NewArray& numbers);
+int getElementNumbers(Numbering* n, MeshEntity* e, NewArray& numbers);/** \brief return the number of fixed degrees of freedom /
int countFixed(Numbering n);—
Reply to this email directly or view it on GitHub
#11.
Dr. Daniel W. Zaide (偉明),
Researcher, Rensselaer Polytechnic Institute
B.A.Sc. University of Toronto (2007)
M.S.E, M.S. Ph.D., University of Michigan (2009,2011,2012)
www.danielzaide.com http://www.danielzaide.com
from core.
Chances are, if you are asking for the numbers, you already know how many
you should get,
returning an int telling you that seems superfluous, IMO.
(Maybe an unsigned const would be preferred).
What is your use of it in this case?
On Thu, Aug 13, 2015 at 1:22 PM, Daniel Zaide [email protected] wrote:
*proposed
On Thu, Aug 13, 2015 at 1:02 PM, Another Minion [email protected]
wrote:I believe the apf::getElementNumbers should return the integer. Right now
this function is just a wrapper over numbering->getData()->getElementData
used as some template wizardry.getElementData takes a NewArray and will dynamically resize it, then
returns the new size of the array. Now NewArray has no internal
representation of size, so this return is very necessary to keep track of
the size of the array. Right now the apf::getElementNumbers black boxes the
new size and there is no way to tell the new size if reallocation occurs.This is the purposed change:
diff --git a/apf/apfNumbering.cc b/apf/apfNumbering.cc
index cd39870..538943c 100644
--- a/apf/apfNumbering.cc
+++ b/apf/apfNumbering.cc
@@ -180,9 +180,9 @@ int countComponents(Numbering* n)
return n->countComponents();
}-void getElementNumbers(Numbering* n, MeshEntity* e, NewArray& numbers)
+int getElementNumbers(Numbering* n, MeshEntity* e, NewArray& numbers)
{
- n->getData()->getElementData(e,numbers);
- return n->getData()->getElementData(e,numbers);
}int countFixed(Numbering* n)
diff --git a/apf/apfNumbering.h b/apf/apfNumbering.h
index 9a9a016..909c417 100644
--- a/apf/apfNumbering.h
+++ b/apf/apfNumbering.h
@@ -81,7 +81,7 @@ int countComponents(Numbering* n);
/** \brief returns the node numbers of an element \details numbers are returned in the standard element node ordering for its shape functions /
-void getElementNumbers(Numbering n, MeshEntity* e, NewArray& numbers);
+int getElementNumbers(Numbering* n, MeshEntity* e, NewArray& numbers);/** \brief return the number of fixed degrees of freedom /
int countFixed(Numbering n);—
Reply to this email directly or view it on GitHub
#11.Dr. Daniel W. Zaide (偉明),
Researcher, Rensselaer Polytechnic Institute
B.A.Sc. University of Toronto (2007)
M.S.E, M.S. Ph.D., University of Michigan (2009,2011,2012)
www.danielzaide.com http://www.danielzaide.com
Dr. Daniel W. Zaide (偉明),
Researcher, Rensselaer Polytechnic Institute
B.A.Sc. University of Toronto (2007)
M.S.E, M.S. Ph.D., University of Michigan (2009,2011,2012)
www.danielzaide.com http://www.danielzaide.com
from core.
eh, this is actually consistent with the behavior of that function for global numberings.
I was just slow to respond due to commuting
from core.
Related Issues (20)
- Build fails with PHASTA code HOT 16
- Compilation issues on Ubuntu 22.04 HOT 9
- Steady increase in memory use when running createMdsMesh HOT 1
- ctest failures on rhel9 system
- compiling with `fatal error: mpi.h: No such file or directory` HOT 1
- Memory leaks in capstone tests
- PUMI 2.2.9 Release
- CreateMG and Python support interfere with each other HOT 2
- Build fails on non-Linux systems: error: variable has incomplete type 'struct mallinfo' HOT 4
- 3 tests fail HOT 2
- gmsh.cc: add test that passes an input .dmg model HOT 2
- Wrong vertex classification on a partitioned mesh starting from a gmsh generated mesh HOT 6
- use netcdf find_package via pkg-config
- Expecting one or two elements per part from split and zsplit HOT 2
- api for evaluation of fields in element HOT 1
- installation fails if `-DMESHES` isn't set
- ctest failures with simmodsuite 2024.1-240606dev HOT 4
- add capstone builds to self-hosted CI/CD
- GeomSim `.SMD` creation utility for meshes classified on a parasolid model HOT 1
- getElementNodeData assumes scalar field HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.