Bugfix: Corrected the interpretation of I and J in ASMu2D::constrainCorner.

Added an XML-input file for adaptive linear-elastic analysis of the L-shape.

git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@1561 e10b68d5-8a6e-419e-a041-bce267b0401d
This commit is contained in:
kmo
2012-03-27 12:45:03 +00:00
committed by Knut Morten Okstad
parent 01b608ca13
commit 58ab50d36d
4 changed files with 113 additions and 22 deletions

View File

@@ -0,0 +1,12 @@
200 1 0 0
2 0
3 2
0 0 1 2 2
2 2
0 0 1 1
-1 1
-1 -1
1 -1
0 1
0 0
1 0

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Adaptive analysis of a linear-elastic 2D L-shaped domain.
Quadratic LR B-splines elements. !-->
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<patchfile type="bsplines">Lshape-1x1-p1.g2</patchfile>
<raiseorder patch="1" u="1" v="1"/>
<refine type="uniform" patch="1" u="3" v="3"/>
</geometry>
<!-- General - boundary conditions !-->
<boundaryconditions>
<propertycodes>
<code value="1">
<patch index="1" vertex="4"/>
</code>
<code value="12">
<patch index="1" vertex="2"/>
</code>
<code value="1000">
<patch index="1" edge="1"/>
<patch index="1" edge="2"/>
<patch index="1" edge="3"/>
</code>
</propertycodes>
<dirichlet code="1"/>
<dirichlet code="12"/>
<!-- fixpoint is not yet implemented for LR Splines, TODO kjetil?
<fixpoint patch="1" rx="0.5" ry="0.0" code="2"/>
<fixpoint patch="1" rx="0.5" ry="1.0" code="12"/>
!-->
</boundaryconditions>
<!-- General - numerical integration scheme !-->
<discretization>
<nGauss>3 4</nGauss>
</discretization>
<!-- General - postprocessing !-->
<postprocessing>
<projection>
<Global/>
<DGL2/>
<CGL2/>
</projection>
<vtfformat>BINARY</vtfformat>
</postprocessing>
<!-- General - adaptive control !-->
<adaptive>
<beta>10</beta>
<errtol>0.00001</errtol>
<maxstep>10</maxstep>
<maxDOFs>13000</maxDOFs>
<multiplicity>1</multiplicity>
<scheme>minSpan</scheme>
<symmetry>2</symmetry>
<use_norm>2</use_norm>
</adaptive>
<!-- Problem specific block !-->
<elasticity>
<isotropic E="1.0e5" nu="0.3"/>
<anasol type="Lshape" a="1.0" F0="1.0e5" nu="0.3" code="1000"/>
</elasticity>
</simulation>

View File

@@ -565,7 +565,7 @@ WARN_LOGFILE =
# with spaces.
INPUT = doc Apps/Poisson Apps/LinearElasticity \
src/SIM src/ASM src/Integrands \
src/SIM src/ASM src/ASM/LR src/Integrands \
src/Eig src/LinAlg src/Utility
# This tag can be used to specify the character encoding of the source files

View File

@@ -37,7 +37,7 @@
ASMu2D::ASMu2D (unsigned char n_s, unsigned char n_f)
: ASMunstruct(2,n_s,n_f), lrspline(0), tensorspline(0), workingEl(-1)
{
ASMunstruct::resetNumbering();
ASMunstruct::resetNumbering(); // Replace this when going multi-patch...
}
@@ -555,32 +555,40 @@ void ASMu2D::constrainEdgeLocal (int dir, int dof, int code)
void ASMu2D::constrainCorner (int I, int J, int dof, int code)
{
std::vector<LR::Basisfunction*> edgeFunctions;
if (I == 0 && J == 0)
lrspline->getEdgeFunctions(edgeFunctions, LR::SOUTH_WEST);
else if(I > 0 && J == 0)
lrspline->getEdgeFunctions(edgeFunctions, LR::SOUTH_EAST);
else if(I == 0 && J > 0)
lrspline->getEdgeFunctions(edgeFunctions, LR::NORTH_WEST);
else
lrspline->getEdgeFunctions(edgeFunctions, LR::NORTH_EAST);
std::vector<LR::Basisfunction*> edgeFunctions;
#ifdef SP_DEBUG
if(edgeFunctions.size() != 1) {
std::cerr <<" *** ASMu2D::constrainCorner: more than one corner"
<<" returned from lrspline->getEdgeFunctions()" << std::endl;
return;
}
#endif
// Note: Corners are identified by "coordinates" {-1,-1} {-1,1} {1,-1} {1,1}.
if (I < 0) {
if (J < 0)
lrspline->getEdgeFunctions(edgeFunctions, LR::SOUTH_WEST);
else if (J > 0)
lrspline->getEdgeFunctions(edgeFunctions, LR::NORTH_WEST);
}
else if (I > 0) {
if (J < 0)
lrspline->getEdgeFunctions(edgeFunctions, LR::SOUTH_EAST);
else if (J > 0)
lrspline->getEdgeFunctions(edgeFunctions, LR::NORTH_EAST);
}
this->prescribe(edgeFunctions.front()->getId()+1,dof%10,code);
if (edgeFunctions.empty())
std::cerr <<" *** ASMu2D::constrainCorner: Invalid corner I,J="<< I <<","<< J << std::endl;
else
this->prescribe(edgeFunctions.front()->getId()+1,dof,code);
if (edgeFunctions.size() > 1)
std::cerr <<" ** ASMu2D::constrainCorner: "<< edgeFunctions.size()
<<" corners were returned from lrspline->getEdgeFunctions()"<< std::endl;
}
// Hopefully we don't have to constrain non-corner singlenodes inside patches
// Hopefully we don't have to constrain non-corner single nodes inside patches.
// KMO: Actually, we would like to have this, to prescribe mid-edge points, etc.
// Can it be done, Kjetil?
void ASMu2D::constrainNode (double xi, double eta, int dof, int code)
{
#if 0
std::cerr <<" *** ASMu2D::constrainNode: Not implemented yet!"<< std::endl;
/*
if (xi < 0.0 || xi > 1.0) return;
if (eta < 0.0 || eta > 1.0) return;
@@ -592,7 +600,7 @@ void ASMu2D::constrainNode (double xi, double eta, int dof, int code)
if (eta > 0.0) node += n1*int(0.5+(n2-1)*eta);
this->prescribe(node,dof,code);
#endif
*/
}