Commit 1a6e1d47 authored by r8s's avatar r8s
Browse files

Fixed Nek launching bugs



Fixed a bug where the NekReader and NekWriter were using "no" and "yes"
instead of "F" and "T" for parameters. Also fixed a bug causing the
NekWriter to output incorrect coordinates in the Mesh Elements block.
Signed-off-by: default avatarr8s <r8s@tnpmbpro.ornl.gov>
parent ba1b0c19
...@@ -167,19 +167,22 @@ public class NekLauncher extends SuiteLauncher { ...@@ -167,19 +167,22 @@ public class NekLauncher extends SuiteLauncher {
// working directory. // working directory.
String exampleCopyStage = "cp -r " + installDir + "/examples/" String exampleCopyStage = "cp -r " + installDir + "/examples/"
+ executable + "/* .;"; + executable + "/* .;";
String rmObjStage = "rm -rf obj/;";
String inputCopyStage = "cp ${inputFile} " String inputCopyStage = "cp ${inputFile} "
+ executableMap.get(executable) + ".rea;"; + executableMap.get(executable) + ".rea;";
String copyNekStep = "cp ${installDir}nek5000 .;";
// Define the nek and visnek launch stages // Define the nek and visnek launch stages. We attempt to lanch the scripts from two different locations, in order to support both the current and legacy versions of the repo structure.
String launchStage = "${installDir}trunk/tools/scripts/nek " String launchStage = "${installDir}trunk/tools/scripts/nek "
+ executableMap.get(executable) + ";"; + executableMap.get(executable) + "; {installDir}bin/nek " + executableMap.get(executable) + ";";
String vizStage = "${installDir}trunk/tools/scripts/visnek " String vizStage = "${installDir}trunk/tools/scripts/visnek "
+ executableMap.get(executable) + ";"; + executableMap.get(executable) + "; {installDir}bin/visnek " + executableMap.get(executable) + ";";
//Remove the copy of the nek5000 application we needed to make in the run directory
String rmObjStage = "rm -rf nek5000";
// Configure the entire launch script // Configure the entire launch script
String launchCommand = exampleCopyStage + rmObjStage + inputCopyStage String launchCommand = exampleCopyStage + inputCopyStage
+ launchStage + vizStage; + copyNekStep + launchStage + vizStage + rmObjStage ;
return launchCommand; return launchCommand;
} }
......
...@@ -26,6 +26,7 @@ import org.eclipse.eavp.viz.modeling.factory.IControllerProviderFactory; ...@@ -26,6 +26,7 @@ import org.eclipse.eavp.viz.modeling.factory.IControllerProviderFactory;
import org.eclipse.eavp.viz.modeling.properties.MeshCategory; import org.eclipse.eavp.viz.modeling.properties.MeshCategory;
import org.eclipse.eavp.viz.modeling.properties.MeshProperty; import org.eclipse.eavp.viz.modeling.properties.MeshProperty;
import org.eclipse.eavp.viz.modeling.VertexController; import org.eclipse.eavp.viz.modeling.VertexController;
import org.eclipse.eavp.viz.modeling.base.IController;
import org.eclipse.eavp.viz.modeling.Vertex; import org.eclipse.eavp.viz.modeling.Vertex;
import org.eclipse.eavp.viz.service.mesh.datastructures.BoundaryCondition; import org.eclipse.eavp.viz.service.mesh.datastructures.BoundaryCondition;
import org.eclipse.eavp.viz.service.mesh.datastructures.BoundaryConditionType; import org.eclipse.eavp.viz.service.mesh.datastructures.BoundaryConditionType;
...@@ -840,6 +841,7 @@ public class NekReader { ...@@ -840,6 +841,7 @@ public class NekReader {
} }
quad.setPolygonProperties(materialId, groupNum); quad.setPolygonProperties(materialId, groupNum);
// Set the boundary conditions of the quad by edge ID // Set the boundary conditions of the quad by edge ID
int currEdgeId; int currEdgeId;
...@@ -906,6 +908,7 @@ public class NekReader { ...@@ -906,6 +908,7 @@ public class NekReader {
} }
} }
} }
// Return the Mesh Component containing mesh elements/quads with a // Return the Mesh Component containing mesh elements/quads with a
// set of (2 + NPSCAL) boundary conditions associated to each edge // set of (2 + NPSCAL) boundary conditions associated to each edge
...@@ -1560,7 +1563,7 @@ public class NekReader { ...@@ -1560,7 +1563,7 @@ public class NekReader {
// If entry's value can only be T/F // If entry's value can only be T/F
if (isDiscrete) { if (isDiscrete) {
entry = new DiscreteEntry(); entry = new DiscreteEntry();
entry.setAllowedValues(Arrays.asList("no", "yes")); entry.setAllowedValues(Arrays.asList("NO", "YES"));
entry.setName("Nek5000 Default Entry"); entry.setName("Nek5000 Default Entry");
entry.setDescription(""); entry.setDescription("");
......
...@@ -28,6 +28,7 @@ import java.util.HashMap; ...@@ -28,6 +28,7 @@ import java.util.HashMap;
import org.eclipse.eavp.viz.modeling.base.IController; import org.eclipse.eavp.viz.modeling.base.IController;
import org.eclipse.eavp.viz.modeling.properties.MeshCategory; import org.eclipse.eavp.viz.modeling.properties.MeshCategory;
import org.eclipse.eavp.viz.modeling.properties.MeshProperty; import org.eclipse.eavp.viz.modeling.properties.MeshProperty;
import org.eclipse.eavp.viz.modeling.EdgeController;
import org.eclipse.eavp.viz.modeling.VertexController; import org.eclipse.eavp.viz.modeling.VertexController;
import org.eclipse.eavp.viz.service.mesh.datastructures.BoundaryCondition; import org.eclipse.eavp.viz.service.mesh.datastructures.BoundaryCondition;
import org.eclipse.eavp.viz.service.mesh.datastructures.BoundaryConditionType; import org.eclipse.eavp.viz.service.mesh.datastructures.BoundaryConditionType;
...@@ -401,7 +402,6 @@ public class NekWriter implements IComponentVisitor { ...@@ -401,7 +402,6 @@ public class NekWriter implements IComponentVisitor {
NekPolygonController currQuad; NekPolygonController currQuad;
IController currEdge; IController currEdge;
int currEdgeId; int currEdgeId;
ArrayList<VertexController> currVertices = new ArrayList<VertexController>();
String currValue; String currValue;
// String buffer used to construct the mesh data, as the MeshComponent // String buffer used to construct the mesh data, as the MeshComponent
...@@ -436,22 +436,11 @@ public class NekWriter implements IComponentVisitor { ...@@ -436,22 +436,11 @@ public class NekWriter implements IComponentVisitor {
/* --- Construct mesh elements --- */ /* --- Construct mesh elements --- */
// Check each descendent vertex. If it is not yet in the list of // Populate the lists of coordinates, in order, from the start points of the entity's edges.
// vertices, add it for (EdgeController entity : currQuad
for (IController entity : currQuad .getEntitiesFromCategory(MeshCategory.EDGES, EdgeController.class)) {
.getEntitiesFromCategory(MeshCategory.EDGES)) { xCoords.add((float) entity.getStartLocation()[0]);
for (VertexController v : entity.getEntitiesFromCategory( yCoords.add((float) entity.getStartLocation()[1]);
MeshCategory.VERTICES, VertexController.class)) {
if (!currVertices.contains(v)) {
currVertices.add(v);
}
}
}
// Extract the x, y coordinates of the Quad's vertices
for (int k = 0; k < 4; k++) {
xCoords.add((float) currVertices.get(k).getTranslation()[0]);
yCoords.add((float) currVertices.get(k).getTranslation()[1]);
} }
// Iterate through the Edges of the current Quad // Iterate through the Edges of the current Quad
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment