00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <stdio.h>
00042 #include "mensagem.h"
00043 #include "memvirtu.h"
00044 #include "lowparam.h"
00045 #include "lowmacro.h"
00046 #include "lowsolid.h"
00047 #include "genfunc_.h"
00048 #include "vectorop.h"
00049 #include "eulerops.h"
00050 #include "analise_.h"
00051 #include "mancommd.h"
00052
00053 void MSD_execNameDensidadeAbsoluta(void)
00054 {
00055 char name1[12];
00056 float densrel;
00057
00058 while (2 != sscanf(restbuf, "%s %f", name1, &densrel))
00059 {
00060 printf("densidade absoluta: Nome dens");
00061 if (!lineins("? "))
00062 {
00063 return;
00064 }
00065 }
00066 MSD_highNameDensidadeAbsoluta(name1, densrel);
00067 }
00068
00069 int MSD_highNameDensidadeAbsoluta(char *name, real densrel)
00070 {
00071 int sn;
00072
00073 if ((sn = MSD_getSolidIdFromName(name)) == -1)
00074 {
00075 fprintf(stderr, MEN_NaoEncontrouSolidNome, NAM_DensAbs, name);
00076 return(ERROR);
00077 }
00078 return(MSD_highDensidadeAbsoluta(sn, densrel));
00079 }
00080
00081 int MSD_highDensidadeAbsoluta(Id sn, real densrel)
00082 {
00083 SPTYPE s;
00084
00085 if ((s = MSD_getSolid(sn)) == SNIL)
00086 {
00087 fprintf(stderr, MEN_NaoEncontrouSolido, NAM_DensAbs, sn);
00088 return(ERROR);
00089 }
00090 return(MSD_lowDensidadeAbsoluta(s, densrel));
00091 }
00092
00093 int MSD_lowDensidadeAbsoluta(SPTYPE s, real densrel)
00094 {
00095 if (densifluido != 0)
00096 {
00097 return(ERROR);
00098 }
00099 SolDensAbs(s) = densrel;
00100 SolDensRel(s) = densrel / densifluido;
00101 return(SUCCESS);
00102 }