35#include "PrescribedGenStrainShell7shell7base.h"
57double PrescribedGenStrainShell7 :: give(
Dof *dof, ValueModeType mode,
double time)
60 FloatArray *coords = dof->giveDofManager()->giveCoordinates();
62 if ( coords->giveSize() != this->centerCoord.giveSize() ) {
63 OOFEM_ERROR(
"PrescribedGenStrainShell7 :: give - Size of coordinate system different from center coordinate in b.c.");
67 if ( mode == VM_Total ) {
68 factor = this->giveTimeFunction()->evaluateAtTime(time);
69 }
else if ( mode == VM_Velocity ) {
70 factor = this->giveTimeFunction()->evaluateVelocityAtTime(time);
71 }
else if ( mode == VM_Acceleration ) {
72 factor = this->giveTimeFunction()->evaluateAccelerationAtTime(time);
74 OOFEM_ERROR(
"Should not be called for value mode type then total, velocity, or acceleration.");
103void PrescribedGenStrainShell7 :: setPrescribedGenStrainShell7Voigt(
const FloatArray &t)
111 }
else if ( n == 6 ) {
121 OOFEM_ERROR(
"setPrescribedTensorVoigt: Tensor is in strange voigt format. Should be 3 or 6. Use setPrescribedTensor directly if needed.");
125void PrescribedGenStrainShell7 :: updateCoefficientMatrix(
FloatMatrix &C)
137 int nNodes =
domain->giveNumberOfDofManagers();
139 int nsd =
domain->giveNumberOfSpatialDimensions();
141 C.
resize(npeq, nsd * ( nsd + 1 ) / 2);
145 double xbar = cCoords.
at(1), ybar = cCoords.
at(2), zbar = 0.0;
147 zbar = cCoords.
at(3);
150 for (
int i = 1; i <= nNodes; i++ ) {
159 C.
at(k1, 1) = coords->
at(1) - xbar;
160 C.
at(k1, 3) = coords->
at(2) - ybar;
164 C.
at(k2, 2) = coords->
at(2) - ybar;
165 C.
at(k2, 3) = coords->
at(1) - xbar;
168 OOFEM_ERROR(
"PrescribedGenStrainShell7 :: updateCoefficientMatrix - 3D Not tested yet!");
173 C.
at(k1, 1) = coords->
at(1) - xbar;
174 C.
at(k1, 4) = coords->
at(2) - ybar;
175 C.
at(k1, 5) = coords->
at(3) - zbar;
178 C.
at(k2, 2) = coords->
at(2) - ybar;
179 C.
at(k2, 4) = coords->
at(1) - xbar;
180 C.
at(k2, 6) = coords->
at(3) - zbar;
183 C.
at(k3, 3) = coords->
at(3) - zbar;
184 C.
at(k3, 5) = coords->
at(1) - xbar;
185 C.
at(k3, 6) = coords->
at(2) - ybar;
192double PrescribedGenStrainShell7 :: domainSize()
194 int nsd = this->domain->giveNumberOfSpatialDimensions();
195 double domain_size = 0.0;
197 Set *set = this->giveDomain()->giveSet(this->set);
200 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
201 Element *e = this->giveDomain()->giveElement( boundaries.
at(pos * 2 - 1) );
202 int boundary = boundaries.
at(pos * 2);
206 return domain_size / nsd;
245 std :: unique_ptr< SparseLinearSystemNM > solver(
classFactory.createSparseLinSolver(
ST_Petsc, this->domain, this->domain->giveEngngModel() ) );
251 std :: unique_ptr< SparseMtrx > Kff(
classFactory.createSparseMtrx(stype) );
252 std :: unique_ptr< SparseMtrx > Kfp(
classFactory.createSparseMtrx(stype) );
253 std :: unique_ptr< SparseMtrx > Kpf(
classFactory.createSparseMtrx(stype) );
254 std :: unique_ptr< SparseMtrx > Kpp(
classFactory.createSparseMtrx(stype) );
256 OOFEM_ERROR(
"MixedGradientPressureBC :: computeTangents - Couldn't create sparse matrix of type %d\n", stype);
258 Kff->buildInternalStructure(rve, 1, eid, fnum);
259 Kfp->buildInternalStructure(rve, 1, eid, fnum, pnum);
260 Kpf->buildInternalStructure(rve, 1, eid, pnum, fnum);
261 Kpp->buildInternalStructure(rve, 1, eid, pnum);
262 rve->
assemble(*Kff, tStep, eid, TangentStiffnessMatrix, fnum, this->
domain);
263 rve->
assemble(*Kfp, tStep, eid, TangentStiffnessMatrix, fnum, pnum, this->
domain);
264 rve->
assemble(*Kpf, tStep, eid, TangentStiffnessMatrix, pnum, fnum, this->
domain);
265 rve->
assemble(*Kpp, tStep, eid, TangentStiffnessMatrix, pnum, this->
domain);
270 Kpf->timesT(C, KfpC);
271 solver->solve(*Kff, KfpC, a);
280void PrescribedGenStrainShell7 :: initializeFrom(
InputRecord &ir)
282 GeneralBoundaryCondition :: initializeFrom(ir);
284 IR_GIVE_FIELD(ir, this->gradient, _IFT_PrescribedGenStrainShell7_gradient);
286 this->centerCoord.resize( this->gradient.giveNumberOfColumns() );
287 this->centerCoord.zero();
292void PrescribedGenStrainShell7 :: giveInputRecord(DynamicInputRecord &input)
294 BoundaryCondition :: giveInputRecord(input);
295 input.setField(this->gradient, _IFT_PrescribedGenStrainShell7_gradient);
#define REGISTER_BoundaryCondition(class)
const FloatArray & giveCoordinates() const
Dof * giveDofWithID(int dofID) const
virtual int __givePrescribedEquationNumber()=0
virtual FEInterpolation * giveInterpolation() const
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &s, Domain *domain)
void assembleVector(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
virtual double evalNXIntegral(int boundary, const FEICellGeometry &cellgeo) const
Domain * giveDomain() const
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Index giveSize() const
Returns the size of receiver.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
void zero()
Zeroes all coefficients of receiver.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void resize(Index rows, Index cols)
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
void subtract(const FloatMatrix &a)
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
IntArray dofs
Dofs that b.c. is applied to (relevant for Dirichlet type b.c.s).
FloatMatrixF< 3, 3 > gradient
Prescribed gradient .
void updateCoefficientMatrix(FloatMatrix &C)
virtual FloatArrayF< 3 > & giveCenterCoordinate()
Returns the center coordinate.
const IntArray & giveBoundaryList()
ClassFactory & classFactory
#define _IFT_PrescribedGenStrainShell7_centercoords