postprocessing.py

Define the functions for post-processing task.

petgem.postprocessing.postprocessing.EpReceiverComputation(model, point, numDimensions)[source]

Compute the primary electric field for an array of point (receivers).

Parameters:
  • model (object_modelling) – CSEM modelling with physical parameters
  • point (ndarray) – receiver spatial coordinates
  • numDimensions (int) – number of dimensions
Returns:

primary electric field on receivers

Return type:

ndarray.

petgem.postprocessing.postprocessing.EsReceiverComputation(field, coordEle, coordReceiver, nodesEle, nedelec_order, numDimensions)[source]

Compute the secondary electric field on receivers.

Parameters:
  • field (ndarray) – secondary field to be interpolated
  • coordElement (ndarray) – element spatial coordinates
  • coordReceiver (ndarray) – receiver spatial coordinates
  • nodesEle (ndarray) – nodal indices of element (element container)
  • nedelec_order (int) – order of tetrahedral edge element
  • numDimensions (int) – number of dimensions
Returns:

secondary electric field on receivers

Return type:

ndarray.

petgem.postprocessing.postprocessing.EtReceiverComputation(primary_field, secondary_field, numDimensions)[source]

Compute the total electric field on receivers.

Parameters:
  • primary_field (ndarray) – primary electric field on receiver.
  • secondary_field (ndarray) – secondary electric field on receiver.
  • numDimensions (int) – number of dimensions
Returns:

total electric field on receivers.

Return type:

ndarray.

petgem.postprocessing.postprocessing.computeFieldsReceiver(modelling, coordReceiver, coordElement, nodesElement, x_field, nedelec_order, numDimensions)[source]

Compute the CSEM modelling output: primary electric field, secondary electric field and total electric field on receivers position.

Parameters:
  • model (object_modelling) – CSEM modelling with physical parameters
  • coordReceiver (ndarray) – receiver spatial coordinates
  • coordElement (ndarray) – element spatial coordinates
  • nodesElement (ndarray) – nodal indices of element (element container)
  • x_field (ndarray) – vector solution for receiver
  • nedelec_order (int) – order of tetrahedral edge element
  • numDimensions (int) – number of dimensions
Returns:

primary, secondary and total electric field

Return type:

ndarray

petgem.postprocessing.postprocessing.exportNumpytoMatlab(data, out_file, electricField=None)[source]

Export electric fields in numpy format to Matlab format.

Parameters:
  • data (int) – electric fields to be saved
  • out_file (str) – out file name for electric fields
Returns:

none

petgem.postprocessing.postprocessing.exportPetscToAscii(nReceivers, xComponentFile, yComponentFile, zComponentFile, out_file)[source]

Export a saved electric fields in petsc format to Ascii format.

Parameters:
  • nReceivers (int) – total number of receivers
  • xComponentFile (str) – petsc file name to be readed and exported
  • yComponentFile (str) – petsc file name to be readed and exported
  • zComponentFile (str) – petsc file name to be readed and exported
  • out_file (str) – out file name for electric fields
Returns:

electric field in numpy format

Return type:

ndarray

petgem.postprocessing.postprocessing.postProcessingFields(receivers, modelling, x, Iend_receivers, Istart_receivers, nedelec_order, vector_type, nodalOrder, numDimensions, rank)[source]

Compute the CSEM modelling output: primary electric field, secondary electric field and total electric field on receivers position.

Parameters:
  • matrix receivers (petsc) – data receivers to compute electric fields
  • model (object_modelling) – CSEM modelling with physical parameters.
  • vector x (petsc) – solution vector
  • Iend_receivers (int) – last range for receivers
  • Istart_receivers (int) – init range for receivers
  • nedelec_order (int) – order of tetrahedral edge element
  • nodalOrder (int) – order of tetrahedral nodal element
  • numDimensions (int) – number of dimensions
  • rank (int) – MPI rank
Returns:

elapsedTimepostprocessing

Return type:

float

petgem.postprocessing.postprocessing.unitary_test()[source]

Unitary test for post_processing.py script.