v_sim.ScalarField¶
- Subclasses:
 
Methods¶
- Inherited:
 - Structs:
 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r  | 
whether has data or not  | 
||
r/w/co  | 
description label  | 
Signals¶
- Inherited:
 
Name  | 
Short Description  | 
|---|---|
Gets emitted when the values stored in this field are changed.  | 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
parent  | 
r  | 
Class Details¶
- class v_sim.ScalarField(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
An opaque structure for the scalar field.
- classmethod new(label)¶
 - Parameters:
 label (
str) – a label to identify the scalar field.- Returns:
 a newly created
v_sim.ScalarFieldobject.- Return type:
 
Create a new
v_sim.ScalarFieldobject that is empty (all internal pointers are set toNoneand no memory is allocated except for the object itself. The label argument is copied.
- addOption(option)¶
 - Parameters:
 option (
v_sim.Option) – a newly allocated option.
This method adds an option to the list of #Option associated to the data. The given option will not be duplicated and should not be used elsewhere because it will be freed when the self will be freed.
- getAllOptions()¶
 - Returns:
 a newly created
GLib.Listthat should be freed after use with g_list_free(). But data of the list are owned by V_Sim and should not be modified or freed.- Return type:
 
Some #Option can be stored in association to the values of the scalar field. These options are usually values associated to the read data, such as a spin direction when dealing with density of spin…
- getAt(i, j, k)¶
 - Parameters:
 - Returns:
 the value.
- Return type:
 
Computes the scalarfield value at i, j and k.
New in version 3.8.
- getCommentary()¶
 - 
If the file format support a commentary, this is a good method to get it.
 
- getCoordInside(xyz, extension)¶
 - Parameters:
 - Returns:
 Trueif grid is valid.- grid:
 a location to store grid coordinates.
- dgrid:
 a location to store grid coordinates.
- factor:
 a location to store factors in every directions.
- Return type:
 
From the coordinates xyz, compute the grid coordinate grid closest to xyz. Put also in dgrid the closest grid coordinate after xyz. On output, factor will contains three float in [0;1] defining where is xyz within the cube defined by grid and dgrid.
New in version 3.8.
- getGradAt(i, j, k, dir)¶
 - Parameters:
 i (
int) – an integer.j (
int) – an integer.k (
int) – an integer.dir (
v_sim.XyzDir) – a direction.
- Returns:
 the gradient value.
- Return type:
 
Computes the gradient along dir at i, j and k.
New in version 3.8.
- getGridSize()¶
 - Returns:
 3 integer locations.
- Return type:
 grid:
v_sim.GridSize
This method is used to get the division in x, y, and z directions.
- getLabel()¶
 - Returns:
 a pointer on the filename (it should not be freed).
- Return type:
 
The data are read from a file.
- getMesh(dir)¶
 - Parameters:
 dir (
v_sim.XyzDir) – a direction.- Returns:
 a pointer on the allocated meshx array (it should not be freed).
- Return type:
 
The mesh along x is stored as an array in x increasing.
- getMeshInside(i, j, k)¶
 - Parameters:
 - Returns:
 a location to store the mesh coordinates.
- Return type:
 grid: [
int]
Apply periodicity when required to convert a mesh coordinates (i,j,k) into a valid coordinate grid.
New in version 3.8.
- getMeshtype()¶
 - Returns:
 a
v_sim.ScalarFieldMeshFlags(uniform or nonuniform).- Return type:
 
The vertex may be distributed linearly along the different directions or customily distributed.
- getMinMax(minmax)¶
 - Parameters:
 minmax ([
float]) – two double values.
Get the minimum and the maximum values of the given self.
- getValue(xyz, extension)¶
 - Parameters:
 - Returns:
 Trueif the value can be interpolate,Falseotherwise, for instance, when the point xyz is out of bounds.- value:
 a location to store the value ;
- Return type:
 
Knowing the point coordinates, it interpolate a value from the scalar field. If the scalar field is periodic, then it allow the coordinates to extend inside the given extension.
- isEmpty()¶
 - 
Since loading of scalar fields is asynchronous, this method can be used to inquire if self has been populated yet or not.
New in version 3.8.
 
- setCommentary(comment)¶
 - Parameters:
 comment (
str) – an UTF-8 string to store as a commentary.
A commentary can be associated to a
v_sim.ScalarField, use this method to set it. The value of comment is NOT copied.
- setGridSize(grid)¶
 - 
This method is used to set the division in x, y, and z directions. If the size of internal array for data is changed, it is reallocated and previous data are erased. Use visu_scalar_field_getData() to get a pointer on this data array.
 
- setMesh(mesh, dir)¶
 - Parameters:
 mesh (
float) – an array with the mesh description in one direction.dir (
v_sim.XyzDir) – a direction.
Define the mesh in case of non regular one.
New in version 3.8.
- setMeshtype(meshtype)¶
 - Parameters:
 meshtype (
v_sim.ScalarFieldMeshFlags) – av_sim.ScalarFieldMeshFlagsobject.
Change the distribution of the vertex of the scalarfield between regular or custom.
- do_getAt(i, j, k) virtual¶
 - Parameters:
 - Returns:
 the value.
- Return type:
 
Computes the scalarfield value at i, j and k.
New in version 3.8.
- do_getGridSize() virtual¶
 - Returns:
 3 integer locations.
- Return type:
 grid:
v_sim.GridSize
This method is used to get the division in x, y, and z directions.
- do_getMinMax(minmax) virtual¶
 - Parameters:
 minmax ([
float]) – two double values.
Get the minimum and the maximum values of the given field.
- do_getValue(xyz, extension) virtual¶
 - Parameters:
 - Returns:
 Trueif the value can be interpolate,Falseotherwise, for instance, when the point xyz is out of bounds.- value:
 a location to store the value ;
- Return type:
 
Knowing the point coordinates, it interpolate a value from the scalar field. If the scalar field is periodic, then it allow the coordinates to extend inside the given extension.
- do_isEmpty() virtual¶
 - 
Since loading of scalar fields is asynchronous, this method can be used to inquire if field has been populated yet or not.
New in version 3.8.
 
- do_setGridSize(grid) virtual¶
 - 
This method is used to set the division in x, y, and z directions. If the size of internal array for data is changed, it is reallocated and previous data are erased. Use visu_scalar_field_getData() to get a pointer on this data array.
 
Signal Details¶
- v_sim.ScalarField.signals.changed(scalar_field)¶
 - Signal Name:
 changed- Flags:
 - Parameters:
 scalar_field (
v_sim.ScalarField) – The object which received the signal
Gets emitted when the values stored in this field are changed.
New in version 3.8.
Property Details¶
- v_sim.ScalarField.props.empty¶
 - 
whether has data or not
 
- v_sim.ScalarField.props.label¶
 - Name:
 label- Type:
 - Default Value:
 ''- Flags:
 
description label