Lvarray documentation & understanding
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 287
- Forks
- 109
- Avg merge
- 4d 41m
- Merged PRs (30d)
- 5
Description
What needs to be documented?
Lvarray Array, ArrayView, and ArraySlice
What sort of documentation would help?
DeveloperGuide
What are the deficiencies of the existing documentation?
More detailed examples are suggested.
Additional notes or context
I encountered certain difficulties understanding the use of the Lvarray library in GEOSX. More specifically, I refer to the following:
https://lvarray.readthedocs.io/en/latest/Array.html#lambda-capture-and-lvarray-arrayview
https://lvarray.readthedocs.io/en/latest/Array.html#arrayslice
The examples provided in the documentation do not help me interpret:
-
The functionality of ArrayView/ArraySlice (e.g, given a 2D/ 3D array using Lvarray Aarray, what ArrayView/ArraySlice does to that given array?). The examples provided in the documentation do not give a specific array (i.e., numerical data, generated from a normal distribution just for illustration purposes) and "point out" what ArrayView/ArraySlice alters it.
-
More explicit reasoning to define ArrayView/ArraySlice? Since I saw several uses of them in GEOSX, e.g., in the file BrooksCoreyRelativePermeability.hpp:
BrooksCoreyRelativePermeabilityUpdate( arrayView1d< real64 const > const & phaseMinVolumeFraction,
arrayView1d< real64 const > const & phaseRelPermExponent,
arrayView1d< real64 const > const & phaseRelPermMaxValue,
real64 const volFracScale,
arrayView1d< integer const > const & phaseTypes,
arrayView1d< integer const > const & phaseOrder,
arrayView3d< real64, relperm::USD_RELPERM > const & phaseRelPerm,
arrayView4d< real64, relperm::USD_RELPERM_DS > const & dPhaseRelPerm_dPhaseVolFrac,
arrayView3d< real64, relperm::USD_RELPERM > const & phaseTrappedVolFrac )
: RelativePermeabilityBaseUpdate( phaseTypes,
phaseOrder,
phaseRelPerm,
dPhaseRelPerm_dPhaseVolFrac,
phaseTrappedVolFrac ),
m_phaseMinVolumeFraction( phaseMinVolumeFraction ),
m_phaseRelPermExponent( phaseRelPermExponent ),
m_phaseRelPermMaxValue( phaseRelPermMaxValue ),
m_volFracScale( volFracScale )
{}
void compute( arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const & phaseVolFraction,
arraySlice1d< real64, relperm::USD_RELPERM - 2 > const & phaseTrappedVolFrac,
arraySlice1d< real64, relperm::USD_RELPERM - 2 > const & phaseRelPerm,
arraySlice2d< real64, relperm::USD_RELPERM_DS - 2 > const & dPhaseRelPerm_dPhaseVolFrac ) const;
I could interpret the meaning of the variables used in this snippet, but I could not interpret the reasoning behind the use of arrayView1d, arrayView3d, arraySlice1d, arraySlice2d, etc. The documentation does not refer to/explain anything relevant to this point.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Lvarray Array documentation sections on lambda capture, ArrayView, and ArraySlice, then compare their explanations with the usage shown in BrooksCoreyRelativePermeability.hpp. Update the DeveloperGuide with concrete 2D and 3D array examples that show what views and slices expose or alter, and explain why the arrayView and arraySlice types are used. Done means the examples and reasoning address the listed questions without requiring readers to infer behavior from GEOSX code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100