Skip to content
Snippets Groups Projects
Commit f9811fc2 authored by Éric Béchet's avatar Éric Béchet
Browse files

added an "assemble" algorithm

parent d4a23e7e
No related branches found
No related tags found
No related merge requests found
...@@ -513,38 +513,9 @@ void MyelasticitySolver::solve() ...@@ -513,38 +513,9 @@ void MyelasticitySolver::solve()
for (unsigned int i = 0; i < elasticFields.size(); i++) for (unsigned int i = 0; i < elasticFields.size(); i++)
{ {
ElasticTerm<VectorLagrangeFunctionSpace,VectorLagrangeFunctionSpace> Eterm(P123,elasticFields[i]._E,elasticFields[i]._nu); ElasticTerm<VectorLagrangeFunctionSpace,VectorLagrangeFunctionSpace> Eterm(P123,elasticFields[i]._E,elasticFields[i]._nu);
fullMatrix<double> localMatrix; Assemble(Eterm,P123,elasticFields[i].g->begin(),elasticFields[i].g->end(),*pAssembler);
std::vector<Dof> R;
for ( groupOfElements::elementContainer::const_iterator it = elasticFields[i].g->begin(); it != elasticFields[i].g->end() ; ++it)
{
MElement *e = *it;
R.clear();
int integrationOrder = 3 * (e->getPolynomialOrder() - 1) ;
int npts=0;
IntPt *GP;
e->getIntegrationPoints(integrationOrder, &npts, &GP);
Eterm.get(e,npts,GP,localMatrix);
P123.getKeys(e,R);
pAssembler->assemble(R, localMatrix);
} }
}
/*
for (std::map<int, SVector3 >::iterator it = volumeForces.begin();it != volumeForces.end(); ++it)
{
int iVolume = it->first;
SVector3 f = it->second;
printf("-- Force on volume %3d : %8.5f %8.5f %8.5f\n", iVolume, f.x(), f.y(), f.z());
std::vector<GEntity*> ent = groups[_dim][iVolume];
for (unsigned int i = 0; i < ent.size(); i++)
{
// to do
// El.addToRightHandSide(*pAssembler, ent[i]);
}
}
*/
/* /*
for (int i=0;i<pAssembler->sizeOfR();i++) for (int i=0;i<pAssembler->sizeOfR();i++)
{ {
......
...@@ -259,5 +259,22 @@ template<class S1> class LoadTerm : public LinearTerm<S1> ...@@ -259,5 +259,22 @@ template<class S1> class LoadTerm : public LinearTerm<S1>
}; };
template<class T,class S1, class I,class A> void Assemble(T& term,S1& space1,I itbegin,I itend,A& assembler) // symmetric
{
fullMatrix<double> localMatrix;
std::vector<Dof> R;
for (I it = itbegin;it!=itend; ++it)
{
MElement *e = *it;
R.clear();
int integrationOrder = 3 * (e->getPolynomialOrder() - 1) ;
int npts=0;
IntPt *GP;
e->getIntegrationPoints(integrationOrder, &npts, &GP);
term.get(e,npts,GP,localMatrix);
space1.getKeys(e,R);
assembler.assemble(R, localMatrix);
}
}
#endif// _TERMS_H_ #endif// _TERMS_H_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment