Warp Factory
  • What is Warp Factory?
  • Overview
    • Installing Warp Factory
    • Workflow
    • Codebase Structure
    • Object Types
    • Frames
  • Examples
    • Metrics
      • M1 - First Metric
      • M2 - Default Metrics
      • M3 - Building a Metric
    • Energy Tensor
      • T1 - First Energy Tensor
      • T2 - Cartoon Methods
      • T3 - GPU Computation
      • T4 - Solver Order
      • T5 - Errors
    • Analysis
      • A1 - Energy Conditions
      • A2 - Metric Scalars
      • A3 - Eval Metric
      • A4 - Momentum Flow
    • Warp Shell
      • W1 Warp Shell Comoving
  • Modules
    • Metrics Module
      • Metric Library
        • metricGet_Minkowski
        • metricGet_Alcubierre
        • metricGet_Lentz
        • metricGet_VanDenBroeck
        • metricGet_WarpShellComoving
        • metricGet_ModifiedTime
        • metricGet_Schwarzschild
      • Metric Functions
        • setMinkowski
        • setMinkowskiThreePlusOne
        • threePlusOneBuilder
        • threePlusOneDecomposer
    • Analyzer Module
      • getMomentumFlowLines
      • doFrameTransfer
      • changeTensorIndex
      • getScalars
      • getEnergyConditions
      • evalMetric
    • Solver Module
      • getEnergyTensor
      • verifyTensor
    • Visualizer Module
      • plotThreePlusOne
      • plotTensor
      • Plot Functions
    • Units Module
  • General
    • Contributing
    • FAQ
    • Citing Warp Factory
Powered by GitBook
On this page
  • Welcome to Warp Factory!
  • First metric
  • MyFirstMetric.type
  • MyFirstMetric.index
  • MyFirstMetric.tensor
  • Other Properties
  1. Examples
  2. Metrics

M1 - First Metric

PreviousMetricsNextM2 - Default Metrics

Last updated 1 year ago

Welcome to Warp Factory!

In this example, we'll learn the basics of metrics.

First metric

gridSize = [1 10 10 10];
gridScaling = [1 1 1 1];

Check out the properties of the metric struct

fieldnames(MyFirstMetric)

MyFirstMetric.type

This one is simple. The .type property of this tensor is "metric". This identifies this tensor object as a metric.

MyFirstMetric.type

MyFirstMetric.index

This property specifies what form the tensor is in. A metric tensor index can either be "covariant" ( gμνg_{\mu\nu}gμν​ ) or "contravariant" ( gμνg^{\mu\nu}gμν ).

MyFirstMetric.index

MyFirstMetric.tensor

The tensor contains the values for metric at each point in space and time for each tensor component. The tensor object is a 4x4 cell array. Each cell contains an array of values for each point in spacetime. The size of this array is equal to the gridSize of your spacetime.

MyFirstMetric.tensor

Let's take a look at the tensor values for a slice of the space.

for i = 1:4
    for j = 1:4
        nexttile
        surfq(MyFirstMetric.tensor{i,j}(1,:,:,1))
    end
end

Other Properties

.name - Your metric has a name!

.date - Your metric stores a date when it is made.

.scaling - Your metric has scaling information about the coordinate grid step size in time and space. We'll get into this more in later examples.

.coords - The coordinate system associated with the metric. 'cartesian'.

MyFirstMetric.name
MyFirstMetric.date
MyFirstMetric.scaling
MyFirstMetric.coords

Just as expected for Minkowski space! ( gμν=ημνg_{\mu\nu} = \eta_{\mu\nu}gμν​=ημν​ for all points in the slice)