Search in sources :

Example 1 with MovingBoundaryVtkFileWriter

use of org.vcell.vis.mapping.movingboundary.MovingBoundaryVtkFileWriter in project vcell by virtualcell.

the class DataSetControllerImpl method getEmptyVtuMeshFiles.

public VtuFileContainer getEmptyVtuMeshFiles(MovingBoundarySimFiles movingBoundarySimFiles, VCDataIdentifier vcdataID, int timeIndex) throws DataAccessException {
    try {
        MovingBoundaryVtkFileWriter movingBoundaryVtkFileWriter = new MovingBoundaryVtkFileWriter();
        File primaryDirectory = PropertyLoader.getRequiredDirectory(PropertyLoader.primarySimDataDirInternalProperty);
        VtuFileContainer vtuFiles = movingBoundaryVtkFileWriter.getEmptyVtuMeshFiles(movingBoundarySimFiles, timeIndex, primaryDirectory);
        return vtuFiles;
    } catch (Exception e) {
        lg.error(e.getMessage(), e);
        throw new DataAccessException("failed to retrieve VTK files: " + e.getMessage(), e);
    }
}
Also used : MovingBoundaryVtkFileWriter(org.vcell.vis.mapping.movingboundary.MovingBoundaryVtkFileWriter) VtuFileContainer(org.vcell.vis.io.VtuFileContainer) ZipFile(org.apache.commons.compress.archivers.zip.ZipFile) File(java.io.File) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) XmlParseException(cbit.vcell.xml.XmlParseException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) DivideByZeroException(cbit.vcell.parser.DivideByZeroException) CacheException(org.vcell.util.CacheException) ExpressionBindingException(cbit.vcell.parser.ExpressionBindingException) FileNotFoundException(java.io.FileNotFoundException) ExpressionException(cbit.vcell.parser.ExpressionException) MathException(cbit.vcell.math.MathException) DataAccessException(org.vcell.util.DataAccessException)

Example 2 with MovingBoundaryVtkFileWriter

use of org.vcell.vis.mapping.movingboundary.MovingBoundaryVtkFileWriter in project vcell by virtualcell.

the class DataSetControllerImpl method getVtuMeshData.

public double[] getVtuMeshData(MovingBoundarySimFiles movingBoundarySimFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time) throws DataAccessException {
    try {
        double[] times = getDataSetTimes(vcdataID);
        int timeIndex = -1;
        for (int i = 0; i < times.length; i++) {
            if (times[i] == time) {
                timeIndex = i;
                break;
            }
        }
        if (timeIndex < 0) {
            throw new DataAccessException("data for dataset " + vcdataID + " not found at time " + time);
        }
        // VCData simulationData = getVCData(vcdataID);
        SimDataBlock simDataBlock = getSimDataBlock(outputContext, vcdataID, var.name, time);
        double[] volumeVarData = simDataBlock.getData();
        MovingBoundaryVtkFileWriter movingBoundaryVtkFileWriter = new MovingBoundaryVtkFileWriter();
        double[] vtuData = movingBoundaryVtkFileWriter.getVtuMeshData(movingBoundarySimFiles, volumeVarData, getUserDataDirectory(vcdataID), var, timeIndex);
        return vtuData;
    } catch (Exception e) {
        lg.error(e.getMessage(), e);
        throw new DataAccessException("failed to retrieve VTK files: " + e.getMessage(), e);
    }
}
Also used : MovingBoundaryVtkFileWriter(org.vcell.vis.mapping.movingboundary.MovingBoundaryVtkFileWriter) DataAccessException(org.vcell.util.DataAccessException) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) XmlParseException(cbit.vcell.xml.XmlParseException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) DivideByZeroException(cbit.vcell.parser.DivideByZeroException) CacheException(org.vcell.util.CacheException) ExpressionBindingException(cbit.vcell.parser.ExpressionBindingException) FileNotFoundException(java.io.FileNotFoundException) ExpressionException(cbit.vcell.parser.ExpressionException) MathException(cbit.vcell.math.MathException)

Aggregations

MathException (cbit.vcell.math.MathException)2 DivideByZeroException (cbit.vcell.parser.DivideByZeroException)2 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)2 ExpressionException (cbit.vcell.parser.ExpressionException)2 XmlParseException (cbit.vcell.xml.XmlParseException)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 CacheException (org.vcell.util.CacheException)2 DataAccessException (org.vcell.util.DataAccessException)2 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)2 MovingBoundaryVtkFileWriter (org.vcell.vis.mapping.movingboundary.MovingBoundaryVtkFileWriter)2 File (java.io.File)1 ZipFile (org.apache.commons.compress.archivers.zip.ZipFile)1 VtuFileContainer (org.vcell.vis.io.VtuFileContainer)1