Search in sources :

Example 1 with ComsolVtkFileWriter

use of org.vcell.vis.mapping.comsol.ComsolVtkFileWriter in project vcell by virtualcell.

the class DataSetControllerImpl method getEmptyVtuMeshFiles.

public VtuFileContainer getEmptyVtuMeshFiles(ComsolSimFiles comsolSimFiles, VCDataIdentifier vcdataID, int timeIndex) throws DataAccessException {
    try {
        if (timeIndex > 0) {
            throw new RuntimeException("only time index 0 supported for comsol vtk mesh files");
        }
        ComsolVtkFileWriter comsolVTKFileWriter = new ComsolVtkFileWriter();
        File primaryDirectory = getPrimaryUserDir(vcdataID.getOwner(), false);
        VtuFileContainer vtuFiles = comsolVTKFileWriter.getEmptyVtuMeshFiles(comsolSimFiles, primaryDirectory);
        return vtuFiles;
    } catch (Exception e) {
        lg.error(e.getMessage(), e);
        throw new DataAccessException("failed to retrieve VTK files: " + e.getMessage(), e);
    }
}
Also used : ComsolVtkFileWriter(org.vcell.vis.mapping.comsol.ComsolVtkFileWriter) 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 ComsolVtkFileWriter

use of org.vcell.vis.mapping.comsol.ComsolVtkFileWriter in project vcell by virtualcell.

the class DataSetControllerImpl method getVtuMeshData.

public double[] getVtuMeshData(ComsolSimFiles comsolSimFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time) throws DataAccessException {
    try {
        double[] times = getVtuTimes(comsolSimFiles, 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);
        }
        ComsolVtkFileWriter comsolVTKFileWriter = new ComsolVtkFileWriter();
        double[] vtuData = comsolVTKFileWriter.getVtuMeshData(comsolSimFiles, outputContext, getUserDataDirectory(vcdataID), time, 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 : ComsolVtkFileWriter(org.vcell.vis.mapping.comsol.ComsolVtkFileWriter) 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)

Example 3 with ComsolVtkFileWriter

use of org.vcell.vis.mapping.comsol.ComsolVtkFileWriter in project vcell by virtualcell.

the class DataSetControllerImpl method getVtuTimes.

public double[] getVtuTimes(ComsolSimFiles comsolSimFiles, VCDataIdentifier vcdataID) throws DataAccessException, IOException {
    ComsolVtkFileWriter comsolVTKFileWriter = new ComsolVtkFileWriter();
    double[] times = comsolVTKFileWriter.getVtuTimes(comsolSimFiles, getUserDataDirectory(vcdataID));
    return times;
}
Also used : ComsolVtkFileWriter(org.vcell.vis.mapping.comsol.ComsolVtkFileWriter)

Aggregations

ComsolVtkFileWriter (org.vcell.vis.mapping.comsol.ComsolVtkFileWriter)3 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 File (java.io.File)1 ZipFile (org.apache.commons.compress.archivers.zip.ZipFile)1 VtuFileContainer (org.vcell.vis.io.VtuFileContainer)1