Exemplo n.º 1
0
ReadPLUTO::ReadPLUTO(int argc, char **argv)
    : coSimpleModule(argc, argv,
                     "Read PLUTO")
{
    // ports
    p_mesh = addOutputPort("mesh", "StructuredGrid", "structured grid");
    p_rho = addOutputPort("rho", "Float", "density");
    p_rholog = addOutputPort("rholog", "Float", "logarithmic density");
    p_pressure = addOutputPort("pressure", "Float", "pressure");
    p_pressurelog = addOutputPort("pressurelog", "Float", "logarithmic pressure");
    p_velocity = addOutputPort("velocity", "Vec3", "velocity");
    p_magfield = addOutputPort("magfield", "Vec3", "magnetic field");
    p_velocity_cart = addOutputPort("velocity_cart", "Vec3", "velocity in cartesian coordinates");
    p_magfield_cart = addOutputPort("magfield_cart", "Vec3", "magnetic field in cartesian coordinates");

    // choice arrays
    const char *precisionChoice[] = { "single", "double" };
    const char *fileFormatChoice[] = { "single", "multiple" };

    // parameter
    p_path = addFileBrowserParam("path", "Data file path");
    p_path->setValue("$PLUTO_DIR/Torus_3D/", "grid.out");

    p_precision = addChoiceParam("format", "single or double precision");
    p_precision->setValue(2, precisionChoice, 0);

    p_file_format = addChoiceParam("single", "single file or multiple files");
    p_file_format->setValue(2, fileFormatChoice, 1);

    p_tbeg = addInt32Param("t_beg", "First timestep to read");
    p_tbeg->setValue(1);

    p_tend = addInt32Param("t_end", "Last timestep to read");
    p_tend->setValue(1);

    p_skip = addInt32Param("skip", "Number of timesteps to skip");
    p_skip->setValue(0);

    p_axisymm = addBooleanParam("axisymm", "Is the data spherical 2D axisammetric?");
    p_axisymm->setValue(0); // 0 == False

    p_n_axisymm = addInt32Param("n_axisymm", "Expand phi-coordinate with n cells");
    p_skip->setValue(20);

    mesh = NULL;
}
Exemplo n.º 2
0
void StarCD::createOutPorts()
{
    int i;
    char buf[32], buf1[32];

    // the switch contains all output possibilities
    const char *switchName[MAX_SCALARS + 19] =

        //  1        2         3    4   5   6   7   8    9    --- Choice results
        {
          "---", "Velocity", "V-Mag", "U", "V", "W", "P", "TE", "ED",
          //  10    11  12     13      14    15                 --- Choice results
          "Tvis", "T", "Dens", "LamVis", "CP", "Conductivity",
          //  16    17     18                                   --- Choice results
          "Flux", "Void", "Volume"

        };

    for (i = 0; i < MAX_SCALARS; i++) // Scalar values in loop   --- result-19 = scalar
    {
        sprintf(buf, "Scalar %d", i + 1);
        switchName[i + 18] = strcpy(new char[strlen(buf) + 1], buf);
    }

    // mesh output port
    p_mesh = addOutputPort("mesh", "UnstructuredGrid", "Simulation grid");

    // Create one switch above the output port switches to get rid of them
    paraSwitch("output", "Show output selectors");
    paraCase("Hide output selectors");

    for (i = 0; i < NUM_OUT_DATA; i++)
    {
        // create description and name
        sprintf(buf, "Species for data port %d", i);
        sprintf(buf1, "out_%d", i);

        // the choice parameter
        p_value[i] = addChoiceParam(buf1, buf);
        p_value[i]->setValue(MAX_SCALARS + 18, switchName, 0);

        // the data port
        sprintf(buf, "data_%d", i);
        p_data[i] = addOutputPort(buf,
                                  "Float|Vec3",
                                  "Data output port");
    }
    paraEndCase();
    paraEndSwitch();

    // and the port for the residuals
    p_residual = addOutputPort("residual", "StepData|Float", "Residuals");

    // and the port for the feedback
    p_feedback = addOutputPort("feedback", "Polygons", "Feedback patches");
}
Exemplo n.º 3
0
ReadStarDrop::ReadStarDrop(int argc, char *argv[])
    : coModule(argc, argv, "Star Droplet file reader")
{
#ifdef VERBOSE
    debug = fopen("DEBUG", "w");
#endif

    // the LoopThrough data
    p_grid_out = addOutputPort("grid_out", "UnstructuredGrid", "multiplexed grid");
    p_grid_in = addInputPort("grid_in", "UnstructuredGrid", "grid set with REALTIME attribute");

    int i;
    char buf[16];
    for (i = 0; i < NUM_DATA_PORTS; i++)
    {
        sprintf(buf, "dataOut_%d", i);
        p_dataOut[i] = addOutputPort(buf, "Vec3|Float|Polygons|Lines|IntArr|Geometry", "data set to multiplex");
        sprintf(buf, "dataIn_%d", i);
        p_dataIn[i] = addInputPort(buf, "Vec3|Float|Polygons|Lines|IntArr|Geometry", "data set to multiplex");
        p_dataIn[i]->setRequired(0);
        p_dataOut[i]->setDependencyPort(p_dataIn[i]);
    }

    // the output ports
    p_dropOut[LOCA] = addOutputPort("location", "Points", "Droplet Location");
    p_dropOut[VELO] = addOutputPort("velocity", "Vec3", "Droplet velocity");
    p_dropOut[TEMP] = addOutputPort("temp", "Float", "Droplet Temperature");
    p_dropOut[DIAM] = addOutputPort("diameter", "Float", "Droplet Diameter");
    p_dropOut[MASS] = addOutputPort("mass", "Float", "Droplet Mass");
    p_dropOut[COUN] = addOutputPort("count", "Float", "Droplet Count");

    // hand out the mapping for additional loop-thru multiplier modules
    p_mapping = addOutputPort("mapping", "IntArr", "Grid multiplication mapping");

    // select the Droplet file name with a file browser
    p_filename = addFileBrowserParam("filename", "Droplet File");
    p_filename->setValue("data/track.trk", "*.trk;*.33");

    // how often to multiply the input data
    p_maxDrops = addInt32Param("maxPart", "Max. no. of Particles to show, 0=all");
    p_maxDrops->setValue(0);

    // how often to multiply the input data
    p_numSteps = addInt32Param("numSteps", "Number of steps to use, 0=auto");
    p_numSteps->setValue(0);

    // whether to do artificial termination or not
    p_stickHandling = addChoiceParam("stickHandling", "How to handle sticked droplets");
    static const char *labels[] = { "No stuck Droplets", "Both", "Only stuck" };
    p_stickHandling->setValue(3, labels, 0);

    // init local data
    d_lastFileName = NULL;
    d_dropArr = NULL;
    d_numDrops = 0;
}
Exemplo n.º 4
0
void ModifyAddPart::createVentParam()
{
    int i, j, k;

    p_vent = paraSwitch("Vent", "Select a vent");
    for (i = 0; i < MAX_VENTS; i++)
    {
        // create description and name
        sprintf(buf, "Vent %d", i);

        // case for the vent switching
        paraCase(buf);

        sprintf(buf, "Vent_%d:Name", i);
        currVentFile[i] = 0;
        p_name[i] = addChoiceParam(buf, "Select a vent type substructure");
        p_name[i]->setValue(numVentDirs, ventdirs, currVentFile[i]);

        sprintf(buf, "Vent_%d:Pos", i);
        p_pos[i] = addFloatVectorParam(buf, "Position");
        p_pos[i]->setImmediate(1);
        p_pos[i]->setValue(0.0, 0.0, 0.0);
        pos[i][0] = pos[i][1] = pos[i][2] = 0.0;

        sprintf(buf, "Vent_%d:Euler", i);
        p_euler[i] = addFloatVectorParam(buf, "Euler Angles");
        p_euler[i]->setImmediate(1);
        p_euler[i]->setValue(0.0, 0.0, 0.0);
        euler[i][0] = euler[i][1] = euler[i][2] = 0.0;

        sprintf(buf, "Vent_%d:Rot", i);
        p_rot[i] = addFloatVectorParam(buf, "Rotation Matrix");
        p_rot[i]->setImmediate(1);

        for (j = 0; j < 3; j++)
        {
            for (k = 0; k < 3; k++)
            {
                if (j == k)
                    coverRot[i][3 * k + j] = 1.0;
                else
                    coverRot[i][3 * k + j] = 0;
            }
        }

        p_rot[i]->setValue(9, coverRot[i]);
        axis[i][0] = 1;
        axis[i][1] = 0;
        axis[i][2] = 0;
        /// vent case ends here
        paraEndCase();
    }
    paraEndSwitch();
}
Exemplo n.º 5
0
void ReadCadmould::createParam()
{
    // file browser parameter
    p_filename = addFileBrowserParam("filename", "file name of Fuellbild or .cfe file");
    p_filename->setValue("data/nofile", "?????;*.cfe");
    // p_filename->setValue("data/Kunden/faurecia/CADMOULD-Test/nofile","?????");//

    // 3 grid ports : stationary, transient, filling
    p_mesh = addOutputPort("stMesh", "UnstructuredGrid", "stationary mesh");
    p_stepMesh = addOutputPort("trMesh", "UnstructuredGrid", "transient mesh");
    p_thick = addOutputPort("thick", "Float", "thickness of elements");

    // the output ports and choices
    // Loop for data fields: choices and ports
    char name[32];
    const char *defaultChoice[] = { "---" };
    for (int i = 0; i < NUM_PORTS; i++)
    {
        sprintf(name, "Choice_%d", i);
        p_choice[i] = addChoiceParam(name, "Select data for port");
        p_choice[i]->setValue(1, defaultChoice, 0);

        sprintf(name, "Data_%d", i);
        p_data[i] = addOutputPort(name, "Float|IntArr", name);
    }

    p_no_time_steps = addInt32Param("fillTimeStep", "time steps for filling");
    p_no_time_steps->setValue(25);

    const char *defaultFill[] = { "automatic" };
    p_fillField = addChoiceParam("fillField", "Select field for filling");
    p_fillField->setValue(1, defaultFill, 0);

    p_no_data_color = addStringParam("noDataColor", "RGBA color for non-filled elements");

    p_no_data_color->setValue("0xd0d0d0ff");

    //   p_byteswap = addBooleanParam("byteSwapping","byte_swapping");
    p_fillMesh = addOutputPort("fiMesh", "UnstructuredGrid", "mesh for filling");
    p_fillData = addOutputPort("fiValuw", "Float", "data for filling");
}
Exemplo n.º 6
0
ComputeTrace::ComputeTrace(int argc, char *argv[])
    : coSimpleModule(argc, argv, "Creates traces from points timestep dependent")
    , m_firsttime(true)
{
    //the timesteps shall NOT be handled automatically by the coSimpleModule class
    setComputeTimesteps(1);

    /*Fed in points*/
    p_pointsIn = addInputPort("GridIn0", "Points|Spheres", "a set of points or spheres containing the particle/s to be traced over time");
    p_dataIn = addInputPort("DataIn0", "Float|Byte|Int|Vec2|Vec3|RGBA|Mat3|Tensor", "data mapped associated with spheres");
    p_dataIn->setRequired(false);
    p_IDIn = addInputPort("IDIn0", "Int", "ID of each atom");
    p_IDIn->setRequired(false);
    /*Boolean that specifies if a particle should be traced or not*/
    p_traceParticle = addBooleanParam("traceParticle", "set if particle should be traced");
    p_traceParticle->setValue(1);
    /*Integer that specifies the particle to be traced in Module Parameter window*/
    p_particle = addStringParam("selection", "ranges of selected set elements");
    p_particle->setValue("1-1");
    p_maxParticleNumber = addInt32Param("maxParticleNum", "maximum number of particles to trace");
    p_maxParticleNumber->setValue(100);
    /*Integer that specifies the starting point*/
    p_start = addIntSliderParam("start", "Timestep at which the tracing should be started");
    p_start->setValue(0, 0, 0);
    /*Integer that specifies the ending point*/
    p_stop = addIntSliderParam("stop", "Timestep at which the tracing should be stopped");
    p_stop->setValue(0, 0, 0);
    /* Boolean that specifies if the bounding box leaving should be regarded */
    p_regardInterrupt = addBooleanParam("LeavingBoundingBox", "set if leaving bounding box should be taken into account");
    p_regardInterrupt->setValue(0);
    p_animate = addBooleanParam("animate", "disable for static trace");
    p_animate->setValue(1);
    /* 3 values specifying the x, y and z dimension of the bounding box */
    p_boundingBoxDimensions = addFloatVectorParam("BoundingBoxDimensions", "x, y, z dimensions of the bounding box");
    p_boundingBoxDimensions->setValue(0, 0, 0);
    /*Output should be a line*/
    p_traceOut = addOutputPort("GridOut0", "Lines", "Trace of a specified particle");
    /*unique index per line mappable as color attribute*/
    p_indexOut = addOutputPort("DataOut0", "Float", "unique index for every specified particle");
    /*fade out value per timestep mappable as color attribute*/
    p_fadingOut = addOutputPort("DataOut1", "Float", "fade out value for per vertex coloring of lines over time");
    p_dataOut = addOutputPort("DataOut2", "Float|Byte|Int|Vec2|Vec3|RGBA|Mat3|Tensor", "data mapped to lines");

    p_dataOut->setDependencyPort(p_dataIn);
    IDs = NULL;

    assert(sizeof(animValues) / sizeof(animValues[0]) == AnimNumValues);
    p_animateViewer = addChoiceParam("animateViewer", "Animate Viewer");
    p_animateViewer->setValue(AnimNumValues, animValues, AnimOff);

    p_animLookAt = addFloatVectorParam("animLookAt", "Animated viewer looks at this point");
    p_animLookAt->setValue(0., 0., 0.);
}
Exemplo n.º 7
0
MeanValues::MeanValues(int argc, char *argv[])
    : coSimpleModule(argc, argv, "Calculate Mean Values of scalor or vector data data")
{
    p_data = addInputPort("data", "Float|Vec3", "dataValues");
    p_mesh = addInputPort("mesh", "Polygons", "surface mesh");
    p_mesh->setRequired(0);
    p_solution = addOutputPort("meanValues", "Float|Vec3", "meanValues");

    const char *types[] = { "Simple", "Weighted" };
    p_calctype = addChoiceParam("calctype", "how should the mean values be computed");
    p_calctype->setValue(2, types, 0);
}
Exemplo n.º 8
0
relabs::relabs(int argc, char *argv[])
: coSimpleModule(argc, argv, "relabs")
{
   //ports
   p_grid = addInputPort ("grid","UnstructuredGrid|Polygons","computation grid");
   p_velo_in  = addInputPort ("velocity", "Vec3","input vector data");
   p_velo_out = addOutputPort ("v_out", "Vec3","v transformed");

   p_rotaxis = addChoiceParam("Rotation_axis", "ConnectionMethod");
   s_rotaxis[0] = strdup("x");
   s_rotaxis[1] = strdup("y");
   s_rotaxis[2] = strdup("z");
   p_rotaxis->setValue(3, s_rotaxis, RotZ);

   p_revolutions = addFloatParam("rpm", "revolutions per minute");
   p_revolutions->setValue(250.0);

   p_direction = addChoiceParam("rel2abs_or_abs2rel", "Rel2Abs or Abs2Rel");
   s_direction[0] = strdup("abs2rel");
   s_direction[1] = strdup("rel2abs");
   p_direction->setValue(2, s_direction, Rel2Abs);
}
Exemplo n.º 9
0
/// constructor
coColorDistance::coColorDistance(int argc, char *argv[])
    : coSimpleModule(argc, argv, "Compute distance to reference color")
{
    // Create ports:
    piR = addInputPort("Red", "Float", "Scalar volume data (red channel)");
    piR->setInfo("Scalar volume data (red channel)");

    piG = addInputPort("Green", "Float", "Scalar volume data (green channel)");
    piG->setInfo("Scalar volume data (green channel)");

    piB = addInputPort("Blue", "Float", "Scalar volume data (blue channel)");
    piB->setInfo("Scalar volume data (blue channel)");

    poVolume = addOutputPort("Data", "Float", "Scalar volume data");
    poVolume->setInfo("Scalar volume data (range 0-1)");

    // Create parameters:
    paReferenceColor = addColorParam("ReferenceColor", "Color to which the distance is calculated");
    paReferenceColor->setValue(0.0, 0.0, 0.0, 1);

    const char *cs[] = { "RGB", "HSV", "Hue-Saturation", "Hue" };
    paColorSpace = addChoiceParam("ColorSpace", "Color space used for distance calculation");
    paColorSpace->setValue(3, cs, 0);

    const char *metric[] = { "euclidian distance", "manhattan distance", "maximum" };
    paMetric = addChoiceParam("Metric", "Metric for calculation of the distance for transparent values.");
    paMetric->setValue(3, metric, 0);

    paMinMax = addFloatVectorParam("MinMax", "Allowed range of distance.", 2);
    paMinMax->setValue(0, 0.);
    paMinMax->setValue(1, 1.);

    paSlider = addFloatSliderParam("DistanceBase", "This value is added to the calculated distance.");
    paSlider->setValue(-10, 10, 1);

    paSlider2 = addFloatSliderParam("DistanceMultiplier", "This value multiplies the calculated distance.");
    paSlider2->setValue(-10, 10, -1);
}
Exemplo n.º 10
0
ReadN3s::ReadN3s(int argc, char *argv[])
{
    char buf[255], buf1[255];
    char buf2[255];
    int i;
    char *geo_data_path;
    char *res_data_path;
    set_module_description("Generic ASCII-File Reader for N3S 3.2");

    // the output port
    unsgridPort = addOutputPort("mesh", "coDoUnstructuredGrid", "geometry ");

    for (i = 0; i < MAX_PORTS_N3S; i++)
    {
        sprintf(buf, "dataport%d", i + 1);
        dataPort[i] = addOutputPort(buf, "coDoVec3 | coDoFloat | DO_Unstructured_V2D_Data | coDoVec2", buf);
    }
    // select the OBJ file name with a file browser
    geoFileParam = addFileBrowserParam("n3s geofile", "N3S geofile");
    resFileParam = addFileBrowserParam("n3s result file", "N3S result file");
    char *cov_path = getenv("COVISEDIR");
    geo_data_path = new char[255];
    res_data_path = new char[255];
    if (cov_path)
    {
        sprintf(geo_data_path, "%s/data/n3s/* ", cov_path);
        sprintf(res_data_path, "%s/data/n3s/* ", cov_path);
    }
    else
    {
        sprintf(geo_data_path, "./* ");
        sprintf(res_data_path, "./* ");
    }
    cerr << "buf: " << geo_data_path << endl;
    geoFileParam->setValue(geo_data_path, "geom");
    resFileParam->setValue(res_data_path, "post.res");
    //    resFileParam->setValue("post.res result", buf);

    return;

    choice_of_data[0] = new char[10]; // die gibt's immer
    strcpy(choice_of_data[0], "(none)\n");
    for (i = 0; i < MAX_PORTS_N3S; i++)
    {
        sprintf(buf1, "data%d", i);
        sprintf(buf2, "select data%d", i);
        choiceData[i] = addChoiceParam(buf1, buf2);
        choiceData[i]->setValue(1, choice_of_data, 1);
    }
}
Exemplo n.º 11
0
ModifyAddPart::ModifyAddPart()
{
    int i;

    // no. of attached vents to cabin
    numVents = 0;

    // no. of read directories for vent description
    // default nothing
    numVentDirs = 1;

    for (i = 0; i < MAX_NAMES; i++)
        ventdirs[i] = NULL;

    // init some defaults
    for (i = 0; i < MAX_VENTS; i++)
    {
        fileid[i] = 0;
        exist[i] = 0;
    }

    // declare the name of our module
    set_module_description("Add parts to the Cabin");

    // paramter for vent directory structure
    p_ventDir = addStringParam("ventPath", "Path for vent descriptions");
    p_ventDir->setValue("data/visit/icem/test");
    ventFilePath = "data/visit/icem/test";

    // get the directory structure for all vents in given path
    getVentDirs();

    // create the COVISE parameter
    // user can set a subdirectory for vents
    createVentParam();

    // what do you want to calculate
    p_action = addChoiceParam("Set Action", "select the action");
    p_action->setValue(nAction, action, currAction);

    // tetin object describing the cabin
    inTetin = addInputPort("tetinObj", "DO_Tetin", "coTetin object");
    inTetin->setRequired(1);

    // output objects for transfer directory and vent polygons
    solverText = addOutputPort("solverText", "coDoText", "Command for StarCD");
    outPolygon = addOutputPort("polygon_set", "coDoPolygons", "Geometry output");
    prostarData = addOutputPort("prostarData", "coDoText", "Part data for Prostar");
}
Exemplo n.º 12
0
Patran::Patran(int argc, char *argv[])
    : coModule(argc, argv, "Read Patran Neutral Files")
{
    const char *ChoiseVal[] = {
        "Nodal_Results", "Element_Results",
    };
    strcpy(init_path, "data/nofile");

    //parameters
    p_gridpath = addFileBrowserParam("grid_path", "Neutral File path");
    p_gridpath->setValue(init_path, "*");
    p_displpath = addFileBrowserParam("nodal_displ_force_path", "Nodal Displacement File path");
    p_displpath->setValue(init_path, "*");
    p_nshpath = addFileBrowserParam("nodal_result_path", "Nodal Results File path");
    p_nshpath->setValue(init_path, "*");
    p_elempath = addFileBrowserParam("element_result_path", "Element Results File path");
    p_elempath->setValue(init_path, "*");
    p_option = addChoiceParam("Option", "perNode od perElement data");
    p_option->setValue(2, ChoiseVal, 0);
    p_timesteps = addInt32Param("timesteps", "timesteps");
    p_timesteps->setValue(1);
    p_skip = addInt32Param("skipped_files", "number of skip files for each timestep");
    p_skip->setValue(0);
    p_columns = addInt32Param("nb_columns", "number of column in the result file");
    p_columns->setValue(1);

    //ports

    //p_inPort1->setRequired(0);
    p_outPort1 = addOutputPort("mesh", "UnstructuredGrid", "Mesh output");
    p_outPort2 = addOutputPort("data1", "Vec3", "Vector Data Field 1 output");
    p_outPort3 = addOutputPort("data2", "Float", "Scalar Data Field 1 output");
    p_outPort4 = addOutputPort("type", "IntArr", "IDs");
    //private data
    gridFile = NULL;
    grid_path = NULL;
    nsh_path = NULL;
    displ_path = NULL;
}
Exemplo n.º 13
0
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++
// ++++  Constructor : This will set up module port structure
/// ++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ParamTest::ParamTest(int argc, char *argv[])
    : coSimpleModule(argc, argv, "Param Program: Show all parameter types")
{
    //autoInitParam(0);

    // Immediate-mode String parameter
    stringImm = addStringParam("stringImm", "Immediate string");
    stringImm->setValue("This is an immediate String Parameter");

    // Immediate-mode Boolean parameter, pre-set to FALSE
    boolImm = addBooleanParam("boolImm", "Immediate coBooleanParam");
    boolImm->setValue(0);

    iScalImm = addInt32Param("iScalImm", "Immediate coIntScalarParam");
    iScalImm->setValue(123);

    fScalImm = addFloatParam("fScalImm", "Immediate coFloatParam");
    fScalImm->setValue(-12.56f);

    // integer sliders: immediate and non-immediate
    iSlidImm = addIntSliderParam("iSlidImm", "Immediate coIntSliderParam");
    iSlidImm->setValue(1, 27, 16);

    // float sliders: immediate and non-immediate
    fSlidImm = addFloatSliderParam("fSlidImm", "Immediate coFloatSliderParam");
    fSlidImm->setValue(-10.0, 30.0, 0.0);

    // float vector: use default size of 3 and set with 3D setValue function
    fVectImm = addFloatVectorParam("fVectImm", "Immediate coFloatVectorParam");
    fVectImm->setValue(1.34f, 1.889f, -99.87f);

    // it makes no sense to put a file selector in the switch, since
    // it is not displayed in the control panel
    browseImm = addFileBrowserParam("myFile", "a file browser");
    browseImm->setValue("/var/tmp/whatever.txt", "*.txt");
    browseImm->show();

    browse = addFileBrowserParam("my2File", "a file browser");
    browse->setValue("/var/tmp/whatever2.txt", "*.txt");
    browse->show();

    // Now this is a choice : we have the choice between 6 values
    const char *choiceVal[] = {
        "left lower inlet", "left upper inlet",
        "left center inlet", "right center inlet",
        "right lower Inlet", "right upper Inlet"
    };
    choImm = addChoiceParam("choImm", "Nun auch noch Choices");
    choImm->setValue(6, choiceVal, 1);

    // add an input port for 'coDoUnstructuredGrid' objects
    inPortReq = addInputPort("inputReq", "StructuredGrid", "Required input port");

    // add another input port for 'coDoUnstructuredGrid' objects
    inPortNoReq = addInputPort("inputNoReq", "UnstructuredGrid", "Not required input port");

    // tell that this port does not have to be connected
    inPortNoReq->setRequired(0);

    // add an output port for this type
    outPort = addOutputPort("outPort", "coDoUnstructuredGrid", "Output Port");

    // and that's all ... no init() or anything else ... that's done in the lib
}
Exemplo n.º 14
0
Sample::Sample(int argc, char *argv[])
    : coModule(argc, argv, "Sample data on points, unstructured and uniform grids to a uniform grid")
{

    const char *outsideChoice[] = { "MAX_FLT", "user_defined_fill_value" };
    const char *sizeChoice[] = { "user defined", "8", "16", "32", "64", "128", "256", "512", "1024" };
    const char *algorithmChoices[] = {
        "possible holes",
        "no holes and no expansion",
        "no holes and expansion",
        "accurate and slow"
        /*, "number weights" */
    };
    const char *bounding_boxChoices[] = { "automatic per timestep", "automatic global", "manual" };

    const char *pointSamplingChoices[] = { "linear", "logarithmic", "normalized linear", "normalized logarithmic" };

    // fill value for outside
    outsideChoiceParam = addChoiceParam("outside", "fill value for outside - MAXFLT or number");
    outsideChoiceParam->setValue(2, outsideChoice, 0);

    fillValueParam = addFloatParam("fill_value", "Fill Value if not intersecting");
    fillValueParam->setValue(0.0);

    // choose algorithm
    p_algorithm = addChoiceParam("algorithm", "choose algorithm");
    p_algorithm->setValue(4, algorithmChoices, 2);

    // choose mapping for point sampling
    p_pointSampling = addChoiceParam("point_sampling", "choose mapping for point sampling");
    p_pointSampling->setValue(4, pointSamplingChoices, 2);

    // select dimension in i direction
    iSizeChoiceParam = addChoiceParam("isize", "unigrid size in i direction");
    iSizeChoiceParam->setValue(9, sizeChoice, 3);

    iSizeParam = addInt32Param("user_defined_isize", "user defined i_size");
    iSizeParam->setValue(32);

    jSizeChoiceParam = addChoiceParam("jsize", "unigrid size in j direction");
    jSizeChoiceParam->setValue(9, sizeChoice, 3);

    jSizeParam = addInt32Param("user_defined_jsize", "user defined j_size");
    jSizeParam->setValue(32);

    kSizeChoiceParam = addChoiceParam("ksize", "unigrid size in k direction");
    kSizeChoiceParam->setValue(9, sizeChoice, 3);

    kSizeParam = addInt32Param("user_defined_ksize", "user defined k_size");
    kSizeParam->setValue(32);

    p_bounding_box = addChoiceParam("bounding_box", "bounding box calculation");
    p_bounding_box->setValue(3, bounding_boxChoices, 0); // default to manual

    float boundsIni[3] = { -1.0, -1.0, -1.0 };
    p_P1bound_manual = addFloatVectorParam("P1_bounds", "First point");
    p_P1bound_manual->setValue(3, boundsIni);

    float boundsEnd[3] = { 1.0, 1.0, 1.0 };
    p_P2bound_manual = addFloatVectorParam("P2_bounds", "Second point");
    p_P2bound_manual->setValue(3, boundsEnd);

    // eps to cover numerical problems
    epsParam = addFloatParam("eps", "small value to cover numerical problems");
    epsParam->setValue(0.0);

    // add an input port for 'coDoUnstructuredGrid' objects
    Grid_In_Port = addInputPort("GridIn", "UnstructuredGrid|UniformGrid|RectilinearGrid|StructuredGrid|Points", "Grid input");
    Data_In_Port = addInputPort("DataIn", "Float|Vec3", "Data input");
    Data_In_Port->setRequired(0);
    Reference_Grid_In_Port = addInputPort("ReferenceGridIn", "UniformGrid", "Reference Grid");
    Reference_Grid_In_Port->setRequired(0);

    // add an output port for this type
    Grid_Out_Port = addOutputPort("GridOut", "UniformGrid", "Grid Output Port");
    Data_Out_Port = addOutputPort("DataOut", "Float|Vec3", "Data Output Port");
}