Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • wdata wdata
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4
    • Issues 4
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wtools
  • wdatawdata
  • Wiki
    • Examples
  • C examples

C examples · Changes

Page history
Update C examples authored Aug 28, 2021 by Gabriel Wlazłowski's avatar Gabriel Wlazłowski
Hide whitespace changes
Inline Side-by-side
Examples/C-examples.md
View page @ b3448231
...@@ -6,10 +6,10 @@ In order to compile examples (optionally you will need to modify Makefile): ...@@ -6,10 +6,10 @@ In order to compile examples (optionally you will need to modify Makefile):
[wtools@dell ~]$ cd wdata [wtools@dell ~]$ cd wdata
[wtools@dell wdata]$ make examples [wtools@dell wdata]$ make examples
``` ```
Folder [wdata](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/) contains library that provides support for w-data processing. Folder [wdata](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/) contains the library that provides support for w-data processing.
List of examples demonstrating how to use this library are presented below. One can see more detailed descritption of each of it in [Examples](Examples/Examples) A list of examples demonstrating how to use this library is presented below.
* [example-write.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-write.c): code creates artificial set of variables and writes them to wdat files. * [example-write.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-write.c): code creates an artificial set of variables and writes them to wdat files.
* [example-write-many.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-write-many.c): code creates artificial set of variables and writes them do wdat files. The differnence between the above is the non repeating parts of the code, however it introduces some limitations. * [example-write-many.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-write-many.c): code creates an artificial set of variables and writes them to wdat files. The difference between the above is the non-repeating parts of the code, however, it introduces some limitations.
* [example-write-many-t_varying.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-write-many-t_varying.c): code creates artificial set of variables and writes them do wdat files. * [example-write-many-t_varying.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-write-many-t_varying.c): code creates artificial set of variables and writes them do wdat files.
* [example-read.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-read.c): code reads data from wdat files (created by [example-write.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/example-write.c)). * [example-read.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-read.c): code reads data from wdat files (created by [example-write.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/example-write.c)).
* [example-addvar.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-addvar.c): code adds new variable to existing data set (created by [example-write.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/example-write.c)). * [example-addvar.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/c-examples/example-addvar.c): code adds new variable to existing data set (created by [example-write.c](https://gitlab.fizyka.pw.edu.pl/wtools/wdata/-/tree/master/example-write.c)).
...@@ -46,7 +46,7 @@ if(test_ele != 1) ...@@ -46,7 +46,7 @@ if(test_ele != 1)
fclose(pFile); // close file fclose(pFile); // close file
``` ```
The above code demonstrates the idea behind the library, however we want to introduce some abstraction, and the code that uses the library function looks like that: The above code demonstrates the idea behind the library, however, we want to introduce some abstraction, and the code that uses the library function looks like that:
```c ```c
double *dataR; // pointer to real data double *dataR; // pointer to real data
int cycleid; // id of cycle to be loaded int cycleid; // id of cycle to be loaded
...@@ -82,7 +82,7 @@ if(test_ele != 1) ...@@ -82,7 +82,7 @@ if(test_ele != 1)
fclose(pFile); // close file fclose(pFile); // close file
``` ```
Using WData library: Using W-data library:
```c ```c
double *dataR; // real data double *dataR; // real data
......
Clone repository
  • Examples
    • C examples
    • Python examples
  • VisIt plugin compilation
  • Visit integration
  • Home
  • wdata format concept