Skip to content
Snippets Groups Projects
material_neukamm.py 1.04 KiB
import math


#Indicator function that determines both phases
# x[0] : y1-component
# x[1] : y2-component
# x[2] : x3-component
#    --- replace with your definition of indicatorFunction:
###############
# Wood
###############
# def f(x):
#     theta=0.25
    # if ((abs(x[0]) < theta/2) and x[2]<0.25):
    #     return 1    #latewood
    # elif ((abs(x[0]) > theta/2) and x[2]<0.25):
    #     return 2    #earlywood
    # else :
    #     return 0    #Phase3

# def b1(x):
#     return [[.5, 0, 0], [0,1,0], [0,0,0]]

# def b2(x):
#     return [[.4, 0, 0], [0,.4,0], [0,0,0]]

# def b3(x):
#     return [[0, 0, 0], [0,0,0], [0,0,0]]
###############
# Cross
###############
def f(x):
    theta=0.25
    factor=1
    if (x[0] <-1/2+theta and x[2]<-1/2+theta):
        return 1    #Phase1
    elif (x[1]< -1/2+theta and x[2]>1/2-theta):
        return 2    #Phase2
    else :
        return 0    #Phase3

def b1(x):
    return [[1, 0, 0], [0,1,0], [0,0,1]]

def b2(x):
    return [[1, 0, 0], [0,1,0], [0,0,1]]

def b3(x):
    return [[0, 0, 0], [0,0,0], [0,0,0]]