Skip to content

Commit 66c236c

Browse files
authored
Merge pull request #45 from gismo/hot-fix-neumann
Changed Neumann boundary condition function for gsLookupFunction to support multi-patch
2 parents 367241c + 6296e5c commit 66c236c

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

examples/biceps_activeMuscle_3D.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ int main(int argc, char* argv[]){
133133
// setting Newton's method
134134
gsIterative<real_t> solver(assembler);
135135
solver.options().setInt("Verbosity",solver_verbosity::all);
136+
solver.options().setReal("RelTol",1e-4); // Should be 1e-9
136137
solver.options().setInt("Solver",linear_solver::LDLT);
137138

138139
gsInfo << "Solving...\n";

examples/muscleBeam_activeMuscle_3Dt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int main(int argc, char* argv[]){
4040
gsVector<> fiberDirection(3);
4141
fiberDirection << 1.,0.,0.;
4242
// space discretization
43-
index_t numUniRefDirX = 2;
43+
index_t numUniRefDirX = 0;
4444
index_t numUniRef = 0;
4545
index_t numDegElev = 0;
4646
bool subgridOrTaylorHood = false;

src/gsVisitorElasticityNeumann.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class gsVisitorElasticityNeumann
3636
const gsOptionList & options,
3737
gsQuadRule<T> & rule)
3838
{
39-
GISMO_UNUSED(patchIndex);
39+
currentPatch = patchIndex;
4040
// parametric dimension of the first displacement component
4141
dim = basisRefs.front().dim();
4242
// a quadrature rule is defined by the basis for the first displacement component.
@@ -59,8 +59,8 @@ class gsVisitorElasticityNeumann
5959
md.flags = NEED_VALUE | NEED_MEASURE;
6060
// Compute image of the quadrature points plus gradient, jacobian and other necessary data
6161
geo.computeMap(md);
62-
// Evaluate the Neumann functon on the images of the quadrature points
63-
neumannFunction_ptr->eval_into(md.values[0], neumannValues);
62+
63+
neumannFunction_ptr->piece(currentPatch).eval_into(md.values[0], neumannValues);
6464
// find local indices of the displacement basis functions active on the element
6565
basisRefs.front().active_into(quNodes.col(0),localIndicesDisp);
6666
N_D = localIndicesDisp.rows();
@@ -107,6 +107,7 @@ class gsVisitorElasticityNeumann
107107
// problem info
108108
short_t dim;
109109
const gsFunctionSet<T> * neumannFunction_ptr;
110+
index_t currentPatch; //gsLOOKUPFUNCTION
110111
T forceScaling;
111112
boxSide patchSide;
112113
// geometry mapping

src/gsVisitorThermoBoundary.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ class gsVisitorThermoBoundary
6969
// Compute image of the quadrature points plus gradient, jacobian and other necessary data
7070
geo.computeMap(md);
7171
// Evaluate temperature
72-
if (paramTemp) // evaluate temperature in the parametric domain
73-
temperatureField.piece(patch).eval_into(quNodes,tempValues);
74-
else // evaluate temperature in the physical domain
75-
temperatureField.eval_into(md.values[0],tempValues);
72+
temperatureField.piece(patch).eval_into(quNodes,tempValues);
7673
// find local indices of the displacement basis functions active on the element
7774
basisRefs.front().active_into(quNodes.col(0),localIndicesDisp);
7875
N_D = localIndicesDisp.rows();

0 commit comments

Comments
 (0)