{"id":44788652,"url":"https://github.com/equinor/tmatrix","last_synced_at":"2026-02-16T10:50:08.166Z","repository":{"id":291920997,"uuid":"978763549","full_name":"equinor/tmatrix","owner":"equinor","description":"Seismic properties and pore structure of carbonate rocks","archived":false,"fork":false,"pushed_at":"2026-02-02T11:19:14.000Z","size":121,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-02T22:38:42.884Z","etag":null,"topics":["carbonate","physics","rock","seismic"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/equinor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-06T13:25:45.000Z","updated_at":"2026-02-02T11:19:23.000Z","dependencies_parsed_at":"2025-10-16T03:05:27.450Z","dependency_job_id":"a1afb374-e040-4bd0-8cd7-283078b21b42","html_url":"https://github.com/equinor/tmatrix","commit_stats":null,"previous_names":["equinor/tmatrix"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/equinor/tmatrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equinor%2Ftmatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equinor%2Ftmatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equinor%2Ftmatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equinor%2Ftmatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/equinor","download_url":"https://codeload.github.com/equinor/tmatrix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equinor%2Ftmatrix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29506278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carbonate","physics","rock","seismic"],"created_at":"2026-02-16T10:50:04.448Z","updated_at":"2026-02-16T10:50:07.987Z","avatar_url":"https://github.com/equinor.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tmatrix\n\n[![SCM Compliance](https://scm-compliance-api.radix.equinor.com/repos/equinor/tmatrix/badge)](https://developer.equinor.com/governance/scm-policy/)\n[![PyPI version](https://badge.fury.io/py/tmatrix.svg)](https://badge.fury.io/py/tmatrix)\n\n## Installation\n\nFor most users, installing from PyPI is the preferred way:\n\n```bash\npip install tmatrix\n```\n\nOr using `uv`:\n\n```bash\nuv add tmatrix\n```\n\nFor developers, the project can be compiled with `cmake`:\n\n```bash\ncd tmatrix\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\nAll objects are placed in the build subdirectory.\n\nNote that enabling parallel processing incurs some overhead, and should only be\nenabled for large jobs (e.g. 10.000+ sequential calls).\n\nUnder Windows use, find your desired Windows CMake [generator](https://cmake.org/cmake/help/v3.4/manual/cmake-generators.7.html#visual-studio-generators), ie:\n\n```bash\ncd tmatrix\nmkdir build\ncd build\ncmake .. -G \"Visual Studio 14 2015 Win64\"\ncmake --build . --target ALL_BUILD --config Release\n```\n\n## Usage\n\nThe package exposes two functions\n\n- `tmatrix_porosity`\n- `tmatrix_porosity_noscenario`\n\n### TMatrix porosity\n\n```python\nfrom tmatrix import tmatrix_porosity\n\n\n# Dimension of the output array\ndim = 21\n\n# Output result is stored in `out_np`\nout_np = np.zeros((dim, 4))\n\n# Mineral properties. Contains mineral bulk modulus [Pa], shear modulus [Pa] and density [kg/m³]. Shape should be (N, 3).\nmineral_property_np = np.tile(np.array([7.10e10, 3.20e10, 2.71e03]), (dim, 1))\n\n# Mineral properties. Contains mineral bulk modulus [Pa], shear modulus [Pa] and density [kg/m³]. Shape should be (N, 3).  \nfluid_property_np = np.tile(np.array([2.700e09, 1.005e03, 1.000e02, 1.000e02]), (dim, 1))\n\n# Porosity values. Shape should be (N,).\nphi_vector_np = np.linspace(0.15, 0.25, dim)\n\n# Input scenario. Can be 1,2,3 or 4.\n#   1: Dual porosity, mostly rounded pores\n#   2: Dual porosity, little rounded pores\n#   3: Mixed pores\n#   4: Flat pores and cracks\nin_scenario = 1\n\n# Signal frequency [Hz]\nfrequency = 1000\n\n# Angle of symmetry plane (0 = HTI, 90 = VTI medium) [deg]\nangle_of_sym_plane = 90\n\n# Fraction of inclusions that are connected\nper_inc_con = 0.5\n\n# Fraction of inclusions that are anisotropic\nper_inc_any = 0.5\n\n_ = tmatrix.tmatrix_porosity(\n    out_np=out_np,\n    dim=dim,\n    mineral_property_np=mineral_property_np,\n    fluid_property_np=fluid_property_np,\n    phi_vector_np=phi_vector_np,\n    in_scenario=in_scenario,\n    frequency=frequency,\n    angle_of_sym_plane=angle_of_sym_plane,\n    per_inc_con=per_inc_con,\n    per_inc_any=per_inc_any,\n)\n\n# Returns 0 if success, otherwise failure. Result will be stored in `out_np`, with shape (dim, 4). \n# Column values in order are:\n#   Vp: Vertical P-wave velocity [m/s]\n#   Vsv: Vertical polarity S-wave velocity [m/s]\n#   Vsh: Horizontal polarity S-wave velocity [m/s]\n#   Rhob [kg/m^3]\n```\n\n### TMatrix porosity noscenario\n\n```python\nfrom tmatrix import tmatrix_porosity_noscenario\n\n# Dimension of the output array\nout_N = 21\n\n# Output result is stored in `out_np`\nout_np = np.zeros((out_N, 4))\n\n# Mineral properties. Contains mineral bulk modulus [Pa], shear modulus [Pa] and density [kg/m³]. Shape should be (N, 3).\nmineral_property_np = np.tile(np.array([7.10e10, 3.20e10, 2.71e03]), (out_N, 1))\n\n# Fluid properties. Contains fluid bulk modulus [Pa] and density [kg/m³], viscosity [cP] and permeability [mD]. Shape should be (N, 4).\nfluid_property_np = np.tile(np.array([2.700e09, 1.005e03, 1.000e02, 1.000e02]), (out_N, 1))\n\n# Porosity values. Shape should be (N,).\nphi_vector_np = np.linspace(0.15, 0.25, out_N)\n\n# Aspect ratio values. Shape should be (N,) where N is the number of aspect ratio values\nalpha_np = np.tile(np.array([0.9, 0.1]), (out_N, 1))\n\n# Number of aspect ratio values per sample\nalpha_size_np = np.full((out_N,), 2, dtype=int)\n\n# Length of alpha array\nalpha_N = 21\n\n# Fraction of porosity with given aspect ratio\nv_np = np.tile(np.array([0.9, 0.1]), (out_N, 1))\n\n# Signal frequency [Hz]\nfrequency = 1000\n\n# Angle of symmetry plane (0 = HTI, 90 = VTI medium) [deg]\nangle = 90\n\n# Fraction of inclusions that are connected\ninc_con_np = np.array([0,5])\n\n# Fraction of inclusions that are anisotropic\ninc_ani_np = np.array([0,5])\n\n# Length of `inc_con_np` and `inc_ani_np` \ninc_con_N = 1\n\ntmatrix.tmatrix_porosity_noscenario(\n    out_np=out_np,\n    out_N=out_N,\n    mineral_property_np=mineral_property_np,\n    fluid_property_np=fluid_property_np,\n    phi_vector_np=phi_vector_np,\n    alpha_np=alpha_np,\n    v_np=v_np,\n    alpha_size_np=alpha_size_np,\n    alpha_N=alpha_N,\n    frequency=frequency,\n    angle=angle,\n    inc_con_np=inc_con_np,\n    inc_ani_np=inc_ani_np,\n    inc_con_N=inc_con_N,\n)\n# Returns None. Result will be stored in `out_np`. Output array has shape (out_N, 4).\n# Column values in order are:\n#   Vp: Vertical P-wave velocity [m/s]\n#   Vsv: Vertical polarity S-wave velocity [m/s]\n#   Vsh: Horizontal polarity S-wave velocity [m/s]\n#   Rhob [kg/m^3]\n\n```\n\n## Literature\n\nThe theory can be found in the papers and in the references therein:\n\n1. Agersborg, R., Jakobsen, M., Ruud, B.O. and Johansen, T. A. 2007.\nEffects of pore fluid pressure on the seismic response of a fractured carbonate reservoir.\nStud. Geophys. Geod., 51, 89-118.\n[Link](dx.doi.org/10.1007/s11200-007-0005-8)\n\n2. Agersborg, R., Johansen, T. A. and Ruud, B.O. 2008.\nModelling reflection signatures of pore fluids and dual porosity in carbonate reservoirs.\nJournal of Seismic Exploration, 17(1), 63-83.\n\n3. Agersborg, R., Johansen, T. A., Jakobsen, M., Sothcott, J. and Best, A. 2008.\nEffect of fluids and dual-pores systems on pressure-dependent velocities and attenuation in carbonates,\nGeophysics, 73, No. 5, N35-N47.\n[Link](dx.doi.org/10.1190/1.2969774)\n\n4. Agersborg, R., Johansen, T. A., and Jakobsen, M. 2009.\nVelocity variations in carbonate rocks due to dual porosity and wave-induced fluid flow.\nGeophysical Prospecting, 57, 81-98.\n[Link](dx.doi.org/10.1111/j.1365-2478.2008.00733.x)\n\nAll of the papers and a extended explanations of the involved equations\ncan be found in  Agersborg (2007), phd thesis:\n[Link](https://bora.uib.no/handle/1956/2422)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequinor%2Ftmatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fequinor%2Ftmatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequinor%2Ftmatrix/lists"}