Changeset 325 for trunk


Ignore:
Timestamp:
Mar 10, 2006, 2:24:04 PM (19 years ago)
Author:
cxsong
Message:

added a grid object to the test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mesh/test_field.cc

    r323 r325  
    4747
    4848        const char* name1 = "output.field(f1d1)";
    49         const char* name2 = "output.field(f1d2)";
     49        const char* name2 = "output.mesh(m1d)";
    5050
    5151        printf("Testing RpField\n");
     
    5353        RpField* f1 = new RpField(name1, 20);
    5454        f1->addAllPoints(&(points[0]), 20);
    55         f1->setMesh("output.mesh(m2d)");
    56         //f1->print();
     55        f1->setMesh("output.mesh(m1d)");
    5756
    58         //RpGrid1d* grid2 = new RpGrid1d(name2, 20);
    59         //grid2->addAllPoints(&(points[0]), 20);
     57        // use a regular 1d grid
     58        RpGrid1d* grid = new RpGrid1d(0, 1, 20);
     59        grid->objectName(name2);
    6060
    6161        printf("Testing serializer\n");
     
    6363        RpSerializer myvis;
    6464        myvis.addObject(f1);
    65         //myvis.addObject(grid2);
     65        myvis.addObject(grid);
    6666
    6767        char* buf = myvis.serialize();
     
    7979        newvis.print();
    8080
    81         /*
    8281        printf("Testing serializer::getObject\n");
    8382
    84         RpGrid1d* ptr1 = (RpGrid1d*) newvis.getObject(name1);
    85         if (ptr1 != NULL)
    86                 ptr1->print();
     83        RpGrid1d* gptr = (RpGrid1d*) newvis.getObject(name2);
     84        if (gptr != NULL)
     85                gptr->print();
     86        else
     87                printf("%s not found\n", name2);
     88
     89        RpField* fptr = (RpField*) newvis.getObject(name1);
     90        if (fptr != NULL)
     91                fptr->print();
    8792        else
    8893                printf("%s not found\n", name1);
    89 
    90         RpGrid1d* ptr2 = (RpGrid1d*) newvis.getObject(name2);
    91         if (ptr2 != NULL)
    92                 ptr2->print();
    93         else
    94                 printf("%s not found\n", name2);
    95         */
    9694
    9795        delete [] buf;
Note: See TracChangeset for help on using the changeset viewer.