Skip to content

Commit

Permalink
add getter for number of elements
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Aug 7, 2023
1 parent c87191a commit 42ef650
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/neqsim/thermo/atomElement/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ public String[] getElementNames() {
return nameArray;
}

/**
* GetNumberOfElements.
*
* @return NumberOfElements of a given type.
*/
public double getNumberOfElements(String elementName) {
for (int i = 0; i < nameArray.length; i++) {
if (nameArray[i].equals(elementName)) {
return coefArray[i];
}
}
return 0.0;
}

/**
* Getter for property coefArray.
*
Expand Down

0 comments on commit 42ef650

Please sign in to comment.