Commit cc6dd272 authored by JasonPries's avatar JasonPries
Browse files

Commit due to fubar kernel

parent 0e76bba5
...@@ -75,11 +75,11 @@ def plot_vector(fname): ...@@ -75,11 +75,11 @@ def plot_vector(fname):
yc = (nodes[tris[:,0],1]+nodes[tris[:,1],1]+nodes[tris[:,2],1])/3.0 yc = (nodes[tris[:,0],1]+nodes[tris[:,1],1]+nodes[tris[:,2],1])/3.0
plt.figure() plt.figure()
plt.set_cmap('viridis') plt.set_cmap('inferno')
plt.gca().set_aspect('equal') plt.gca().set_aspect('equal')
plt.tripcolor(nodes[:,0],nodes[:,1],tris,facecolors = mag,edgecolors='k') plt.tripcolor(nodes[:,0],nodes[:,1],tris,facecolors = mag,edgecolors='k')
plt.colorbar() plt.colorbar()
#plt.quiver(xc,yc,vals[:,0],vals[:,1],pivot='mid') #plt.quiver(xc,yc,vals[:,0],vals[:,1],mag,pivot='mid',edgecolors='k',linewidths=0.1)
plt.grid(True) plt.grid(True)
plt.axes().set_aspect('equal','datalim') plt.axes().set_aspect('equal','datalim')
for ext in imgtypes: for ext in imgtypes:
......
#include "MaterialProperties.h" #include "MaterialProperties.h"
\ No newline at end of file
MaterialProperties JFE_35JN210() {
std::vector<std::array<double_t, 3>> mbspline;
mbspline.reserve(240);
mbspline.push_back(std::array<double_t, 3>{18365.985190409698, 794899.73511242226, -3.0173962958946251e-13});
mbspline.push_back(std::array<double_t, 3>{4034.9339341546784, 795186.35613754706, -1.4331051256247858});
mbspline.push_back(std::array<double_t, 3>{4863.0416049806927, 795153.23183071509, -1.1018620573174855});
mbspline.push_back(std::array<double_t, 3>{2422.201548154997, 795299.68223412486, -3.2986181084709516});
mbspline.push_back(std::array<double_t, 3>{2137.3461107372163, 795322.47066912113, -3.75438680848168});
mbspline.push_back(std::array<double_t, 3>{1350.3552114478355, 795401.16975905187, -5.7218640567800083});
mbspline.push_back(std::array<double_t, 3>{1039.0982013420737, 795438.52060026687, -6.84238929329792});
mbspline.push_back(std::array<double_t, 3>{732.00718933882774, 795481.51334194595, -8.3471352520227651});
mbspline.push_back(std::array<double_t, 3>{587.3702026623946, 795504.6552598062, -9.27281196610023});
mbspline.push_back(std::array<double_t, 3>{481.80435388048141, 795523.65711257793, -10.127895340397405});
mbspline.push_back(std::array<double_t, 3>{431.22430834615233, 795533.7731216721, -10.633695794480863});
mbspline.push_back(std::array<double_t, 3>{403.33439728456329, 795539.90890210448, -10.971163718231798});
mbspline.push_back(std::array<double_t, 3>{370.54487739332819, 795547.7783868853, -11.443332805478015});
mbspline.push_back(std::array<double_t, 3>{314.40011907761391, 795562.37602404214, -12.392179220293254});
mbspline.push_back(std::array<double_t, 3>{262.57395652309719, 795576.88734956039, -13.407972006761149});
mbspline.push_back(std::array<double_t, 3>{234.83470601836487, 795585.20912471833, -14.03210514411267});
mbspline.push_back(std::array<double_t, 3>{213.65950243809374, 795591.98518985836, -14.574190354797198});
mbspline.push_back(std::array<double_t, 3>{180.25747894193947, 795603.34187786176, -15.539508836367297});
mbspline.push_back(std::array<double_t, 3>{143.93822807027968, 795616.4168081996, -16.71625256892078});
mbspline.push_back(std::array<double_t, 3>{117.65828075943814, 795626.40318818355, -17.664958667915567});
mbspline.push_back(std::array<double_t, 3>{96.600933131737563, 795634.82612724102, -18.507252574422342});
mbspline.push_back(std::array<double_t, 3>{74.396528466503199, 795644.15197722265, -19.486466824791489});
mbspline.push_back(std::array<double_t, 3>{57.904064863643548, 795651.40866120602, -20.284702062681824});
mbspline.push_back(std::array<double_t, 3>{53.376583256660737, 795653.49130273412, -20.524205837164804});
mbspline.push_back(std::array<double_t, 3>{52.912895391486195, 795653.7138728986, -20.550914255620103});
mbspline.push_back(std::array<double_t, 3>{45.985043652243213, 795657.17779878783, -20.98390499430581});
mbspline.push_back(std::array<double_t, 3>{34.972484839863064, 795662.9043293877, -21.728353974579065});
mbspline.push_back(std::array<double_t, 3>{30.216791339106411, 795665.4724038979, -22.075044036047821});
mbspline.push_back(std::array<double_t, 3>{35.073773127999999, 795662.75249408628, -21.694256661054936});
mbspline.push_back(std::array<double_t, 3>{40.722194630291334, 795659.47640958708, -21.219224404638307});
mbspline.push_back(std::array<double_t, 3>{35.249214789145157, 795662.76019744365, -21.711792575847021});
mbspline.push_back(std::array<double_t, 3>{19.489769618479542, 795672.53105342132, -23.226275248010904});
mbspline.push_back(std::array<double_t, 3>{8.0567531562828663, 795679.84818390082, -24.397016115618772});
mbspline.push_back(std::array<double_t, 3>{7.3524755653624148, 795680.31300706684, -24.473711930809337});
mbspline.push_back(std::array<double_t, 3>{5.8590892461523527, 795681.32850978139, -24.646347395154876});
mbspline.push_back(std::array<double_t, 3>{-3.747968539664762, 795688.05345027684, -25.823211989889234});
mbspline.push_back(std::array<double_t, 3>{-9.1980671439486201, 795691.97752128053, -26.529544772087213});
mbspline.push_back(std::array<double_t, 3>{3.5160176597430204, 795682.56909852184, -24.788986560994204});
mbspline.push_back(std::array<double_t, 3>{28.091871078923038, 795663.89144992572, -21.240233328206873});
mbspline.push_back(std::array<double_t, 3>{42.259685800940495, 795652.84055443807, -19.08530870730576});
mbspline.push_back(std::array<double_t, 3>{31.008012278348065, 795661.84189327387, -20.885576477942266});
mbspline.push_back(std::array<double_t, 3>{1.8338533843194809, 795685.76470351045, -25.789752564798572});
mbspline.push_back(std::array<double_t, 3>{-24.34380148929904, 795707.75393355719, -30.407490864832695});
mbspline.push_back(std::array<double_t, 3>{-32.876787223594924, 795715.09230132855, -31.985239944396724});
mbspline.push_back(std::array<double_t, 3>{-23.085677554599631, 795706.47612484731, -30.089681124417119});
mbspline.push_back(std::array<double_t, 3>{-5.3264680088128982, 795690.49283624161, -26.493441184681927});
mbspline.push_back(std::array<double_t, 3>{5.8495638584560785, 795680.21088690893, -24.128592834636912});
mbspline.push_back(std::array<double_t, 3>{4.1304267105998846, 795681.8268758374, -24.508350235105304});
mbspline.push_back(std::array<double_t, 3>{-3.2969270406912883, 795688.95713541936, -26.2196125299754});
mbspline.push_back(std::array<double_t, 3>{-8.8285212090283718, 795694.37809764757, -27.547748262099322});
mbspline.push_back(std::array<double_t, 3>{-14.493178495608625, 795700.04275495349, -28.963912593571433});
mbspline.push_back(std::array<double_t, 3>{-22.034926086374423, 795707.73533755471, -30.925521171729194});
mbspline.push_back(std::array<double_t, 3>{-25.321344706089892, 795711.15321294055, -31.81416877779451});
mbspline.push_back(std::array<double_t, 3>{-21.731608082050219, 795707.34809204016, -30.805811718125689});
mbspline.push_back(std::array<double_t, 3>{-19.103421263240406, 795704.50965023425, -30.039432419433886});
mbspline.push_back(std::array<double_t, 3>{-21.990814742127888, 795707.68578304828, -30.912868939739084});
mbspline.push_back(std::array<double_t, 3>{-22.984621074744904, 795708.79884611489, -31.224526591170299});
mbspline.push_back(std::array<double_t, 3>{-17.753411573052844, 795702.83526728768, -29.524906626598142});
mbspline.push_back(std::array<double_t, 3>{-15.596699142262226, 795700.33348085033, -28.799388554530033});
mbspline.push_back(std::array<double_t, 3>{-23.718568213164939, 795709.91728631081, -31.62661115260634});
mbspline.push_back(std::array<double_t, 3>{-34.640861216620401, 795723.02403785673, -35.558636598903249});
mbspline.push_back(std::array<double_t, 3>{-40.085214814524676, 795729.66614926956, -37.584480586966556});
mbspline.push_back(std::array<double_t, 3>{-42.520267654832182, 795732.6856148229, -38.520514918143206});
mbspline.push_back(std::array<double_t, 3>{-44.324304773068995, 795734.95870156691, -39.236537234669534});
mbspline.push_back(std::array<double_t, 3>{-41.098001328326077, 795730.82903314254, -37.915043334297252});
mbspline.push_back(std::array<double_t, 3>{-33.117274517020689, 795720.45408835995, -34.543186303592833});
mbspline.push_back(std::array<double_t, 3>{-30.311621451024561, 795716.75062634377, -33.321043848296164});
mbspline.push_back(std::array<double_t, 3>{-40.13239565062733, 795729.91046380519, -37.729589409145333});
mbspline.push_back(std::array<double_t, 3>{-56.635779009185676, 795752.35506526718, -45.360753938282002});
mbspline.push_back(std::array<double_t, 3>{-64.951954008764829, 795763.83138680621, -49.320084883094637});
mbspline.push_back(std::array<double_t, 3>{-57.643326898495651, 795753.59930877259, -45.738857543253296});
mbspline.push_back(std::array<double_t, 3>{-44.602592591804068, 795735.08146611752, -39.165023422381047});
mbspline.push_back(std::array<double_t, 3>{-41.9345451638791, 795731.23947788891, -37.781907684328736});
mbspline.push_back(std::array<double_t, 3>{-53.531578213701991, 795748.17114612239, -43.961966582607204});
mbspline.push_back(std::array<double_t, 3>{-67.624743306863508, 795769.02903052478, -51.679383835747132});
mbspline.push_back(std::array<double_t, 3>{-71.023278994505873, 795774.12683409301, -53.591060187264915});
mbspline.push_back(std::array<double_t, 3>{-65.187955976307535, 795765.25714311481, -50.220577619516405});
mbspline.push_back(std::array<double_t, 3>{-64.403924150690784, 795764.0497341014, -49.755725148459412});
mbspline.push_back(std::array<double_t, 3>{-75.560953567168298, 795781.45469995576, -56.543661818023075});
mbspline.push_back(std::array<double_t, 3>{-87.173969223529326, 795799.80326459534, -63.791344811923288});
mbspline.push_back(std::array<double_t, 3>{-85.566650217960387, 795797.23155420646, -62.762660664495144});
mbspline.push_back(std::array<double_t, 3>{-76.013018847521451, 795781.75467145664, -56.494523179301439});
mbspline.push_back(std::array<double_t, 3>{-77.041960968215491, 795783.44213667128, -57.186383973498955});
mbspline.push_back(std::array<double_t, 3>{-95.574186202892648, 795814.20563067577, -69.95323403307097});
mbspline.push_back(std::array<double_t, 3>{-118.06377511665637, 795851.98814010143, -85.82188801295537});
mbspline.push_back(std::array<double_t, 3>{-127.97065909047244, 795868.82984288665, -92.979611709294758});
mbspline.push_back(std::array<double_t, 3>{-124.90100906924572, 795863.55004470958, -90.709298432569923});
mbspline.push_back(std::array<double_t, 3>{-120.80206665211995, 795856.41788487846, -87.606808895018432});
mbspline.push_back(std::array<double_t, 3>{-122.32688072742422, 795859.10155768902, -88.787624948507911});
mbspline.push_back(std::array<double_t, 3>{-125.79861663228466, 795865.2812476129, -91.537586970853852});
mbspline.push_back(std::array<double_t, 3>{-128.75828653745967, 795870.60865341197, -93.934919566813306});
mbspline.push_back(std::array<double_t, 3>{-137.01801533051136, 795885.64135974948, -100.77480091985268});
mbspline.push_back(std::array<double_t, 3>{-155.77371270142714, 795920.15184301278, -116.64962326775897});
mbspline.push_back(std::array<double_t, 3>{-178.47317348450497, 795962.37284016656, -136.28238698945532});
mbspline.push_back(std::array<double_t, 3>{-192.22201125369344, 795988.22065512871, -148.43086000078344});
mbspline.push_back(std::array<double_t, 3>{-194.42715440695613, 795992.41042700678, -150.42100158914508});
mbspline.push_back(std::array<double_t, 3>{-194.84598319506668, 795993.21457824972, -150.8069941711164});
mbspline.push_back(std::array<double_t, 3>{-200.93921450111273, 796005.03544710402, -156.54011562417773});
mbspline.push_back(std::array<double_t, 3>{-212.75549674817742, 796028.1953603077, -167.88847309334031});
mbspline.push_back(std::array<double_t, 3>{-231.06073740837564, 796064.43973675848, -185.82943940850856});
mbspline.push_back(std::array<double_t, 3>{-256.84183974503918, 796116.00194146286, -211.6105417761157});
mbspline.push_back(std::array<double_t, 3>{-282.57713836037209, 796167.98724464455, -237.8631198723277});
mbspline.push_back(std::array<double_t, 3>{-297.20808837524726, 796197.83438264683, -253.08516023919984});
mbspline.push_back(std::array<double_t, 3>{-303.44651340287993, 796210.68553815281, -259.70350529809002});
mbspline.push_back(std::array<double_t, 3>{-318.37049122671186, 796241.72741199355, -275.84527967849726});
mbspline.push_back(std::array<double_t, 3>{-350.40644479533012, 796309.00291454536, -311.1649185484668});
mbspline.push_back(std::array<double_t, 3>{-386.54255844321631, 796385.61147546303, -351.76745582640967});
mbspline.push_back(std::array<double_t, 3>{-411.3115275614731, 796438.61706938187, -380.12544857639813});
mbspline.push_back(std::array<double_t, 3>{-429.09010119073253, 796477.01878861175, -400.86237706339631});
mbspline.push_back(std::array<double_t, 3>{-457.57658016843726, 796539.11931286787, -434.7071628286829});
mbspline.push_back(std::array<double_t, 3>{-504.93207086815386, 796643.30139238818, -492.00730655437735});
mbspline.push_back(std::array<double_t, 3>{-560.66664082787452, 796767.0321376177, -560.67787011162545});
mbspline.push_back(std::array<double_t, 3>{-607.63028465807406, 796872.23069980182, -619.58906493711015});
mbspline.push_back(std::array<double_t, 3>{-641.42712432471035, 796948.61155736423, -662.74424941213056});
mbspline.push_back(std::array<double_t, 3>{-677.66638120773814, 797031.23706302256, -709.84078761772241});
mbspline.push_back(std::array<double_t, 3>{-738.09719996671265, 797170.22794609808, -789.7605453455011});
mbspline.push_back(std::array<double_t, 3>{-829.89058365981543, 797383.18859641138, -913.27772261140194});
mbspline.push_back(std::array<double_t, 3>{-940.32467409708272, 797641.60436815931, -1064.450949156969});
mbspline.push_back(std::array<double_t, 3>{-1050.6699367533256, 797902.01918807079, -1218.095692929842});
mbspline.push_back(std::array<double_t, 3>{-1153.8638787933003, 798147.62077014474, -1364.228634275479});
mbspline.push_back(std::array<double_t, 3>{-1261.3311794446802, 798405.54229169269, -1518.9815471949355});
mbspline.push_back(std::array<double_t, 3>{-1400.1015073756864, 798741.36648530781, -1722.1551843454884});
mbspline.push_back(std::array<double_t, 3>{-1599.4134929828774, 799227.68773028918, -2018.811143845227});
mbspline.push_back(std::array<double_t, 3>{-1863.5528010171925, 799877.47042817017, -2418.4275031137922});
mbspline.push_back(std::array<double_t, 3>{-2162.199456974849, 800618.11413503136, -2877.6266014214493});
mbspline.push_back(std::array<double_t, 3>{-2478.9263316447377, 801409.93132178334, -3372.5123431894176});
mbspline.push_back(std::array<double_t, 3>{-2865.5121965574181, 802384.12770139426, -3986.2560623639306});
mbspline.push_back(std::array<double_t, 3>{-3401.0206339464567, 803744.31913242047, -4849.9776211024609});
mbspline.push_back(std::array<double_t, 3>{-4093.7201515852839, 805517.62989747326, -5984.8965106704381});
mbspline.push_back(std::array<double_t, 3>{-4874.7961287003836, 807532.80591841496, -7284.6850441678243});
mbspline.push_back(std::array<double_t, 3>{-5704.8971217520075, 809691.06850038108, -8687.555722466368});
mbspline.push_back(std::array<double_t, 3>{-6650.3307283964677, 812168.10454964463, -10310.014334639067});
mbspline.push_back(std::array<double_t, 3>{-7848.7459633818326, 815331.92076980916, -12398.133039817723});
mbspline.push_back(std::array<double_t, 3>{-9398.6759398747654, 819454.7345072499, -15139.804175195593});
mbspline.push_back(std::array<double_t, 3>{-11213.975899427049, 824319.73839878524, -18399.35678248054});
mbspline.push_back(std::array<double_t, 3>{-13035.203852368559, 829237.05387160555, -21718.544726552191});
mbspline.push_back(std::array<double_t, 3>{-14797.407018845994, 834030.24648457207, -24977.915703470248});
mbspline.push_back(std::array<double_t, 3>{-16887.871392531662, 839758.11886843503, -28901.508286391621});
mbspline.push_back(std::array<double_t, 3>{-19742.615173905633, 847637.21170479641, -34338.082343321243});
mbspline.push_back(std::array<double_t, 3>{-23366.971447225696, 857712.92214450345, -41340.701098832513});
mbspline.push_back(std::array<double_t, 3>{-27556.014305679273, 869442.2421480756, -49551.225101264434});
mbspline.push_back(std::array<double_t, 3>{-32231.678948510151, 882627.61644092994, -58846.913977776952});
mbspline.push_back(std::array<double_t, 3>{-37137.922620532801, 896561.34846944234, -68739.863717997971});
mbspline.push_back(std::array<double_t, 3>{-41651.579482896625, 909470.40709582216, -77969.840635874338});
mbspline.push_back(std::array<double_t, 3>{-45407.795599467659, 920288.30951157224, -85758.73037523283});
mbspline.push_back(std::array<double_t, 3>{-48722.61491218445, 929901.28551840002, -92728.137980145737});
mbspline.push_back(std::array<double_t, 3>{-51888.73227253458, 939146.34821050754, -99477.033745300898});
mbspline.push_back(std::array<double_t, 3>{-54263.163657827281, 946127.17648331192, -104607.94252584457});
mbspline.push_back(std::array<double_t, 3>{-54836.977368920998, 947825.66506814817, -105864.82407862232});
mbspline.push_back(std::array<double_t, 3>{-53941.685961434625, 945157.69667389663, -103877.18762494801});
mbspline.push_back(std::array<double_t, 3>{-53380.46071934497, 943474.02094771923, -102614.43083038316});
mbspline.push_back(std::array<double_t, 3>{-54194.669542126554, 945932.93159241369, -104470.90836704771});
mbspline.push_back(std::array<double_t, 3>{-55194.598280821199, 948972.71495816787, -106781.14372511339});
mbspline.push_back(std::array<double_t, 3>{-54633.347332916819, 947255.28705773759, -105467.31138140459});
mbspline.push_back(std::array<double_t, 3>{-52535.859833566865, 940795.02555969788, -100492.9100278814});
mbspline.push_back(std::array<double_t, 3>{-50601.635718643192, 934798.93080351304, -95845.936591899866});
mbspline.push_back(std::array<double_t, 3>{-50374.310211238633, 934089.67522044817, -95292.717237138029});
mbspline.push_back(std::array<double_t, 3>{-52001.266034797016, 939198.31650640036, -99303.000646593806});
mbspline.push_back(std::array<double_t, 3>{-54311.397801327214, 946498.33288873441, -105070.01358871559});
mbspline.push_back(std::array<double_t, 3>{-55588.069936733911, 950558.15027952532, -108297.56841455186});
mbspline.push_back(std::array<double_t, 3>{-54775.839019330742, 947959.01134398009, -106218.25726623229});
mbspline.push_back(std::array<double_t, 3>{-52646.054062977193, 941101.10378462239, -100697.64168103076});
mbspline.push_back(std::array<double_t, 3>{-51240.371497749489, 936546.69227343961, -97008.568357098353});
mbspline.push_back(std::array<double_t, 3>{-51685.861093021944, 937998.98835407698, -98192.189662857389});
mbspline.push_back(std::array<double_t, 3>{-53520.019353814285, 944015.02744949097, -103125.34172110932});
mbspline.push_back(std::array<double_t, 3>{-56047.925443155, 952357.11754471634, -110007.56605000173});
mbspline.push_back(std::array<double_t, 3>{-58836.667334110556, 961615.74062246853, -117692.22320435195});
mbspline.push_back(std::array<double_t, 3>{-61056.106528802688, 969028.66753265902, -123882.01717429397});
mbspline.push_back(std::array<double_t, 3>{-62309.904021513416, 973241.42710843612, -127420.73521817331});
mbspline.push_back(std::array<double_t, 3>{-63800.058643159617, 978278.14972952905, -131676.76583293572});
mbspline.push_back(std::array<double_t, 3>{-66624.722675937694, 987882.00744101079, -139840.0448877264});
mbspline.push_back(std::array<double_t, 3>{-69876.388937652329, 999002.70605587773, -149348.24220326854});
mbspline.push_back(std::array<double_t, 3>{-72744.03625856193, 1008867.412839608, -157831.89003710548});
mbspline.push_back(std::array<double_t, 3>{-76829.353738751379, 1023002.6113210539, -170058.83672354801});
mbspline.push_back(std::array<double_t, 3>{-83604.853779220299, 1046581.3514618831, -190572.34064606702});
mbspline.push_back(std::array<double_t, 3>{-91863.41679065027, 1075486.3220018786, -215864.18986855424});
mbspline.push_back(std::array<double_t, 3>{-100494.92218531082, 1105869.2209911263, -242601.14097913026});
mbspline.push_back(std::array<double_t, 3>{-110938.95291058088, 1142841.0897582741, -275321.24483778293});
mbspline.push_back(std::array<double_t, 3>{-124753.58146425529, 1192021.1674092689, -319091.5139470913});
mbspline.push_back(std::array<double_t, 3>{-141504.30105280236, 1251988.7435364835, -372762.4945811425});
mbspline.push_back(std::array<double_t, 3>{-159686.30648891046, 1317443.9631069486, -431672.19219499035});
mbspline.push_back(std::array<double_t, 3>{-178409.76844274317, 1385222.8953800295, -493012.12590231531});
mbspline.push_back(std::array<double_t, 3>{-198690.34081992606, 1459044.1788330877, -560189.49384470168});
mbspline.push_back(std::array<double_t, 3>{-221921.61166067095, 1544070.630110173, -637988.69676319766});
mbspline.push_back(std::array<double_t, 3>{-245212.34677819471, 1629780.5353425699, -716841.80957692047});
mbspline.push_back(std::array<double_t, 3>{-261800.71680919291, 1691157.5044571038, -773615.50600771664});
mbspline.push_back(std::array<double_t, 3>{-269905.6202748447, 1721307.7453491245, -801655.2300371055});
mbspline.push_back(std::array<double_t, 3>{-278069.30489221599, 1751839.9258181774, -830202.81877574942});
mbspline.push_back(std::array<double_t, 3>{-299928.48585124954, 1834030.4462244206, -907461.9079578789});
mbspline.push_back(std::array<double_t, 3>{-352442.03999563307, 2032531.6808902714, -1095045.5747171848});
mbspline.push_back(std::array<double_t, 3>{-471387.35415452934, 2484523.8746937779, -1524438.1588302304});
mbspline.push_back(std::array<double_t, 3>{-728561.48521987256, 3466929.0553626269, -2462635.1063682497});
mbspline.push_back(std::array<double_t, 3>{-1215858.1273864612, 5338148.1612822786, -4259005.4480510689});
mbspline.push_back(std::array<double_t, 3>{-2007999.4887998982, 8395813.8163375277, -7209652.8051787857});
mbspline.push_back(std::array<double_t, 3>{-3132181.3315209653, 12757639.366092436, -11440623.588438289});
mbspline.push_back(std::array<double_t, 3>{-4603782.4609684879, 18496883.770937558, -17036386.88316207});
mbspline.push_back(std::array<double_t, 3>{-6566635.9318869701, 26191269.376936533, -24576884.777039617});
mbspline.push_back(std::array<double_t, 3>{-6427113.193620366, 25641549.788165107, -24035410.982098777});
mbspline.push_back(std::array<double_t, 3>{-4637495.236036432, 18554662.676132612, -17019392.741186496});
mbspline.push_back(std::array<double_t, 3>{-2584121.0449605905, 10382233.395650044, -8887825.6071056258});
mbspline.push_back(std::array<double_t, 3>{-1264041.7966914831, 5101916.4025744619, -3607508.6140308948});
mbspline.push_back(std::array<double_t, 3>{-574021.02315782662, 2328032.8929699338, -819755.68687911856});
mbspline.push_back(std::array<double_t, 3>{-254391.91562071163, 1036731.2985203643, 484458.92351456737});
mbspline.push_back(std::array<double_t, 3>{-110532.13300773366, 452660.58111173526, 1077290.7016842633});
mbspline.push_back(std::array<double_t, 3>{-48034.233450479522, 197669.15091813452, 1337381.9604817396});
mbspline.push_back(std::array<double_t, 3>{-20695.089585564579, 85578.661072092553, 1452274.7125738205});
mbspline.push_back(std::array<double_t, 3>{-8960.3086673116104, 37231.363688590071, 1502072.4288791378});
mbspline.push_back(std::array<double_t, 3>{-3854.3993181850933, 16092.89898306903, 1523950.7398494943});
mbspline.push_back(std::array<double_t, 3>{-1667.6670941820012, 6996.0929312146291, 1533411.4181434247});
mbspline.push_back(std::array<double_t, 3>{-717.16554427931601, 3022.9964527650936, 1537563.3039632544});
mbspline.push_back(std::array<double_t, 3>{-310.25030279123126, 1313.9524383878802, 1539357.8001784848});
mbspline.push_back(std::array<double_t, 3>{-133.41439094376727, 567.70489022640504, 1540145.0913419696});
mbspline.push_back(std::array<double_t, 3>{-57.713989311692721, 246.73518740450294, 1540485.3192268559});
mbspline.push_back(std::array<double_t, 3>{-24.818254699021413, 106.59935804101569, 1540634.5638850362});
mbspline.push_back(std::array<double_t, 3>{-10.736026005656841, 46.327419317660798, 1540699.0548593798});
mbspline.push_back(std::array<double_t, 3>{-4.616770310728044, 20.014620025912379, 1540727.3411184067});
mbspline.push_back(std::array<double_t, 3>{-1.997112352411065, 8.697697693401528, 1540739.5633944746});
mbspline.push_back(std::array<double_t, 3>{-0.85881318836389853, 3.7574791594919277, 1540744.9235317593});
mbspline.push_back(std::array<double_t, 3>{-0.37148912354679919, 1.6327459317464907, 1540747.2394913107});
mbspline.push_back(std::array<double_t, 3>{-0.15976839941503732, 0.70540908701516047, 1540748.2549252349});
mbspline.push_back(std::array<double_t, 3>{-0.069094076394862258, 0.30644210311581782, 1540748.6937888763});
mbspline.push_back(std::array<double_t, 3>{-0.029703906206994181, 0.1323371144980327, 1540748.8861753717});
mbspline.push_back(std::array<double_t, 3>{-0.012863657235070883, 0.057566446555977521, 1540748.9691707713});
mbspline.push_back(std::array<double_t, 3>{-0.005530389777557018, 0.024860123958112806, 1540749.0056382648});
mbspline.push_back(std::array<double_t, 3>{-0.0023937731483313742, 0.010808109408029034, 1540749.0213764899});
mbspline.push_back(std::array<double_t, 3>{-0.0010246644801168308, 0.0046470769558316881, 1540749.0283077017});
mbspline.push_back(std::array<double_t, 3>{-0.00043248147274318219, 0.001970307521935632, 1540749.0313325664});
mbspline.push_back(std::array<double_t, 3>{-0.0001923097407546951, 0.00087984604955128191, 1540749.032570333});
mbspline.push_back(std::array<double_t, 3>{-8.3768639647162685e-05, 0.00038488985075222346, 1540749.0331345932});
mbspline.push_back(std::array<double_t, 3>{-2.5298420761438452e-05, 0.00011705567925060265, 1540749.0334413096});
mbspline.push_back(std::array<double_t, 3>{-4.9718563867012499e-06, 2.3357649582205486e-05, 1540749.0335492869});
mbspline.push_back(std::array<double_t, 3>{-1.2216935080628765e-05, 5.6732086197475479e-05, 1540749.0335108526});
mbspline.push_back(std::array<double_t, 3>{4.7752745150320837e-06, -2.2151755968483916e-05, 1540749.0336024039});
mbspline.push_back(std::array<double_t, 3>{2.7335462390069549e-06, -1.2681454934397335e-05, 1540749.033591422});
mbspline.push_back(std::array<double_t, 3>{-1.2818247900550392e-06, 6.0278682361079864e-06, 1540749.0335696295});
mbspline.push_back(std::array<double_t, 3>{1.1807774953168886e-05, -5.5660651876593672e-05, 1540749.0336423097});
mbspline.push_back(std::array<double_t, 3>{-1.7025565700481471e-05, 8.0512279856562624e-05, 1540749.033481532});
mbspline.push_back(std::array<double_t, 3>{2.0519946572172039e-05, -9.7469921738468888e-05, 1540749.0336924612});
mbspline.push_back(std::array<double_t, 3>{1.0597317030440119e-05, -5.0583012766990956e-05, 1540749.0336370764});
mbspline.push_back(std::array<double_t, 3>{1.7748563531490677e-05, -8.5023974421505821e-05, 1540749.0336785417});
double_t db = 0.01;
double_t bsat = 2.4;
return MaterialProperties(std::make_shared<NonlinearIsotropicMagneticMaterial>(mbspline, db, bsat));
}
\ No newline at end of file
...@@ -53,28 +53,34 @@ protected: ...@@ -53,28 +53,34 @@ protected:
class NonlinearIsotropicMagneticMaterial : public MagneticMaterialInterface { class NonlinearIsotropicMagneticMaterial : public MagneticMaterialInterface {
public: public:
NonlinearIsotropicMagneticMaterial() { NonlinearIsotropicMagneticMaterial() {
dB = 1.0; DeltaB = 1.0;
BSaturation = 2.0; BSaturation = 2.0;
double_t a0 = 0.0; double_t a0 = 0.0;
double_t b0 = 0.999 / mu_0; double_t b0 = 0.999 / mu_0;
double_t c0 = 0.0; double_t c0 = 0.0;
BHSpline.push_back(std::array<double_t, 3>{a0,b0,c0}); MBSpline.push_back(std::array<double_t, 3>{a0,b0,c0});
double_t a1 = -b0 / 2.0; double_t a1 = -b0 / 2.0;
double_t b1 = -4.0 * a1; double_t b1 = -4.0 * a1;
double_t c1 = b0 - a1 - b1; double_t c1 = b0 - a1 - b1;
BHSpline.push_back(std::array<double_t, 3>{a1,b1,c1}); MBSpline.push_back(std::array<double_t, 3>{a1,b1,c1});
MSaturation = (a1 * BSaturation + b1) * BSaturation + c1; MSaturation = (a1 * BSaturation + b1) * BSaturation + c1;
}; };
NonlinearIsotropicMagneticMaterial(std::vector<std::array<double_t,3>> mbspline, double_t db, double_t bsat) : MBSpline(mbspline), DeltaB(db), BSaturation(bsat) {
const auto &s = MBSpline.back();
MSaturation = (s[0] * BSaturation + s[1]) * BSaturation + s[2];
}
void h_from_b(std::vector<size_t> const &index, Array &Fx, Array &Fy, Array &dFxdx, Array &dFydy, Array &dFxdy) override { void h_from_b(std::vector<size_t> const &index, Array &Fx, Array &Fy, Array &dFxdx, Array &dFydy, Array &dFxdy) override {
for(size_t const &i : index) { for(size_t const &i : index) {
const double_t &Bx = Fx(i); const double_t &Bx = Fx(i);
const double_t &By = Fy(i); const double_t &By = Fy(i);
double_t B = sqrt(Bx * Bx + By * By); double_t B = sqrt(Bx * Bx + By * By);
double_t M, dMdB; double_t M, dMdB;
...@@ -83,8 +89,8 @@ public: ...@@ -83,8 +89,8 @@ public:
M = MSaturation; M = MSaturation;
dMdB = 0.0; dMdB = 0.0;
} else { } else {
size_t j = (size_t)(B / dB); size_t j = (size_t)(B / DeltaB);
const auto &s = BHSpline[j]; const auto &s = MBSpline[j];
M = (s[0] * B + s[1]) * B + s[2]; M = (s[0] * B + s[1]) * B + s[2];
dMdB = (2.0 * s[0] * B + s[1]); dMdB = (2.0 * s[0] * B + s[1]);
...@@ -116,8 +122,8 @@ public: ...@@ -116,8 +122,8 @@ public:
} }
protected: protected:
std::vector<std::array<double_t,3>> BHSpline; std::vector<std::array<double_t,3>> MBSpline;
double_t dB; double_t DeltaB;
double_t MSaturation; double_t MSaturation;
double_t BSaturation; double_t BSaturation;
}; };
...@@ -126,4 +132,6 @@ inline MaterialProperties Air() { ...@@ -126,4 +132,6 @@ inline MaterialProperties Air() {
return MaterialProperties(std::make_shared<LinearIsotropicMagneticMaterial>(1.0)); return MaterialProperties(std::make_shared<LinearIsotropicMagneticMaterial>(1.0));
} }
MaterialProperties JFE_35JN210();
#endif //OERSTED_MATERIALPROPERTIES_H #endif //OERSTED_MATERIALPROPERTIES_H
...@@ -152,22 +152,29 @@ public: ...@@ -152,22 +152,29 @@ public:
calculate_forcing(s->f); calculate_forcing(s->f);
linearize(s->J, s->v, s->r, s->f, s->Fx, s->Fy, s->dFxdGx, s->dFydGy, s->dFxdGy); linearize(s->J, s->v, s->r, s->f, s->Fx, s->Fy, s->dFxdGx, s->dFydGy, s->dFxdGy);
for (size_t iter = 0; iter != 20; ++iter) { size_t iter = 0;
double_t norm_dv = 1.0;
while (iter < 30 && norm_dv > sqrt(DBL_EPSILON) * std::sqrt(s->v.size())) {
s->Solver.compute(s->J); s->Solver.compute(s->J);
if (s->Solver.info() != Eigen::Success) { if (s->Solver.info() != Eigen::Success) {
std::cerr << "Factorization of Jacobian failed"; std::cerr << "Factorization of Jacobian failed";
} }
s->v -= 1.0 * s->Solver.solve(s->r); auto dv = s->Solver.solve(s->r);
if (s->Solver.info() != Eigen::Success) { if (s->Solver.info() != Eigen::Success) {
std::cerr << "Solution of linear system failed"; std::cerr << "Solution of linear system failed";
} }
s->v -= dv;
norm_dv = dv.norm() / s->v.norm();
linearize(s->J, s->v, s->r, s->f, s->Fx, s->Fy, s->dFxdGx, s->dFydGy, s->dFxdGy); linearize(s->J, s->v, s->r, s->f, s->Fx, s->Fy, s->dFxdGx, s->dFydGy, s->dFxdGy);
std::cout << s->r.norm() << std::endl; iter++;
} }
} }
......
...@@ -153,7 +153,7 @@ public: ...@@ -153,7 +153,7 @@ public:
v0 = sk.new_element<Vertex>(0.0, 0.0); v0 = sk.new_element<Vertex>(0.0, 0.0);
v1 = sk.new_element<Vertex>(1.0, 0.0); v1 = sk.new_element<Vertex>(1.0, 0.0);
v2 = sk.new_element<Vertex>(2.0, 0.0); v2 = sk.new_element<Vertex>(2.0, 0.0);
v3 = sk.new_element<Vertex>(sqrt(3.0)/2.0, 0.5); v3 = sk.new_element<Vertex>(sqrt(3.0) / 2.0, 0.5);
v4 = sk.new_element<Vertex>(sqrt(3.0), 1.0); v4 = sk.new_element<Vertex>(sqrt(3.0), 1.0);
f0 = sk.new_element<Fixation>(v0); f0 = sk.new_element<Fixation>(v0);
...@@ -261,9 +261,9 @@ public: ...@@ -261,9 +261,9 @@ public:
me.save_as(SAVE_DIR, std::string("sixth_circle_mirror_copy_mesh")); me.save_as(SAVE_DIR, std::string("sixth_circle_mirror_copy_mesh"));
// Create FiniteElementMesh // Create FiniteElementMesh
fem = FiniteElementMesh<2,1>(me); fem = FiniteElementMesh<2, 1>(me);
for (auto & pb : periodic_boundary) { for (auto &pb : periodic_boundary) {
EXPECT_EQ(fem.boundary(pb.curve0()).size(), 1); EXPECT_EQ(fem.boundary(pb.curve0()).size(), 1);
EXPECT_EQ(fem.boundary(pb.curve1()).size(), 1); EXPECT_EQ(fem.boundary(pb.curve1()).size(), 1);
...@@ -288,7 +288,7 @@ public: ...@@ -288,7 +288,7 @@ public:
Sketch sk; Sketch sk;
Mesh me; Mesh me;
FiniteElementMesh<2,1> fem; FiniteElementMesh<2, 1> fem;
// Sketch Variables // Sketch Variables
std::shared_ptr<Vertex> v0; std::shared_ptr<Vertex> v0;
...@@ -299,7 +299,7 @@ public: ...@@ -299,7 +299,7 @@ public:
std::shared_ptr<Fixation> f0; std::shared_ptr<Fixation> f0;
std::shared_ptr<LineSegment> l01 ; std::shared_ptr<LineSegment> l01;
std::shared_ptr<LineSegment> l12; std::shared_ptr<LineSegment> l12;
std::shared_ptr<LineSegment> l04; std::shared_ptr<LineSegment> l04;
...@@ -375,7 +375,7 @@ TEST_F(Sixth_Circle_Mirror_Copy, Magnetostatic_Uniform_Current_Density_Periodic) ...@@ -375,7 +375,7 @@ TEST_F(Sixth_Circle_Mirror_Copy, Magnetostatic_Uniform_Current_Density_Periodic)
double_t c_f = -2.0 * a_f * std::log(2.0) - a_f; double_t c_f = -2.0 * a_f * std::log(2.0) - a_f;
double_t a_h = 2 * a_f; double_t a_h = 2 * a_f;
double_t c_h = -2.0 * a_f * log(2.0); double_t c_h = -2.0 * a_f * log(2.0);
for(size_t i = 0; i!= fem.size_nodes(); ++i) { for (size_t i = 0; i != fem.size_nodes(); ++i) {
XY const &n = fem.node(i); XY const &n = fem.node(i);
double_t r = std::hypot(n.x(), n.y()); double_t r = std::hypot(n.x(), n.y());
if (r <= 1.0) { if (r <= 1.0) {
...@@ -412,7 +412,7 @@ TEST_F(Sixth_Circle_Mirror_Copy, Magnetostatic_Uniform_Current_Density_Periodic) ...@@ -412,7 +412,7 @@ TEST_F(Sixth_Circle_Mirror_Copy, Magnetostatic_Uniform_Current_Density_Periodic)
EXPECT_NEAR(Bmag(i), val, std::abs(2 * a_f * 0.05)); EXPECT_NEAR(Bmag(i), val, std::abs(2 * a_f * 0.05));
} else { } else {
double_t val = std::abs(a_h / r); double_t val = std::abs(a_h / r);
EXPECT_NEAR(Bmag(i), val, std::abs(a_h* 0.05)); EXPECT_NEAR(Bmag(i), val, std::abs(a_h * 0.05));
} }
double_t a = std::atan2(qp[i][0].y(), qp[i][0].x()) * 180 / M_PI + 90.0; double_t a = std::atan2(qp[i][0].y(), qp[i][0].x()) * 180 / M_PI + 90.0;
...@@ -476,9 +476,9 @@ TEST_F(Sixth_Circle_Mirror_Copy, Magnetostatic_Uniform_Current_Density_Antieriod ...@@ -476,9 +476,9 @@ TEST_F(Sixth_Circle_Mirror_Copy, Magnetostatic_Uniform_Current_Density_Antieriod
double_t c_h = a_f / 321.0; double_t c_h = a_f / 321.0;
double_t d_h = -64.0 / 321.0 * a_f; double_t d_h = -64.0 / 321.0 * a_f;
double_t r_max = - (2.0 * b_f) / (3.0 * a_f); double_t r_max = -(2.0 * b_f) / (3.0 * a_f);
double_t tol_a = (a_f * r_max + b_f) * r_max * r_max * 0.02; double_t tol_a = (a_f * r_max + b_f) * r_max * r_max * 0.02;
for(size_t i = 0; i!= fem.size_nodes(); ++i) { for (size_t i = 0; i != fem.size_nodes(); ++i) {
XY const &n = fem.node(i); XY const &n = fem.node(i);
double_t r = std::hypot(n.x(), n.y()); double_t r = std::hypot(n.x(), n.y());
double_t a = std::atan2(n.y(), n.x()); double_t a = std::atan2(n.y(), n.x());
...@@ -614,9 +614,9 @@ public: ...@@ -614,9 +614,9 @@ public:
me.save_as(SAVE_DIR, std::string("sixth_circle_mesh")); me.save_as(SAVE_DIR, std::string("sixth_circle_mesh"));
// Create FiniteElementMesh // Create FiniteElementMesh
fem = FiniteElementMesh<2,1>(me); fem = FiniteElementMesh<2, 1>(me);