Commit 194147e0 authored by Spencer Sherwin's avatar Spencer Sherwin
Browse files

Merge branch 'fix/IterativeStaticCond' into 'master'

Fix/iterative static cond

See merge request !483
parents 29740b87 47090749
......@@ -40,3 +40,9 @@ TARGET_LINK_LIBRARIES(SteadyLinearAdvectionReaction2D ${LinkLibraries})
SET(PostProcessingSource PostProcessing.cpp)
ADD_NEKTAR_EXECUTABLE(PostProcessing extra-demos PostProcessingSource)
TARGET_LINK_LIBRARIES(PostProcessing ${LinkLibraries})
ADD_NEKTAR_TEST(ProjectionCont2D_P7)
IF (NEKTAR_USE_MPI)
ADD_NEKTAR_TEST(ProjectionCont2D_P7_par)
ENDIF (NEKTAR_USE_MPI)
......@@ -21,7 +21,7 @@ int main(int argc, char *argv[])
Array<OneD,NekDouble> fce;
Array<OneD,NekDouble> xc0,xc1,xc2;
if(argc != 2)
if(argc < 2)
{
fprintf(stderr,"Usage: ProjectCont2D meshfile \n");
exit(1);
......@@ -105,10 +105,21 @@ int main(int argc, char *argv[])
Exp->BwdTrans(Exp->GetCoeffs(), Exp->UpdatePhys());
//-------------------------------------------
//-------------------------------------------
// Calculate error
Array<OneD,NekDouble> error(nq,0.0);
Vmath::Vsub(nq, Exp->GetPhys(), 1, Fce->GetPhys(), 1, error, 1);
//-------------------------------------------
//--------------------------------------------
// Calculate L_inf error
cout << "L infinity error: " << Exp->Linf(Fce->GetPhys()) << endl;
cout << "L 2 error: " << Exp->L2 (Fce->GetPhys()) << endl;
// Calculate L_inf and L_2 of error
NekDouble vL2Error = Exp->L2 (error);
NekDouble vLinfError = Exp->Linf(error);
if (vSession->GetComm()->GetRank() == 0)
{
cout << "L infinity error: " << vLinfError << endl;
cout << "L 2 error : " << vL2Error << endl;
}
//--------------------------------------------
vSession->Finalise();
......
<?xml version="1.0" encoding="utf-8"?>
<test>
<description>C0 Projection 2D with P=7</description>
<executable>ProjectCont2D</executable>
<parameters>ProjectionCont2D_P7.xml</parameters>
<files>
<file description="Session File">ProjectionCont2D_P7.xml</file>
</files>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-8">2.10047e-10</value>
</metric>
<metric type="Linf" id="2">
<value tolerance="1e-8">2.28465e-09</value>
</metric>
</metrics>
</test>
<?xml version="1.0" encoding="utf-8"?>
<NEKTAR xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.nektar.info/nektar.xsd">
<GEOMETRY DIM="2" SPACE="2">
<VERTEX>
<V ID="0"> -1.000000000000000 3.500000000000000 0.0 </V>
<V ID="1"> -1.000000000000000 0.500000000000000 0.0 </V>
<V ID="2"> -1.000000000000000 2.500000000000000 0.0 </V>
<V ID="3"> -1.000000000000000 1.500000000000000 0.0 </V>
<V ID="4"> 3.800000000000000 4.500000000000000 0.0 </V>
<V ID="5"> 0.200000000000000 4.500000000000000 0.0 </V>
<V ID="6"> 2.900000000000000 4.500000000000000 0.0 </V>
<V ID="7"> 2.000000000000000 4.500000000000000 0.0 </V>
<V ID="8"> 1.100000000000000 4.500000000000000 0.0 </V>
<V ID="9"> 5.000000000000000 0.500000000000000 0.0 </V>
<V ID="10"> 5.000000000000000 3.500000000000000 0.0 </V>
<V ID="11"> 5.000000000000000 1.500000000000000 0.0 </V>
<V ID="12"> 5.000000000000000 2.500000000000000 0.0 </V>
<V ID="13"> 0.200000000000000 -0.500000000000000 0.0 </V>
<V ID="14"> 3.800000000000000 -0.500000000000000 0.0 </V>
<V ID="15"> 1.100000000000000 -0.500000000000000 0.0 </V>
<V ID="16"> 2.000000000000000 -0.500000000000000 0.0 </V>
<V ID="17"> 2.900000000000000 -0.500000000000000 0.0 </V>
<V ID="18"> -0.400000000000000 4.000000000000000 0.0 </V>
<V ID="19"> 4.400000000000000 4.000000000000000 0.0 </V>
<V ID="20"> 4.400000000000000 0.0 0.0 </V>
<V ID="21"> -0.400000000000000 0.0 0.0 </V>
<V ID="22"> -0.040000000000000 2.700000000000000 0.0 </V>
<V ID="23"> 0.920000000000000 1.900000000000000 0.0 </V>
<V ID="24"> 1.880000000000000 1.100000000000000 0.0 </V>
<V ID="25"> 2.840000000000000 0.300000000000000 0.0 </V>
<V ID="26"> -0.119314370713000 1.785562178050000 0.0 </V>
<V ID="27"> 1.713659159880000 0.169773145192000 0.0 </V>
<V ID="28"> 0.677713625957000 1.180143861910000 0.0 </V>
<V ID="29"> -0.188491169544000 0.869785275722000 0.0 </V>
<V ID="30"> 0.715978655871000 0.336366878402000 0.0 </V>
<V ID="31"> 3.289084972900000 0.882472796343000 0.0 </V>
<V ID="32"> 3.682080702820000 1.501561993610000 0.0 </V>
<V ID="33"> 3.972007805980000 2.179240079990000 0.0 </V>
<V ID="34"> 4.218223358320000 2.817871076440000 0.0 </V>
<V ID="35"> 4.379282019760000 3.315489806910000 0.0 </V>
<V ID="36"> 3.668892462910000 3.970508359810000 0.0 </V>
<V ID="37"> 3.155413025260000 3.802413365130000 0.0 </V>
<V ID="38"> 2.269709494930000 3.615953163480000 0.0 </V>
<V ID="39"> 1.341308209110000 3.906056835480000 0.0 </V>
<V ID="40"> 0.934565531168000 3.565834210030000 0.0 </V>
<V ID="41"> 0.461690231830000 3.150972034220000 0.0 </V>
<V ID="42"> 1.383772742880000 2.431995597660000 0.0 </V>
<V ID="43"> 2.324656705230000 1.661732140030000 0.0 </V>
<V ID="44"> 3.642425028600000 3.246403386770000 0.0 </V>
<V ID="45"> 4.022057777820000 3.634175940310000 0.0 </V>
<V ID="46"> 1.833157069900000 2.985307743670000 0.0 </V>
<V ID="47"> 2.755342831120000 2.226765404480000 0.0 </V>
<V ID="48"> 3.179196984040000 2.779077508740000 0.0 </V>
</VERTEX>
<EDGE>
<E ID="0"> 1 21 </E>
<E ID="1"> 13 21 </E>
<E ID="2"> 13 15 </E>
<E ID="3"> 15 16 </E>
<E ID="4"> 16 17 </E>
<E ID="5"> 14 17 </E>
<E ID="6"> 1 3 </E>
<E ID="7"> 1 29 </E>
<E ID="8"> 21 29 </E>
<E ID="9"> 21 30 </E>
<E ID="10"> 13 30 </E>
<E ID="11"> 15 30 </E>
<E ID="12"> 15 27 </E>
<E ID="13"> 16 27 </E>
<E ID="14"> 16 25 </E>
<E ID="15"> 17 25 </E>
<E ID="16"> 3 29 </E>
<E ID="17"> 29 30 </E>
<E ID="18"> 27 30 </E>
<E ID="19"> 25 27 </E>
<E ID="20"> 2 3 </E>
<E ID="21"> 3 26 </E>
<E ID="22"> 26 29 </E>
<E ID="23"> 28 29 </E>
<E ID="24"> 28 30 </E>
<E ID="25"> 24 30 </E>
<E ID="26"> 24 27 </E>
<E ID="27"> 2 26 </E>
<E ID="28"> 26 28 </E>
<E ID="29"> 24 28 </E>
<E ID="30"> 0 2 </E>
<E ID="31"> 2 22 </E>
<E ID="32"> 22 26 </E>
<E ID="33"> 23 26 </E>
<E ID="34"> 23 28 </E>
<E ID="35"> 0 22 </E>
<E ID="36"> 22 23 </E>
<E ID="37"> 23 24 </E>
<E ID="38"> 24 25 </E>
<E ID="39"> 14 25 </E>
<E ID="40"> 0 18 </E>
<E ID="41"> 22 41 </E>
<E ID="42"> 23 42 </E>
<E ID="43"> 24 43 </E>
<E ID="44"> 25 31 </E>
<E ID="45"> 14 20 </E>
<E ID="46"> 18 41 </E>
<E ID="47"> 41 42 </E>
<E ID="48"> 42 43 </E>
<E ID="49"> 31 43 </E>
<E ID="50"> 20 31 </E>
<E ID="51"> 5 18 </E>
<E ID="52"> 40 41 </E>
<E ID="53"> 42 46 </E>
<E ID="54"> 43 47 </E>
<E ID="55"> 31 32 </E>
<E ID="56"> 9 20 </E>
<E ID="57"> 5 40 </E>
<E ID="58"> 40 46 </E>
<E ID="59"> 46 47 </E>
<E ID="60"> 32 47 </E>
<E ID="61"> 9 32 </E>
<E ID="62"> 5 8 </E>
<E ID="63"> 39 40 </E>
<E ID="64"> 38 46 </E>
<E ID="65"> 47 48 </E>
<E ID="66"> 32 33 </E>
<E ID="67"> 9 11 </E>
<E ID="68"> 8 39 </E>
<E ID="69"> 7 8 </E>
<E ID="70"> 38 39 </E>
<E ID="71"> 7 38 </E>
<E ID="72"> 38 48 </E>
<E ID="73"> 33 48 </E>
<E ID="74"> 11 33 </E>
<E ID="75"> 6 7 </E>
<E ID="76"> 37 38 </E>
<E ID="77"> 44 48 </E>
<E ID="78"> 33 34 </E>
<E ID="79"> 11 12 </E>
<E ID="80"> 6 37 </E>
<E ID="81"> 37 44 </E>
<E ID="82"> 34 44 </E>
<E ID="83"> 12 34 </E>
<E ID="84"> 4 6 </E>
<E ID="85"> 36 37 </E>
<E ID="86"> 44 45 </E>
<E ID="87"> 34 35 </E>
<E ID="88"> 10 12 </E>
<E ID="89"> 4 36 </E>
<E ID="90"> 36 45 </E>
<E ID="91"> 35 45 </E>
<E ID="92"> 10 35 </E>
<E ID="93"> 19 45 </E>
<E ID="94"> 4 19 </E>
<E ID="95"> 10 19 </E>
</EDGE>
<ELEMENT>
<T ID="0"> 6 7 16 </T>
<T ID="1"> 0 8 7 </T>
<T ID="2"> 9 17 8 </T>
<T ID="3"> 1 10 9 </T>
<T ID="4"> 2 11 10 </T>
<T ID="5"> 11 12 18 </T>
<T ID="6"> 3 13 12 </T>
<T ID="7"> 14 19 13 </T>
<T ID="8"> 4 15 14 </T>
<T ID="9"> 5 39 15 </T>
<T ID="10"> 21 27 20 </T>
<T ID="11"> 16 22 21 </T>
<T ID="12"> 23 28 22 </T>
<T ID="13"> 17 24 23 </T>
<T ID="14"> 24 25 29 </T>
<T ID="15"> 18 26 25 </T>
<T ID="16"> 19 38 26 </T>
<T ID="17"> 30 31 35 </T>
<T ID="18"> 27 32 31 </T>
<T ID="19"> 32 33 36 </T>
<T ID="20"> 28 34 33 </T>
<T ID="21"> 29 37 34 </T>
<Q ID="22"> 35 41 46 40 </Q>
<Q ID="23"> 36 42 47 41 </Q>
<Q ID="24"> 37 43 48 42 </Q>
<Q ID="25"> 38 44 49 43 </Q>
<Q ID="26"> 39 45 50 44 </Q>
<Q ID="27"> 46 52 57 51 </Q>
<Q ID="28"> 47 53 58 52 </Q>
<Q ID="29"> 48 54 59 53 </Q>
<Q ID="30"> 49 55 60 54 </Q>
<Q ID="31"> 50 56 61 55 </Q>
<Q ID="32"> 57 63 68 62 </Q>
<Q ID="33"> 58 64 70 63 </Q>
<Q ID="34"> 59 65 72 64 </Q>
<Q ID="35"> 60 66 73 65 </Q>
<Q ID="36"> 61 67 74 66 </Q>
<Q ID="37"> 68 70 71 69 </Q>
<Q ID="38"> 71 76 80 75 </Q>
<Q ID="39"> 72 77 81 76 </Q>
<Q ID="40"> 73 78 82 77 </Q>
<Q ID="41"> 74 79 83 78 </Q>
<Q ID="42"> 80 85 89 84 </Q>
<Q ID="43"> 81 86 90 85 </Q>
<Q ID="44"> 82 87 91 86 </Q>
<Q ID="45"> 83 88 92 87 </Q>
<Q ID="46"> 89 90 93 94 </Q>
<Q ID="47"> 91 92 95 93 </Q>
</ELEMENT>
<COMPOSITE>
<C ID="0"> Q[22-47] </C>
<C ID="1"> T[0-21] </C>
<C ID="2"> E[0-1] </C>
<C ID="3"> E[2-5] </C>
<C ID="4"> E[45] </C>
<C ID="5"> E[56] </C>
<C ID="6"> E[67] </C>
<C ID="7"> E[79] </C>
<C ID="8"> E[88] </C>
<C ID="9"> E[94-95] </C>
<C ID="10"> E[84] </C>
<C ID="11"> E[75] </C>
<C ID="12"> E[69] </C>
<C ID="13"> E[62] </C>
<C ID="14"> E[51] </C>
<C ID="15"> E[40] </C>
<C ID="16"> E[30] </C>
<C ID="17"> E[20] </C>
<C ID="18"> E[6] </C>
</COMPOSITE>
<DOMAIN> C[0-1] </DOMAIN>
</GEOMETRY>
<EXPANSIONS>
<E COMPOSITE="C[0]" NUMMODES="7" FIELDS="u" TYPE="MODIFIED" />
<E COMPOSITE="C[1]" NUMMODES="7" FIELDS="u" TYPE="MODIFIED" />
</EXPANSIONS>
<CONDITIONS>
<VARIABLES>
<V ID="0"> u </V>
</VARIABLES>
</CONDITIONS>
<GLOBALOPTIMIZATIONPARAMETERS>
<BwdTrans>
<DO_GLOBAL_MAT_OP VALUE="0" />
<DO_BLOCK_MAT_OP TRI="0" QUAD="0" />
</BwdTrans>
<IProductWRTBase>
<DO_GLOBAL_MAT_OP VALUE="0" />
<DO_BLOCK_MAT_OP TRI="0" QUAD="0" />
</IProductWRTBase>
<MassMatrixOp>
<DO_GLOBAL_MAT_OP VALUE="0" />
<DO_BLOCK_MAT_OP TRI="1" QUAD="1" />
</MassMatrixOp>
<HelmholtzMatrixOp>
<DO_GLOBAL_MAT_OP VALUE="0" />
<DO_BLOCK_MAT_OP TRI="1" QUAD="1" />
</HelmholtzMatrixOp>
</GLOBALOPTIMIZATIONPARAMETERS>
</NEKTAR>
<?xml version="1.0" encoding="utf-8"?>
<test>
<description>C0 Projection 2D with P=7, parallel</description>
<executable>ProjectCont2D</executable>
<parameters>-I GlobalSysSoln=IterativeStaticCond -P IterativeSolverTolerance=1e-12 ProjectionCont2D_P7.xml</parameters>
<processes>2</processes>
<files>
<file description="Session File">ProjectionCont2D_P7.xml</file>
</files>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-6">5.79152e-07</value>
</metric>
<metric type="Linf" id="2">
<value tolerance="1e-5">6.52922e-06</value>
</metric>
</metrics>
</test>
......@@ -442,8 +442,19 @@ namespace Nektar
" matrix block in Schur complement has "
"unexpected rank");
partMat[make_pair(k,k)] = BCOEntryType(
NekDouble scale = loc_mat->Scale();
if(fabs(scale-1.0) > NekConstants::kNekZeroTol)
{
Array<OneD, NekDouble> matarray(loc_lda*loc_lda);
Vmath::Smul(loc_lda*loc_lda,scale,
loc_mat->GetRawPtr(),1,&matarray[0],1);
partMat[make_pair(k,k)] = BCOEntryType(matarray);
}
else // scale factor is 1.0
{
partMat[make_pair(k,k)] = BCOEntryType(
loc_lda*loc_lda, loc_mat->GetRawPtr());
}
GlobalLinSys::v_DropStaticCondBlock(
m_expList.lock()->GetOffset_Elmt_Id(n));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment