55#ifdef __MPI_PARALLEL_MODE
73FreeWarping :: ~FreeWarping()
98 StructuralEngngModel :: initializeFrom(ir);
108#ifdef __MPI_PARALLEL_MODE
120FreeWarping :: computeCenterOfGravity()
122 int noCS = this->
giveDomain(1)->giveNumberOfCrossSectionModels();
131 for (
int i = 1; i <= this->
giveDomain(1)->giveNumberOfElements(); ++i ) {
132 int j = this->
giveDomain(1)->giveElement(i)->giveCrossSection()->giveNumber();
136 Sx.
at(j) += moments.
at(1);
137 Sy.
at(j) += moments.
at(2);
139 domainArea.
at(j) += fabs( this->
giveDomain(1)->giveElement(i)->computeArea() );
144 for (
int j = 1; j <= noCS; ++j ) {
145 double A = domainArea.
at(j);
147 CG.at(j, 1) = Sx.
at(j) / A;
148 CG.at(j, 2) = Sy.
at(j) / A;
156FreeWarping :: computeResultAtCenterOfGravity(
TimeStep *tStep)
158 int noCS = this->
giveDomain(1)->giveNumberOfCrossSectionModels();
168 for (
int j = 1; j <= noCS; ++j ) {
169 lcg.
at(1) =
CG.at(j, 1);
170 lcg.
at(2) =
CG.at(j, 2);
186double FreeWarping :: giveUnknownComponent(ValueModeType mode,
TimeStep *tStep,
Domain *d,
Dof *dof)
211 OOFEM_ERROR(
"Unknown is of undefined type for this problem");
225 counter =
currentStep->giveSolutionStateCounter() + 1;
229 currentStep = std::make_unique<TimeStep>(istep,
this, 1, (
double ) istep, 0., counter);
234void FreeWarping :: solveYourself()
239 #ifdef __VERBOSE_PARALLEL
247 StructuralEngngModel :: solveYourself();
252void FreeWarping :: solveYourselfAt(
TimeStep *tStep)
349FreeWarping :: updateDomainLinks()
351 EngngModel :: updateDomainLinks();
357FreeWarping :: printOutputAt(FILE *file,
TimeStep *tStep)
359 if ( this->
giveDomain(1)->giveOutputManager()->testTimeStepOutput(tStep) ) {
363 EngngModel :: printOutputAt(file, tStep);
365 fprintf(file,
"\n Center of gravity:");
366 for (
int j = 1; j <= this->
giveDomain(1)->giveNumberOfCrossSectionModels(); ++j ) {
367 fprintf(file,
"\n CrossSection %d x = %f y = %f", j,
CG.at(j, 1),
CG.at(j, 2) );
375 int count = 0, pcount = 0;
378 if ( packUnpackType == 0 ) {
379 for (
int map: commMap ) {
381 if ( jdof->isPrimaryDof() && ( jdof->__giveEquationNumber() ) ) {
394 }
else if ( packUnpackType == 1 ) {
395 for (
int map: commMap ) {
410 for (
int j = 1; j <= this->
giveDomain(1)->giveNumberOfCrossSectionModels(); j++ ) {
411 for (
auto &elem : this->
giveDomain(1)->giveElements() ) {
412 int CSnumber = elem->giveCrossSection()->giveNumber();
413 if ( CSnumber == j ) {
416 elem->giveLocationArray(locationArray, s);
417 if ( locationArray.
at(1) != 0 ) {
418 int cn = locationArray.
at(1);
419 if ( answer->
at(cn, cn) != 0 ) {
420 answer->
at(cn, cn) *= 2;
422 answer->
at(cn, cn) = 1000;
445 for (
int i = 1; i <= this->
giveDomain(1)->giveNumberOfElements(); i++ ) {
446 int CSnumber = this->
giveDomain(1)->giveElement(i)->giveCrossSection()->giveNumber();
448 this->
giveDomain(1)->giveElement(i)->giveLocationArray(locationArray, s);
449 for (
int j = 1; j <= 3; j++ ) {
450 int locationNumber = locationArray.
at(j);
451 if ( locationNumber != 0 ) {
452 CSindicator.
at(locationNumber) = CSnumber;
458 for (
int i = 1; i <=
length; i++ ) {
double length(const Vector &a)
#define REGISTER_EngngModel(class)
virtual int givePackSizeOfDouble(std::size_t count)=0
virtual int __giveEquationNumber() const =0
DofManager * giveDofManager(int n)
Element * giveElement(int n)
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
int estimatePackSize(DataStream &buff)
void initializeCommMaps(bool forceInit=false)
virtual TimeStep * giveCurrentStep(bool force=false)
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1).
ProblemCommunicator * communicator
Communicator.
std ::unique_ptr< TimeStep > previousStep
Previous time step.
MetaStep * giveCurrentMetaStep()
Returns current meta step.
int ndomains
Number of receiver domains.
Domain * giveDomain(int n)
std ::unique_ptr< TimeStep > currentStep
Current time step.
MetaStep * giveMetaStep(int i)
Returns the i-th meta step.
CommunicatorBuff * commBuff
Common Communicator buffer.
virtual int giveNumberOfFirstStep(bool force=false)
bool isParallel() const
Returns true if receiver in parallel mode.
int updateSharedDofManagers(FloatArray &answer, const UnknownNumberingScheme &s, int ExchangeTag)
void assembleVector(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
Index giveSize() const
Returns the size of receiver.
void resizeWithValues(Index s, std::size_t allocChunk=0)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void updateStiffnessMatrix(SparseMtrx *answer)
std ::unique_ptr< SparseLinearSystemNM > nMethod
Numerical method used to solve the problem.
std ::unique_ptr< SparseMtrx > stiffnessMatrix
NumericalMethod * giveNumericalMethod(MetaStep *mStep) override
Returns reference to receiver's numerical method.
FloatArray displacementVector
void computeResultAtCenterOfGravity(TimeStep *tStep)
void computeCenterOfGravity()
LinSystSolverType solverType
SparseMtrxType sparseMtrxType
void updateComputedResults(FloatArray &answer, TimeStep *tStep)
virtual double & at(int i, int j)=0
Returns coefficient at position (i,j).
virtual int init(bool force=false)
virtual Element * giveElementClosestToPoint(FloatArray &lcoords, FloatArray &closest, const FloatArray &coords, int region=0)=0
virtual void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
StructuralEngngModel(int i, EngngModel *master=nullptr)
Creates new StructuralEngngModel with number i, associated to domain d.
int giveMetaStepNumber()
Returns receiver's meta step number.
void incrementStateCounter()
Updates solution state counter.
ConvergedReason convergedReason
Status of solution step (Converged,.
void computeFirstMomentOfArea(FloatArray &answer)
#define _IFT_EngngModel_lstype
#define _IFT_EngngModel_smtype
#define OOFEM_LOG_INFO(...)
#define OOFEM_LOG_DEBUG(...)
FloatArrayF< N > assemble(const FloatArrayF< M > &x, int const (&c)[M])
Assemble components into zero matrix.
long StateCounterType
StateCounterType type used to indicate solution state.
ClassFactory & classFactory